@devries-cameron20 / t3code Mirror · read-only / commits / ef81fd15ca
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 22, 03:15 UTC

fix(web): keep task updates static in the timeline (#31888)

Yash Singh committed Nov 6, 2026 at 02:59 UTC ef81fd15cae6b66d8983c70f38c39854d1fdb06f
2 files changed +72
apps/web/src/components/chat/MessagesTimeline.logic.test.ts
+69
@@ -55,6 +55,75 @@ describe("resolveAssistantMessageCopyState", () => {
55 });
56
57 describe("deriveMessagesTimelineRows", () => {
58 + it.each(["alone", "before tool", "before commentary and tool"])(
59 + "keeps an unfinished task update static %s",
60 + (placement) => {
61 + const runId = RunId.make("task-update-run");
62 + const at = "2026-11-06T00:00:00Z";
63 + const tasks: TimelineEntry = {
64 + kind: "work",
65 + id: "tasks",
66 + createdAt: at,
67 + entry: {
68 + id: "tasks",
69 + runId,
70 + createdAt: at,
71 + itemType: "todo_list",
72 + tone: "info",
73 + label: "Tasks 0/1 · Inspect the captures",
74 + toolLifecycleStatus: "inProgress",
75 + },
76 + };
77 + const commentary: TimelineEntry = {
78 + kind: "message",
79 + id: "commentary",
80 + createdAt: at,
81 + message: {
82 + id: MessageId.make("commentary"),
83 + role: "assistant",
84 + text: "Checking the rendering.",
85 + runId,
86 + streaming: false,
87 + createdAt: at,
88 + updatedAt: at,
89 + },
90 + };
91 + const tool: TimelineEntry = {
92 + kind: "work",
93 + id: "tool",
94 + createdAt: at,
95 + entry: {
96 + id: "tool",
97 + runId,
98 + createdAt: at,
99 + label: "Running sed",
100 + command: "sed",
101 + tone: "tool",
102 + toolLifecycleStatus: "inProgress",
103 + },
104 + };
105 + const rows = deriveMessagesTimelineRows({
106 + timelineEntries: [
107 + tasks,
108 + ...(placement === "before commentary and tool" ? [commentary] : []),
109 + ...(placement === "alone" ? [] : [tool]),
110 + ],
111 + runningRunId: runId,
112 + isWorking: true,
113 + activeTurnStartedAt: at,
114 + turnDiffSummaries: [],
115 + supportsConversationRollback: false,
116 + });
117 + expect(rows.find((row) => row.id === "tasks")).toMatchObject({
118 + kind: "work",
119 + groupedEntries: [tasks.entry],
120 + });
121 + expect(rows.filter((row) => row.kind === "work-live" && row.active)).toEqual(
122 + placement === "alone" ? [] : [expect.objectContaining({ entry: tool.entry })],
123 + );
124 + },
125 + );
126 +
127 it("stops stranded thinking after a steer and follows the next thought or tool", () => {
128 const runId = RunId.make("steered-run");
129 const at = "2026-10-01T06:19:10Z";
apps/web/src/components/chat/MessagesTimeline.logic.ts
+3
@@ -1627,6 +1627,7 @@ export function deriveMessagesTimelineRows(input: {
1627 entry.entry.sourceActivityKind === "runtime.error" ||
1628 entry.entry.itemType === "system_notice" ||
1629 entry.entry.itemType === "notification" ||
1630 + entry.entry.itemType === "todo_list" ||
1631 entry.entry.questionAnswer !== undefined ||
1632 isPendingApproval(entry.entry) ||
1633 !runIdIsActiveResponse(entry.entry.runId) ||
@@ -1925,6 +1926,7 @@ export function deriveMessagesTimelineRows(input: {
1926 timelineEntry.entry.sourceActivityKind === "runtime.error" ||
1927 timelineEntry.entry.itemType === "system_notice" ||
1928 timelineEntry.entry.itemType === "notification" ||
1929 + timelineEntry.entry.itemType === "todo_list" ||
1930 timelineEntry.entry.questionAnswer !== undefined
1931 ) {
1932 nextRows.push({
@@ -1950,6 +1952,7 @@ export function deriveMessagesTimelineRows(input: {
1952 nextEntry.entry.sourceActivityKind === "runtime.error" ||
1953 nextEntry.entry.itemType === "system_notice" ||
1954 nextEntry.entry.itemType === "notification" ||
1955 + nextEntry.entry.itemType === "todo_list" ||
1956 nextEntry.entry.questionAnswer !== undefined ||
1957 isPendingApproval(nextEntry.entry) ||
1958 activeWorkEntryIds.has(nextEntry.id) ||