Skip to content

Commit 990e9e0

Browse files
authored
fix(web): preserve handoffs before superseded attempt folds (#26333)
1 parent ce66aab commit 990e9e0

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎apps/web/src/components/chat/MessagesTimeline.logic.test.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2642,6 +2642,15 @@ describe("v2 run and attempt history", () => {
26422642
completedAt: null,
26432643
};
26442644
const timelineEntries = [
2645+
{
2646+
id: "context-handoff-entry",
2647+
kind: "event" as const,
2648+
createdAt: "2026-01-01T00:00:00Z",
2649+
attempt: supersededAttempt,
2650+
projectedItem: {
2651+
item: { type: "handoff", runId },
2652+
} as never,
2653+
},
26452654
{
26462655
id: "initial-user-entry",
26472656
kind: "message" as const,
@@ -2744,6 +2753,7 @@ describe("v2 run and attempt history", () => {
27442753

27452754
const collapsedRows = deriveMessagesTimelineRows(common);
27462755
expect(collapsedRows.map((row) => row.id)).toEqual([
2756+
"context-handoff-entry",
27472757
"initial-user-entry",
27482758
`attempt-fold:${supersededAttemptId}`,
27492759
"superseded-thread-created-entry",
@@ -2762,6 +2772,7 @@ describe("v2 run and attempt history", () => {
27622772
expandedAttemptIds: new Set([supersededAttemptId]),
27632773
});
27642774
expect(expandedRows.map((row) => row.id)).toEqual([
2775+
"context-handoff-entry",
27652776
"initial-user-entry",
27662777
`attempt-fold:${supersededAttemptId}`,
27672778
"superseded-assistant-entry",

‎apps/web/src/components/chat/MessagesTimeline.logic.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,7 @@ function deriveSupersededAttemptFolds(
770770
completeAttemptIds.has(entry.attempt.id) ||
771771
unfoldedRunIds.has(entry.attempt.runId) ||
772772
(entry.kind === "message" && entry.message.role === "user") ||
773+
(entry.kind === "event" && entry.projectedItem.item.type === "handoff") ||
773774
entry.kind === "html-render" ||
774775
entry.kind === "mcp-app" ||
775776
timelineEntryIsPersistentResourceCard(entry) ||

0 commit comments

Comments
 (0)