Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): a streamed text delta no longer reruns the timeline's whole-thread passes #32769

ClosedEntrpi(GitHub profile, opens in a new tab)wants to merge 0 commits intomaria/redesign/2-composer-timeline fromrefs/pull/32769/headopened View on GitHub

Entrpi(GitHub profile, opens in a new tab)commented

Problem

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 useStableRows into deriveStableTimelineRows, 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.ts now 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:

    ItemsPasses in fullThis PRmain
    5170.13–0.16 ms0.04 ms0.04 ms
    2,1510.36–0.39 ms0.07–0.08 ms0.06 ms
    4,3010.71–0.80 ms0.10 ms0.10 ms
    8,6011.24–1.37 ms0.18–0.19 ms0.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-timeline passes: 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.

replay streaming through approval and completion

gpt-6.1-sol via Codex, in T3 Code.

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. Approvability

      Verdict: Approved at 73dcf59

      Macroscope'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).
    3. maria-rckscommented

      Note

      Written by gpt-6.1-sol on behalf of Maria

      Merged the current target branch maria/redesign/2-composer-timeline (df3c346b2c) into the existing head with merge commit 951249b12c, 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 df3c346b2ccf5ce870b842e3b208e9df53115cea passed 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.

      replay streaming through approval and completion

    4. tanstack-source added labelsbug

    5. This PR conflicts with maria/redesign/2-composer-timeline. Rebase it or merge maria/redesign/2-composer-timeline into it. If it still conflicts after 7 days with no activity, it will be closed automatically.

      See the conflict window.

    6. Note

      🤖 Claude Opus 5.5 responding on behalf of Theo

      Closing. This PR conflicts with main in 29 files, which is more than we will review as a rebase. If the change still matters, open a fresh PR from current main.

Sign in to join this conversation.