fix(web): a streamed text delta no longer reruns the timeline's whole-thread passes #32769
maria/redesign/2-composer-timeline fromrefs/pull/32769/head·opened View on GitHubProblem#
On the redesign, every streamed text delta reruns the timeline's working window and background activity groups over the whole thread. Row derivation already patches a streamed message's rows in place (replaceStreamingMessageRows), but useStableRows only short-circuits when it gets the same rows array, so the passes after it run in full on each delta. A delta costs 3–7× what it costs on main, and the gap grows with the thread.
Change#
- The working window, background groups and stable identities move from
useStableRowsintoderiveStableTimelineRows, a pure function the hook calls. Behavior is unchanged for every update that isn't a text delta. - When the entries differ only by streamed message text, and nothing else the passes read has changed, it applies the same message patch to its previous result instead of rerunning the passes. Those passes keep a message row as it is. If the working window or a collapsed background group has taken the message out of the rows, the passes run as before.
- The check for a text-only entry change is factored out of
replaceStreamingMessageRows, so both steps use the same one.
This is independent of #32756. Both target this branch.
Scope and approval#
A focused fix of a streaming performance regression against main, with no visible change. It qualifies as a small fix of an obvious bug: each text delta reruns two whole-thread passes whose results it can't change.
Verification#
The streaming row tests in
MessagesTimeline.logic.test.tsnow also compare the patched result with the passes run again. They cover a delta into the reply (all five text cases), a delta into commentary the working window holds (the fallback), and a delta into the answer a collapsed background group keeps. Rows other than the streamed message keep their identity.As a check that these tests exercise the shortcut: with it changed to return the previous result unchanged, the reply cases and the background-group cases fail, and the commentary case, which takes the fallback, still passes.
Derivation per text delta in Node, using this chain (entries, rows, then the passes) on synthetic threads where each run opens with a prompt and finished turns are folded, plus a live turn of 150 tool calls; medians of 3:
Items Passes in full This PR main517 0.13–0.16 ms 0.04 ms 0.04 ms 2,151 0.36–0.39 ms 0.07–0.08 ms 0.06 ms 4,301 0.71–0.80 ms 0.10 ms 0.10 ms 8,601 1.24–1.37 ms 0.18–0.19 ms 0.19 ms An earlier version of this table used a fixture without prompts, which made the working window scan the whole thread and overstated the first column. New tool calls are unchanged; this PR doesn't touch that path.
MessagesTimeline.browser.test.tsx: 52 of 52 pass.vp run check:changed origin/maria/redesign/2-composer-timelinepasses: format, lint, knip, typecheck, tests, and React Compiler coverage.
Claude Opus 5.5 via Claude Code, in T3 Code.
Takeover verification at 951249b12c#
Blacksmith changed-file checks pass, including all 143 timeline tests. Replay (dev) streaming, approval and completion were exercised through the real server and web client. The original three-file diff is unchanged. Performance timings were not remeasured.

gpt-6.1-sol via Codex, in T3 Code.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
Approvability#
Verdict: Approved at
73dcf59Macroscope's review found this PR approvable — Streamed assistant text now updates cached timeline rows without rerunning whole-thread presentation passes. The optimization retains the existing full derivation path for other changes and adds no persistent-data or external-system effects.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).Note
Written by
gpt-6.1-solon behalf of MariaMerged the current target branch
maria/redesign/2-composer-timeline(df3c346b2c) into the existing head with merge commit951249b12c, preserving the original three-file optimization unchanged (+306/-84). This resolves the base conflicts and brings in its agent-context-budget correction. No rebase or force push.All 30 checks are green; GitHub reports a clean merge. Blacksmith
vp run check:changed df3c346b2ccf5ce870b842e3b208e9df53115ceapassed formatting, lint, knip, typecheck, 143 timeline tests and React Compiler checks. Two independent scoped reviews found no issues. No inline bot findings were open.Verified Replay (dev) streaming, approval and completion through the actual server and web client using Chrome. This is interaction evidence, not a new performance measurement. Desktop and mobile were not exercised.
A separate merge of current main would add 507 files against this redesign base and require unrelated redesign fixes. That local merge was aborted to preserve the requested scope; the main-integration scope question remains open.

tanstack-source added labelsbug
This PR conflicts with
maria/redesign/2-composer-timeline. Rebase it or mergemaria/redesign/2-composer-timelineinto it. If it still conflicts after 7 days with no activity, it will be closed automatically.See the conflict window.
github-actions[bot](GitHub profile, opens in a new tab) added labelsneeds-rebase
Note
🤖 Claude Opus 5.5 responding on behalf of Theo
Closing. This PR conflicts with
mainin 29 files, which is more than we will review as a rebase. If the change still matters, open a fresh PR from currentmain.t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes