Skip to content

perf(web): skip checkpoint map rebuilds while streaming - #10118

Merged
t3dotgg merged 3 commits into
mainfrom
t3code/debt-gzuf-4-performance
Sep 6, 2026
Merged

perf(web): skip checkpoint map rebuilds while streaming#10118
t3dotgg merged 3 commits into
mainfrom
t3code/debt-gzuf-4-performance

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Sep 5, 2026

Copy link
Copy Markdown
Member

ChatView rebuilt rewind targets on every streaming update. Timeline row reuse depended on callers keeping two Maps stable.

The timeline now accepts checkpoint summaries and owns both lookups. Text-only updates reuse rows before checkpoint maps are rebuilt. Equal control snapshots preserve reuse. Rewind callbacks reject clicks from an old thread or checkpoint snapshot.

Verification

  • 301 focused timeline, ChatView logic, and Markdown tests pass after rebasing onto current main.
  • A long-thread fixture with 250 historical checkpoints uses the real client reducer, detail selectors, and attachment preview code. Ten text updates do not read checkpoint lookup fields in the timeline projection and keep historical row references. Image URL renewal and turn completion still update the rows.
  • A mounted timeline keeps code wrap state through streaming and highlighter recovery. Changed checkpoints send the current rewind target.
  • Web typecheck and targeted lint pass. Existing React lint warnings remain.

This changes the shared web and desktop timeline. It does not change mobile, provider behavior, or wire contracts. These are source and component checks, not browser CPU or frame measurements.

In a disposable browser, five streamed text updates kept the same connected code node, line-wrap state, and selected text. Changing the checkpoint summary changed the revert confirmation from checkpoint 1 to checkpoint 3. Both dialogs were cancelled. The same behavior passed on main and the combined integration build.

Browser evidence

Before is main 0c200c5f. After is combined integration 8316ed24. These checks use browser-only RPC events. No provider ran and no checkpoint restore was submitted. This is client behavior evidence, not a CPU or frame-rate measurement.

Before After
Streaming code controls before Streaming code controls after
Before After
Updated checkpoint confirmation before Updated checkpoint confirmation after

Before recording · After recording

Note

Skip checkpoint map rebuilds during streaming by moving revert logic into MessagesTimeline

  • Moves buildRevertTurnCountByUserMessageId from ChatView.logic.ts into MessagesTimeline.logic.ts, so checkpoint and revert-count calculation happens inside timeline row derivation instead of in the parent component.
  • Changes deriveMessagesTimelineRows input contract from two caller-precomputed Maps to a checkpoint summary array (turnDiffSummaries) and a supportsConversationRollback flag. The row builder now indexes assistant summaries and infers checkpoint counts locally.
  • Expands the unchanged-context check in replaceStreamingMessageRows to compare checkpoint-summary arrays, latest-turn values, and expanded-turn/work-group sets, so streaming updates reuse the previous row projection when row-affecting inputs are shallowly equal.
  • Replaces the message-ID revert callback with a numeric target-turn-count callback across MessagesTimeline.tsx, UserTimelineRow, and RevertUserMessageButton.
  • Risk: deriveMessagesTimelineRows now requires shallow-equal checkpoint-summary arrays to reuse streaming projections; callers passing new array references per render will rebuild rows every update and lose the streaming-skip optimization.
📊 Macroscope summarized 3b43359. 3 files reviewed, 1 issue evaluated, 0 issues filtered, 1 comment posted

🗂️ Filtered Issues

Model

Created with GPT-6 Astra in Codex. Follow-up test refinement and rebase with Codex. Browser verification and evidence upload in Codex.

@cursor

cursor Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Sep 5, 2026
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.5 KiB 13.5 KiB +15 B (+0.1%) 15.1 KiB
Codex Thread snapshot wire 7.0 KiB 7.0 KiB −3 B (−0.0%) 7.3 KiB
Codex Live turn WebSocket wire 6.5 KiB 6.5 KiB +18 B (+0.3%) 7.8 KiB
Codex Live turn WebSocket decoded 57.0 KiB 57.0 KiB 0 B (0.0%) 66.4 KiB
Codex Live turn messages 8 8 0 (0.0%) 21
Claude Total thread wire 13.6 KiB 13.6 KiB −6 B (−0.0%) 15.1 KiB
Claude Thread snapshot wire 7.0 KiB 7.0 KiB −1 B (−0.0%) 7.3 KiB
Claude Live turn WebSocket wire 6.6 KiB 6.5 KiB −5 B (−0.1%) 7.8 KiB
Claude Live turn WebSocket decoded 57.9 KiB 57.9 KiB 0 B (0.0%) 66.4 KiB
Claude Live turn messages 10 10 0 (0.0%) 21

Baseline: 7544d3d · PR result: 3b43359 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 113.8 KiB
  • Claude decoded thread snapshot: 114.5 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@macroscopeapp

macroscopeapp Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This production refactor changes streaming row reuse and passes a row-captured checkpoint count into an irreversible revert operation. A stale row may therefore target the wrong checkpoint after state changes, so the unresolved high-severity risk requires human review.

Not approved because:

  • 1 blocking correctness issue found at or above your repo's Minimum Blocking Severity

Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more.

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Sep 5, 2026
@t3dotgg
t3dotgg force-pushed the t3code/debt-gzuf-4-performance branch from b675765 to 327c9dd Compare September 6, 2026 04:32
@macroscopeapp
macroscopeapp Bot dismissed their stale review September 6, 2026 04:32

Dismissing prior approval to re-evaluate 327c9dd

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Sep 6, 2026
t3dotgg and others added 3 commits September 6, 2026 02:11
The revert callback in ChatView depended on the thread key and
checkpoint snapshot, so every checkpoint update recreated it and
rerendered every TimelineRowCtx consumer. Read the handler through a
ref with an empty dependency list instead, and drop the stale-click
guard that could only compare a callback against itself.

Also remove the react-test-renderer test that asserted data-wrap props
and highlighter call counts. The revert target update it covered is
already checked in MessagesTimeline.logic.test.ts.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@t3dotgg
t3dotgg force-pushed the t3code/debt-gzuf-4-performance branch from 327c9dd to 3b43359 Compare September 6, 2026 09:13
@macroscopeapp
macroscopeapp Bot dismissed their stale review September 6, 2026 09:13

Dismissing prior approval to re-evaluate 3b43359

Comment thread apps/web/src/components/ChatView.tsx
@t3dotgg
t3dotgg merged commit 076d753 into main Sep 6, 2026
26 checks passed
@t3dotgg
t3dotgg deleted the t3code/debt-gzuf-4-performance branch September 6, 2026 09:18
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Sep 6, 2026
## What's Changed
* feat(usage): pool subscription limits per provider across accounts and environments by @juliusmarminge in pingdotgg/t3code#10300
* chore(web): remove usage limits demo fixtures by @juliusmarminge in pingdotgg/t3code#10330
* fix(web): expose error disclosure state by @saphid in pingdotgg/t3code#10125
* fix(web): name the editor picker accurately by @saphid in pingdotgg/t3code#10124
* fix(web): make task row states readable by @saphid in pingdotgg/t3code#10128
* fix(web): explain hosted connection prerequisites by @saphid in pingdotgg/t3code#10129
* fix(web): name combobox chip removal targets by @saphid in pingdotgg/t3code#10127
* fix(marketing): present the Git workflow as an illustration by @saphid in pingdotgg/t3code#10130
* feat(mobile): pool usage limits across selected environments by @juliusmarminge in pingdotgg/t3code#10334
* fix(release): space automatic nightlies at least six hours apart by @t3dotgg in pingdotgg/t3code#10272
* refactor(web): share bulk thread deletion between sidebars by @t3dotgg in pingdotgg/t3code#10106
* refactor(client): share tool outcome rules by @t3dotgg in pingdotgg/t3code#10122
* refactor(server): share Claude result status and error mapping by @t3dotgg in pingdotgg/t3code#10296
* fix(server): settle inactive threads without a PR lookup by @t3dotgg in pingdotgg/t3code#10103
* fix(ssh): report remote stop failures without losing ownership by @t3dotgg in pingdotgg/t3code#10105
* perf(server): stop scanning old OpenCode parts by @t3dotgg in pingdotgg/t3code#10116
* perf(server): avoid full thread reads on turn start by @t3dotgg in pingdotgg/t3code#10108
* perf(web): skip checkpoint map rebuilds while streaming by @t3dotgg in pingdotgg/t3code#10118
* perf(server): skip plan bodies in thread summaries by @t3dotgg in pingdotgg/t3code#10341
* fix(server): skip disabled provider instances for text generation fallback by @t3dotgg in pingdotgg/t3code#10346
* fix(server): capture checkpoints before refreshing PR status by @t3dotgg in pingdotgg/t3code#10347
* fix(web): keep manual panel choices during a turn by @t3dotgg in pingdotgg/t3code#10113
* fix(threads): keep completed requests closed across clients by @t3dotgg in pingdotgg/t3code#10123
* perf(server): finish runtime messages without full thread reads by @t3dotgg in pingdotgg/t3code#10120
* refactor(server): let adapters declare context compaction by @t3dotgg in pingdotgg/t3code#10112
* fix(server): link thread PRs without an open client by @t3dotgg in pingdotgg/t3code#10101


**Full Changelog**: pingdotgg/t3code@v0.0.39-nightly.20260906.1293...v0.0.39-nightly.20260906.1303

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.39-nightly.20260906.1303
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant