Repository navigation
Long chat replies no longer freeze while they stream - #35462
Conversation
[High impact] The PR changes saved text cadence and durability across native-chat provider streams. Fix the extra argument in the history test before merging. Findings
SummaryStreamed assistant and reasoning text now use a 400 ms elapsed-time gate instead of percentage growth.
One new helper call blocks type checking. brennanb2025 acknowledged full-copy storage growth and deferred its fix to #36024 and #36053, with no interim shipping approved.
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 2

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
5be73157-8d85-44d4-a632-6f2418c8f9dd
Files selected for processing: 19-
src/main/claude/claude-streamed-text-checkpoints.test.tssrc/main/claude/claude-streamed-text-checkpoints.tssrc/main/claude/claude-streamed-thinking.tssrc/main/claude/claude-structured-journal-translation.tssrc/main/codex/codex-structured-item-streams.tssrc/main/codex/codex-structured-journal-sink.tssrc/main/codex/codex-structured-journal-translation-settlement.test.tssrc/main/codex/codex-structured-journal-translation-streams.test.tssrc/main/native-chat/agent-session-journal/journal-row-writer.spec.tssrc/main/native-chat/agent-session-journal/journal-row-writer.tssrc/main/native-chat/agent-session-journal/journal-streamed-text-revision.test.tssrc/main/native-chat/agent-session-journal/journal-streamed-text-revision.tssrc/main/native-chat/agent-session-journal/journal-text-predecessors.tssrc/main/native-chat/agent-session-timeline/provider-timeline-assembler-streams.test.tssrc/main/native-chat/agent-session-timeline/provider-timeline-text-streams.tssrc/main/native-chat/agent-session-wire/agent-session-delta-coalescer.test.tssrc/main/native-chat/agent-session-wire/agent-session-delta-coalescer.tssrc/main/native-chat/agent-session-wire/agent-session-text-prefix.tssrc/main/native-chat/agent-session-wire/structured-agent-session-item-publication.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
-
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

Minor · Gate predecessor blanking on structural equality. · journal-text-predecessors.ts:65-96
src/main/native-chat/agent-session-journal/journal-text-predecessors.ts:65-96
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winGate predecessor blanking on structural equality.
JournalRowWriterstages every inserted row. The structural comparison inisJournalStreamedTextRevision()only selects the fsync mode.
appendItem()can create a higher-revision row with text-only blocks and changed metadata such asownerFence,executionOwner,turnScope, linkage, or body fields.JournalTextPredecessors.stage()checks only role and revision before updating the predecessor with blank text. This can erase the previous revision’s text for a non-text-equivalent revision.Add a structural-equality gate to
stage(). Reuse the normalized comparison used byisJournalStreamedTextRevision().

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
d817adce-feba-4653-90e2-859dcb4631d3
Files selected for processing: 15-
src/main/claude/claude-journal-turn-scope.test.tssrc/main/claude/claude-open-turn.tssrc/main/claude/claude-streamed-text-checkpoints.test.tssrc/main/claude/claude-streamed-text-checkpoints.tssrc/main/claude/claude-streamed-thinking.tssrc/main/claude/claude-structured-journal-translation.tssrc/main/codex/codex-structured-item-stream-bounds.tssrc/main/codex/codex-structured-item-streams.tssrc/main/codex/codex-structured-journal-translation-streams.test.tssrc/main/native-chat/agent-session-journal/journal-row-writer.spec.tssrc/main/native-chat/agent-session-journal/journal-text-predecessors.tssrc/main/native-chat/agent-session-wire/agent-session-delta-coalescer.test.tssrc/main/native-chat/agent-session-wire/agent-session-delta-coalescer.tssrc/main/native-chat/agent-session-wire/structured-agent-session-item-publication.test.tssrc/main/runtime/orchestration/structured-worker-journal-page.test.ts
Files skipped from review as they are similar to previous changes: 2-
- src/main/native-chat/agent-session-journal/journal-row-writer.spec.ts
- src/main/native-chat/agent-session-journal/journal-text-predecessors.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
-
There was a problem hiding this comment.
Actionable comments posted: 2

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
5ea1b33f-ac2e-4e8f-99c5-ba1dc773d9ee
Files selected for processing: 44-
src/main/acp/acp-history-journal-overlay.tssrc/main/claude/claude-checkpoint-import.test.tssrc/main/claude/claude-checkpoint-input.tssrc/main/claude/claude-checkpoint-intent.tssrc/main/claude/claude-checkpoint-test-support.tssrc/main/claude/claude-context-facts.tssrc/main/claude/claude-context-usage-test-support.tssrc/main/claude/claude-final-output-coverage.tssrc/main/claude/claude-journal-translator-contract.tssrc/main/claude/claude-journal-turn-scope.test.tssrc/main/claude/claude-message-journaling.tssrc/main/claude/claude-provisional-row-corrections.tssrc/main/claude/claude-stream-json-connection-close.test.tssrc/main/claude/claude-stream-json-connection.tssrc/main/claude/claude-stream-json-output.tssrc/main/claude/claude-streamed-text-checkpoints.test.tssrc/main/claude/claude-streamed-text-checkpoints.tssrc/main/claude/claude-streamed-thinking.tssrc/main/claude/claude-structured-event-delivery.tssrc/main/claude/claude-structured-journal-translation-subagents.test.tssrc/main/claude/claude-structured-journal-translation.test.tssrc/main/claude/claude-structured-journal-translation.tssrc/main/claude/claude-structured-resume-point.tssrc/main/claude/claude-structured-session-close.test.tssrc/main/claude/claude-structured-session-close.tssrc/main/claude/claude-structured-session-exit-lifecycle.tssrc/main/claude/claude-structured-session-journal-control.tssrc/main/claude/claude-transcript-catch-up-test-support.tssrc/main/claude/claude-transcript-catch-up.tssrc/main/claude/claude-transcript-import-plan.tssrc/main/claude/claude-transcript-item-reader.tssrc/main/claude/structured/claude-structured-session-acquisition.tssrc/main/claude/structured/claude-structured-session-open.tssrc/main/native-chat/agent-session-journal/journal-step-writer.tssrc/main/native-chat/agent-session-timeline/provider-timeline-assembler-streams.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-child-exit.tssrc/main/native-chat/agent-session-wire/structured-agent-session-event-sink-estimate.tssrc/main/native-chat/agent-session-wire/structured-agent-session-event-sink-queue.tssrc/main/native-chat/agent-session-wire/structured-agent-session-event-sink.test.tssrc/main/native-chat/agent-session-wire/structured-agent-session-event-sink.tssrc/main/native-chat/agent-session-wire/structured-agent-session-history-catch-up.tssrc/main/native-chat/agent-session-wire/structured-agent-session-output-drain.tssrc/main/native-chat/agent-session-wire/structured-agent-session-sink-operation.tssrc/main/native-chat/agent-session-wire/structured-agent-session-transition.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
-
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
7cf60e25-fe00-42c1-9d64-336f81640c71
Files selected for processing: 10-
src/main/claude/claude-checkpoint-input.tssrc/main/claude/claude-final-output-coverage.tssrc/main/claude/claude-streamed-text-checkpoints.tssrc/main/claude/claude-streamed-thinking.tssrc/main/codex/codex-structured-journal-streams-scaling.test.tssrc/main/native-chat/agent-session-timeline/provider-timeline-assembler-refusal.test.tssrc/main/native-chat/agent-session-timeline/provider-timeline-assembler-streams.test.tssrc/main/native-chat/agent-session-wire/agent-session-delta-coalescer.test.tssrc/main/native-chat/agent-session-wire/agent-session-delta-coalescer.tssrc/main/native-chat/agent-session-wire/agent-session-delta-work-test-support.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
-
Comments Outside DiffThese findings could not be posted inline.
|
|
Review loop finished on The problem. While an agent wrote a long reply, the reply could sit still for several seconds and then jump, because saves waited for the text to grow by a fixed share of its length. This PR saves reply text at most every 400 ms instead. A follow-up in this round removed two pieces of hidden work found by the native chat perf scan: Claude re-read the whole growing reply on every 60 ms window even when it then skipped the save, and running command or file-change output re-read and hashed everything printed so far on each save, only to keep a 16 KiB preview. What changed in this round.
Verified. CI on Not fixed here (main behaviour, listed for follow-up).
For Brennan's review
|
|
Closing: the streaming freezes on long replies are real, and the time-based checkpoint gate fixes them. But each checkpoint inserts a full-text row into journal_rows, and rows are removed only at epoch rollover, so stored size grows with the square of reply length, and a rate-capped version of the same design still writes about 80 times main's journal bytes for one long reply. Replay on session open pays for that too, including on remote hosts. The bundled changes (digest previews, Codex failure routing, reasoning durability, coalescer API) also need their own reviews. The fix needs a journal change first: streaming revisions replace the row in place, or streaming previews stay out of durable storage. A follow-up that changes the journal write path, with measured journal size and replay time, would be welcome. |
|
Final independent performance review (Astra high), on the pushed head. This is a blocked verdict, not a waiver. Two P1 performance findings block readiness. Linear retained SQLite data resolves the old journal-history problem, but does not resolve cumulative full-text rewrites or the downstream work newly exercised at 400 ms cadence. Reviewed pinned
The storage harness faithfully reaches the production Codex translator, deferred sink, journal, and real SQLite writer/reader workers. Raw results confirm two retained items, no The WAL result prevents an unconditional storage PASS.
Thus the old retained full-text history failure is not reproduced. However, under the unqualified “stored size” stop rule, the accelerated live DB/WAL result must remain BLOCKED. Narrowing that rule to settled database size would be an interpretation, not a measured universal pass. No multi-owner or blocked-reader storage run establishes the fleet behavior. The host-cost harness verifies exact 1k/10k/55k item populations, with five runs and 200 measured revisions each. It mounts one It does not instantiate production The final-head listener census is:
Empty deltas now return before dirtying/scheduling. The earlier keyed-deadline scan and fragmented timeline-batching findings are repaired in final source. Forced barriers remain immediate; token-usage notifications no longer force Codex text saves, and thread barriers leave other threads’ deadlines intact. These are source-reviewed conclusions; I ran no tests. All six scan questions were covered:
Touched regression classes: whole-message reprocessing/rewrites, history scans, repeated reads and publication fan-out are findings. Empty-input no-op publication and fragmented timers are repaired. Worker SQLite placement, visibility activation and keyed cleanup show no introduced defect. Protected streams bypass the ordinary 256-key cap; Claude auxiliary retention and uncapped subscriber promise-chain depth are pre-existing limitations. Their adverse-load behavior is not proven clean. The extracted prefix module adds no SDK/process startup mechanism. Trailing batching and lifecycle flushes are sound; that does not justify repeated-prefix cost. Real QA supports the paused-tail repair, but the completeness claim needs correction: durable tails arrived at +142 ms Claude / +54 ms Codex; reported complete rendered tails were +564 / +461 ms, not both within 400 ms. Reload preserved both tails, and resumed outputs reportedly completed exactly. Claude used Evidence verdict: FAIL/BLOCKED for final head. Detector output |
|
@OrcaWin — the measured answer to the closing objection is mixed, and this PR remains BLOCKED. After merging main once, streaming saves update the current On the M4Air, five trials at each reply length produced identical stored sizes/counts:
Settled storage is linear. However, full-prefix logical UPDATE payload totals 218,631,546 B at 256 KiB versus 2,733,924 B on main: about 80×, with roughly quadratic growth. These are logical payload bytes, not physical disk write counts. Accelerated saves reached a 135,074,232 B WAL high-water before page recycling; a separate one-trial control with 100 ms of real checkpoint opportunity per save kept WAL high-water near 4.4 MB. I cannot turn that control into an unconditional storage PASS. The accelerated live footprint meets the requested stop rule. Reopen medians were 119.0–123.5 ms on main and 123.5–125.9 ms on the PR over the four lengths; the full table and min–max spreads are in the rewritten PR body. The host-save/subscriber/status seam measured 2.49 / 8.84 / 37.77 ms per PR revision at 1k / 10k / 55k items, versus 2.49 / 8.79 / 37.58 ms on main (five corpora × 200 revisions). More frequent saves still amplify those costs. The final independent performance scan found two P1 blockers: repeated full-prefix processing/writes, and amplified history-wide reduction plus unrelated publication work. The harness also omits production settlement/queue/completion consumers and renderer work, so its numbers are partial host evidence. Scope is now only text checkpoint cadence: digest previews, Codex failure routing, reasoning durability changes and the broad coalescer API rewrite were dropped. No separate PRs were opened for them. Three fresh Claude/Codex repair passes left source correctness clean; the final measurement-aware performance verdict is FAIL/BLOCKED and is posted separately above. Real Claude and Codex pauses both survived reload while the producer stayed suspended, and both resumed to exact 400-line replies. Durable tails landed at +142 / +54 ms from SIGSTOP; complete rendered tails at +564 / +461 ms. Claude used the available Opus 5.5 medium picker entry, so the requested (screenshot removed: contained real product data) (screenshot removed: contained real product data) All 25 local changed checks passed immediately before normal push. The one CI watch finished with 66 passed and zero failed; the previously reported repository-wide wire compatibility extraction issue was not changed here. QA ran on production-identical 99d6b66; final d5e0dc1 only deletes tests. The app stopped gracefully, configs were unchanged and the QA slot was released. This is not ready to merge, and no merge was attempted. Benchmark: head=d5e0dc1bd505982ab2a346a22086000f76f996cf gate=FAIL storage live DB/WAL and cumulative prefix rewrite amplification; mounted one production chat subscriber and one status-feed subscriber for host cost, with full client delivery/renderer omitted. No waiver. |
|
BLOCKED — five P1 performance findings at Reviewed
Listener census at this head, including unchanged files and desktop. Rates are text-induced traffic after opening/initial metadata settle, with no unrelated tool/status/reconnect events. Per session and per subscribed client unless stated. A wholly unchanged frame ignores transport timestamps; text already displayed with a newly durable cursor is identified separately, because the cursor carries necessary information. Measured 32 KiB workload:
Census anchors: structured-agent-session-client-delivery.ts:295, structured-agent-session-publication-wiring.ts:22, structured-agent-session-conversations.ts:86, agent-session-subscriber-frame-fields.ts:64, structured-agent-session-status-feed.ts:210, structured-agent-session-host-assembly.ts:100. Global status/completion feeds are per host/client, not per each of 750 worktrees. Fleet prices use 100 active agents and independently vary owners, loaded rows or stream width to 10×; historical chats are not assumed mounted. Complete diff work inventory. Host work runs on local Electron main or the corresponding remote host process; existing SQL executes in writer/reader workers. Every changed production file and both test files are covered below.
Evidence and limitations. Read-only source audit plus external count harnesses on this Mac, run through The A/B harness executes the actual base/head Codex stream manager/coalescer; base copies come from the pinned git object with production dependencies resolved from this checkout. Its sink records admissions, supplies committed placements, coalesces live requests and calls the actual live publisher. It does not measure SQLite, durable listener execution or IPC. It verifies exact final text, ten minutes of settled silence with zero added saves/frames, and zero timers/source bindings after dispose. Separate production-helper seams count placement searches and duplicated snapshot/live content. The real reducer/context selector is exercised at explicit H with older history. The three targeted test files passed, four tests: Claude checkpoints, Codex translation streams, shared session reducer. These correctness controls do not prove smooth UI. No packaged Electron frame/event-loop/CPU trace, actual SQLite/WAL measurement, mobile split-frame capture, congested transport, or Windows/Linux/WSL/SSH runtime measurement was performed. Count amplification is established; a seconds-long stall is not claimed reproduced. Existing subscriber promise chaining has no latest-live replacement or independently demonstrated pending-payload bound; slow delivery requires a real congestion/control test. Existing Claude metadata/latest-text maps can survive coalescer eviction until lifecycle cleanup; the new placement map follows that lifetime, so text caps are not total-owner memory caps. Successful/closed paths showed no perpetual timer. Inspected refusal test coverage is not a sustained failed-writer/transport stress test. Six scan questions. (1) Work before skip: findings 1/2, including zero listeners and overlay-before-match. (2) Ownership multiplication: per-translator sources, per-client delivery, shared desktop owner and host feeds traced; findings 2/3/5. (3) Thread/storage: main joins/estimation, worker SQL and renderer work traced; continuous admission improved, sparse finding 4 remains. (4) Growth/progress: text length, loaded history, live-row width and commit width separately checked at N/10N; durable cursor/overlay provides catch-up, backlog bound remains unmeasured. (5) Host: no added subprocess/Git/filesystem discovery/native probes; remote host pays same preparation and negotiated suffix/phone projection differs. Host-specific timing unassessed; folder/non-git workspaces use the same session-keyed route. (6) Obsolete/idle work: cleanup and settled silence exercised, unobserved producer finding 1 remains; congestion/metadata limits stated. Cold open/reconnect gains overlay plus duplicate frame; no first-paint timing claim. Touched regression classes. Whole-message streaming/repeated prefix copies: findings 1/4. Hidden/unobserved work before skip: finding 1. Whole-live snapshots/unchanged row publication/identity churn: findings 2/3; one duplicate opening frame separately counted. History rescans/nested item lookup: findings 3/5. Whole-row rewrite per change: continuous gate matches base, sparse finding 4; no claim of accumulated full-text journal history. Fixed-cadence loop never settling: successful quiet/idle control disproves that for the new timer, refusal lifetime not stress-tested. Retention/fanout queues: source cleanup passes control; existing pending-delivery and metadata limits remain explicit gaps. Eager imports: helpers add no SDK/native initialization or independent startup service. New sync main-thread fs/SQLite or per-item subprocess calls: no matching diff; SQL retains worker ownership. Existing durable queue/observer amplification is pre-existing on growth saves and newly invoked by quiet saves, not charged to every live frame. Verdict: BLOCKED on this head’s own work counts. The 400 ms continuous full-prefix save loop is gone, and the reducer removes one retention walk. Those improvements do not close the five findings. Remedies need proportional operation/byte guards at the production seams with paused-tail durability, ordering, reconnect and final-flush controls. |
|
Perf-scan verdict: BLOCK — P1 performance regressions remain. Reviewed exactly The good change is real: continuous text no longer needs a durable save for every visible update, and in-place reducer updates avoid sorting and retention rescans. However, full-prefix work moves onto the 60 ms live path, that path reaches unchanged desktop history derivations, and quiet saves still bypass geometric growth indefinitely. The counts below establish amplification; they are not measurements of seconds of UI lag. Findings1. P1 — Full reply materialization now runs every live window, including unobserved Codex sessions; observed replies also undergo full serialization and local IPC. Introducing change: The new Price: at one occupied window per 60 ms, a 1 MiB reply means about 16.67 MiB/s of joined text per active stream, plus at least that much formatter input when observed, plus the full local IPC payload per local reader. At 100 unobserved Codex streams this is about 1.63 GiB/s of prefix materialization; at 1,000 it is 16.28 GiB/s. These are logical ASCII bytes presented to operations, not sampled memory bandwidth or CPU time. For K growing windows the work is Required guard: production producer → publication → wire, with zero and one subscriber, at N/10N windows and text sizes. Unobserved live-only appends should not materialize full snapshots; observed incremental output should not repeatedly serialize the prefix. Preserve first placement, ordering, reconnect snapshots, truncation signaling, final text, and geometric durable saves. 2. P1 — Live publication resends unchanged rows and can emit an entirely unchanged visible frame on every window. Introducing change: The per-row wire bounds make the no-change case particularly concrete: a phone row is limited to 72 KiB, and an ordinary client row to 1,984 KiB. Appends beyond the retained wire prefix produce the same shortened body. They still cause a fresh live frame; Required guard: one changed key among 10/100 placements sends only that change; repeat an identical post-projection value and emit zero frames; opening emits the live value once. Test clipped rows and a genuine visible change, revision/lifecycle change, reconnect, and final full-content access. Equality must be admitted before repeated expensive construction where possible; simply ignoring the frame in React is too late. 3. P1 — The 60 ms path still invalidates history-wide desktop work; the new binary search does not make a text update local. Introducing change: the new live producer cadence reaches The unchanged consumers are part of the production path: Price: H=1,024 gives about 17,067 copied references and at least 17,067 context-row visits/s per visible owner at 16.67 updates/s, before the additional walks above. H=10,240 gives 170,667 of each. One hundred active views would multiply these by 100; do not charge all 100 agents as visible views. H is not permanently capped at 1,024: older-page loading increases retained limits. A shared read owner avoids duplicate transport for the same host/session, but multiple mounted consumers still derive their own views. Pure hidden panes deactivate transport; a hidden consumer sharing an owner with a visible pane still receives that owner's store notifications. The old history walks predate this span; invoking them at the newly introduced live cadence is the amplification. Required guard: actual desktop owner and transcript projection at H and 10H, including one repeated no-op frame. Count upstream visits and copies, not just React commits. Keep live text isolated from history structure, while preserving lifecycle, attribution, retention, 4. P1 — Capped quiet-save backoff restores full-prefix durable rewrites for sparse streams. Introducing change: Price: for 100 such agents with a 1 MiB prefix, about 5.88 full-prefix saves/s and 5.88 MiB/s of logical body input to durable writes, plus their commit/publication work; at 1,000 agents, 58.82 saves/s and MiB/s. SQLite/WAL bytes are not measured and may differ. K small sparse appends still cost Required guard: 100/1,000 sparse bursts, quiet after each, plus a continuous-stream control and final flush. A durability solution must retain accepted text and eventual quiet/final saves without repeatedly rewriting the full prefix per sparse delta; incremental durable representation or a proven total-write budget needs validation. Work inventory: every changed production pathProduction reachability was checked through
Listener census at this headThis census includes registrations outside the diff. It distinguishes publication callbacks from wire frames: a callback can run and emit nothing. “Idle” means no input, no pending retry/catch-up and no owner transition. All paths below have 0 steady-idle frames/s, 0 unchanged frames/s. A final pending quiet save, initial snapshot, reconnect, lifecycle event or unrelated status change is not steady idle. Live text has one direct listener family: the session's
Durable commit listeners: one journal commit callback is installed by
For a numerical normal-stream example, S=20,000 characters and 100 characters/s need about 2,500 new characters for the next geometric checkpoint: approximately D=0.04 saves/s, versus F≈16.67 windows/s with sufficiently frequent deltas. The transcript sees roughly 16.63 live + 0.04 durable batches/s; stable status/completion/mailbox listeners emit 0. At 100/1,000 agents, the unobserved main-process producer work still multiplies by 100/1,000, while transport and renderer costs multiply only by actual subscribers/views. At a quiet tail, at most one pending quiet save is made; thereafter rates return to zero. A 17-second sparse stream instead has D≈0.0588/s per stream, as Finding 4 describes. Provider activity notifications are an additional, pre-existing source of row-free frames; they are event-driven and are not a new fixed 60 ms durable publication loop. Verification and coverageExecuted pinned-source operation probes (both exited 0): macOS, Node 26.5.0, existing esbuild TypeScript transform, fake monotonic clock, no GUI. Both base and target modules were loaded from the exact Git objects, not the concurrently edited source files. All probes ran through the shared test gate.
The continuous-workload “live” counts are producer publication requests, not emitted wire frames: its no-subscriber sink deliberately does not read live rows. This isolates the copy paid before interest admission. The sparse counts are actual calls to the producer's persistence seam; they are not measured disk/WAL byte counts. Additional head-only probes at the production publisher/reducer seams:
These checks reproduce the operation counts in Findings 1–4 and the idle/teardown controls. They do not measure React rendering or pretend the injected sink is SQLite. The five existing test files were run through The external probe loads production TypeScript directly from each pinned Git object, with an injected clock/sink for operation counts. Concurrent staged work appeared in this shared checkout during review; it was left untouched and is excluded from the verdict. The existing-test result is checkout-based, not an isolated pinned-build result. It is not a real SQLite write benchmark or an Electron/phone/network recording. No dependency installation, build, emulator, OS input or application launch was performed. No CPU/heap/frame-time claim is made. Windows/Linux/WSL/SSH and real mobile transports were inspected through shared routing, not executed.
The remaining evidence gaps are actual UI frame/event-loop/heap traces, stalled-transport queue bounds, and platform runtime costs. They do not demote the source-proven repeated work above. Fixes should be reviewed with the same N/10N production-seam counts and correctness controls before this pinned revision can receive a perf pass. |
|
Perf-scan verdict: BLOCK — performance regressions remain in the live-display path. Scope: The fixed 400 ms durable rewrite is absent here. Growth checkpoints remain geometric, and the new quiet-save deadline doubles after each quiet callback. That addresses the previous disk-write objection. It does not make the replacement live path incremental end to end. Findings (P1; block this revision)
Evidence and reproducibility Executed through
Only live frames are counted by that in-memory delivery port; the save column counts translator persistence calls, not physical SQLite transactions/bytes, and durable frames are not silently included in the live-frame column. Claude's string-join counter was unchanged between base and head, corroborating its pre-existing unobserved materialization. Additional executed assertions: a 100,000-character phone row and a 2,100,000-character desktop row, each followed by two 16-character tail appends at the same durable revision, emitted 3 frames each, of which the last 2 had identical row content; wire row sizes were exactly 73,728 and 2,031,616 bytes. An unchanged same-object live reread emitted 0 frames. A durable overlay followed by the same live row emitted 1 redundant live frame. One revised row copied exactly 1,000 / 10,000 retained references at H / 10H while correctly skipping the retention rescan and preserving the text-independent memo base. A quiet Codex command joined exactly 1,048,580 extra characters, with 0 additional saves; disposal left 0 timers. These are deterministic/source counts, not a measured renderer freeze, CPU percentage, RSS measurement, or disk-bandwidth measurement. The synthetic publication seam uses real translator stream owners/coalescer/live publication and wire forms with an in-memory commit/delivery port; it does not pretend to be a packaged Electron run or a full SQL-host benchmark. Every changed piece of work: trigger → population → bound/owner
Publication/listener census at the audited head Rates below count application data frames, not WebSocket heartbeats or display refresh. Idle means a connected, already-hydrated owner after its last quiet/lifecycle work settles: 0 frames/s and 0 no-change frames/s on both publication paths. Opening/reset is a finite snapshot burst, not idle cadence. Let
No-change rates are workload-specific: 0/f for ordinary unshortened growth, f/f after a stable shortening boundary, and conditional duplicate batches after durable overlay. A status/queue callback doing a check is not a transmitted no-change frame. All of these registrations and downstream paths were inspected in head code, including unchanged files; this is a static census, not a claim that all optional subscribers were mounted on this Mac. Six-question disposition / regression-class screen
Touched regression classes: streaming whole-prefix reprocessing F1; repeated unchanged input/output and no-op publication F3; history-wide derivation/identity churn F2; hidden/unobserved work and admission after construction F4; fixed timers not a permanent idle loop, but active-stream quiet checks remain; whole-row durable writes geometric growth plus logarithmically spaced quiet saves, not fixed 400 ms; per-entity lifetime normal disposal checked and forget paths inspected, caveats below; eager startup imports small local modules only, no new SDK load/client; subprocess-per-event no matching new path. The prefix utility move adds no new algorithm. No CI/build/infrastructure changes. Pre-existing costs and remaining evidence limits
|
|
@OrcaWin — this head takes the second route from your closing note: streaming previews stay out of durable storage. The reply's newest text goes to the screen every 60 ms through the existing live-text path, which writes nothing to disk. Saves are back to main's rule (the first text, then every ~12.5% of growth), plus one save after a second of quiet and the save at completion. Measured on the M4Air against main 4939ff1, with the same harness as before (5 fresh databases per length):
The bundled changes from the first round are gone; this PR is only the stream display and save cadence. Full tables are in the PR body. |
|
Perf-scan verdict: BLOCK — P1 performance regressions remain at Audited only Findings
Rate model and listener census These are source-derived application-event rates for an established, caught-up connection, not a running-user-machine listener inventory or compositor FPS. Counts exclude startup snapshots, reconnect resets, lifecycle edges, unrelated usage/tool/background-task events and transport heartbeats. The W/D model below describes the newly added Claude/Codex lane; the separate generic-source row records its different no-change behavior, which also applies when that source uses any of the listed transports. “Idle” means no provider input and any owed quiet save has settled. “No change” means unchanged application content, not merely an unchanged durable cursor: equal-cursor text batches contain real text changes. Let W be occupied coalescing windows/s (maximum approximately 16.67 for one continuous stream), D the growth/quiet/lifecycle durable checkpoints/s, and S the actual subscribers to that session. For uninterrupted text-only streaming, the extra live lane is approximately W−D; total transcript updates are approximately W, subject to queued-delivery coalescing. D is not 2.5/s or 1/s: length must reach
Desktop renderer census beyond the wire: every live state publication reaches the read owner's snapshot listeners ( The separate desktop status stream is shared per target. Its repository registration census is: Changed-work ledger (all 36 changed files, grouped by mechanism)
Six-question disposition and regression-class screen
Evidence and limits Executed the five relevant existing test files through Production-seam probes also ran through
A separate actual head-publisher loop sent each fresh row twice. It emitted 100 / 1,000 frames, zero duplicate unchanged-source frames, sized 2,505,000 / 70,050,000 text characters, and produced 2,533,900 / 70,339,000 cumulative whole-frame JSON bytes versus 42,700 / 427,200 after the actual append encoder. This compares JSON representations; it does not measure Electron structured-clone bytes or run IPC. With an already-shortened row, 100 further updates emitted 0 frames while full-form input contained 100,505,000 characters for a phone (1,000,000-character seed), or 300,505,000 for desktop (3,000,000-character seed). An independent fresh performance reviewer reproduced a stricter below-checkpoint case with exact source functions in standalone Node: seed 262,144 ASCII characters, then 16 characters/window for 1,000 windows. Base Codex admission had 0 joins/0 saves after the seed; head had 1,000 joins / 270,152,000 characters and still 0 saves. Desktop form sizing generated 270,289,000 cumulative JSON bytes. Phone fitting made 24,075 stringify calls / 2,040,519,293 cumulative JSON bytes, emitting 0 frames. That is 3.40 GB/s at 100 independently viewed phone sessions, 34.0 GB/s at 1,000, of cumulative serialization work, not network traffic, resident memory or CPU duration. This harness used source-equivalent reader wiring and inert journal/emit adapters; it did not run a real phone or transport. Its deterministic timer run counted 62 idle checks during 60 seconds of uninterrupted input, no streaming save, then one quiet save and zero remaining timers; disposal also left zero timers. Renderer/shared probes provide independent controls:
The independent review corroborated full-prefix work, remaining shared-history scans and unobserved lane admissions. This report additionally traced desktop transport and cloned-metadata invalidation. Neither review claims a reproduced multi-second stall, a measured P0 threshold, or proof that pending subscriber chains are bounded under an independent delivery blockage. Counts above price 100 active agents and 1,000 as the stress dimension, actual subscribers separately, and H/10H retained rows separately. The 750/7,500 worktree, repository/remote/ref and terminal-count dimensions do not enter these changed hot paths, so multiplying by them would be false. Tens of thousands of archived chats are not broadcast on live text; initial status hydration and historical SQL reads remain separate workloads. No build, app launch, external-machine QA, installs or code edits were performed. This scan proves work amplification, not that a particular multi-second stall was reproduced or that either suggested remedy is already validated. |
|
Status: not ready. A performance decision is needed from Brennan. Head Problem: long Claude/Codex replies froze on screen between saves. Change: reply text is shown every 60 ms through the live-text path, and saves stay on main's growth rule plus a quiet save and completion. Numbers and screenshots are in the PR body. Verified on this head:
Review:
Perf scan on this head: FAIL (report).
Deferred:
|
… the gap before it; compare block props without allocating A reply that redraws whole showed each save in two back-to-back frames and then sat still until the next save. It now takes the same two steps spread over the measured gap between saves, on the shared reveal clock. The block memo compare ran for every block on every step and built two entry arrays and a Map each time; it now compares in place.
…d redraws The previous commit spread a save on the shared step clock, which on a slow machine spaced draws further apart than the saves and could draw a save three times. A reply that redraws whole now draws half of a save's new text when it comes and the rest half the gap between saves later, off the shared clock; without a gap (the first save or the turn's end) the rest follows after the usual 350 ms. The gap rides in the reveal state, so a remount resumes on time. The block memo compare skips inherited keys, as the entries-based compare did.
…arrival, never draw a save back A remounted reply shown at its saves resumes its save's reveal instead of finishing it at once. Only the last save's arrival is kept, since that alone times the next draw. The save reveal starts from whichever is further, the screen or the reveal, so a finished reveal (a turn's end, reduced motion) is not reopened.
…text over a held save does no work A reply shown at its saves records which save's first half it drew, so reopening it schedules only the rest. Live text that arrives while it holds an unchanged save (another drawing of the chat still takes live text) no longer re-runs the reveal over the saved text. Only the last save's arrival is kept, since that alone times the next draw.
…ip the midpoint scan once drawn A save that keeps its text (it changed only attribution) still moves the reveal's save revision, so a remount doesn't take later live text as a save. A remount checks whether this save's first half is drawn before finding its midpoint.
…nothing When a save's remaining text is one unfinished word its midpoint adds nothing; recording the attempt anyway keeps a remount from scanning that word again.
…ing it every window Every 60 ms window reads every streaming reply's text, and rejoining the chunks copied the whole reply each time, even for chats nobody is viewing. New text is now appended to the kept text, which a save or a shown reply flattens once when it reads it, so a window no longer allocates a reply-sized string per stream.
… from pinning larger strings Each window's new text is now its own copy, so a delta sliced from a larger string can't keep that string alive, and the kept text is copied flat on the first join and then once every 64 windows that add to it, which bounds its concatenation chain at 64 links while still not copying a long reply every window.
Perf scan follow-up: PR #35462 at
|
| Class | Disposition and evidence |
|---|---|
| Streaming reprocesses whole text; hot-path rescans | Main coalescing replaces full-prefix joins on growth reads with owned additions and a full copy every 64 combining joins. Re-reading a consolidated stream copies no text. The pre-existing word scan above remains. |
| Work before skip gates | shouldEmit still runs before joining. Live readers reject hidden/uninterested rows and over-budget text before reading it. Codex’s save-growth gate remains intact. |
| No-op identities and publications | Unchanged save-paced text returns the existing reveal object; unchanged save revisions retain it. The markdown comparator removes entry arrays and a Map without broadening expensive renders. |
| Ownership multiplication and retained state | Save pacing retains at most one arrival. Midpoint attempts are remembered, including attempts revealing nothing. Held reasoning state keeps one key; existing forget/dispose paths release stream state. |
| Fixed cadence, hidden work, idle wakeups | Save reveals use at most one midpoint attempt and one deadline timer, cancelled on replacement or unmount. Completed reveals schedule none. This replaces an existing frame/deadline loop; steady-idle wakeups remain 0 → 0. Existing hidden normal-reveal scheduling is unchanged. |
| Collection derivation on streaming updates | Rail structure uses constant-time weak-map lookups and stable structural identities. Prompt indexes avoid rebuilding for text-only revisions; live preview work is restricted to the selected turn. |
| Synchronous main work and eager imports | The new string copier runs synchronously, but full-prefix copying is less frequent than baseline. No new filesystem, SQLite, subprocess, network, or heavyweight startup import was introduced. |
All six scan questions were addressed:
- Admission: traced coalescer → checkpoint/live publication → reader-interest gates → renderer.
- Multiplicity: counted per-stream coalescing, per-mounted-reply reveal work, and per-transcript rail work; no new all-chat fan-out.
- Thread: string copying runs on Electron main; reveal, comparison, parsing, and rail work run on the renderer.
- Growth/progress: inspected byte caps, append-chain resets, arrival pruning, midpoint memory, and advancing deadlines.
- Host effects: changed mechanisms are platform-neutral. No new host-specific probing or remote round trips.
- Retirement: inspected timer cancellation, hidden delivery admission, collapsible-body unmounting, and stream/reveal cleanup.
Coverage includes the six requested files and their scheduler, markdown/reasoning consumers, rail builders, string copier, Claude/Codex/provider stream owners, and live-publication/visibility callers. Both merge resolutions preserve the relevant pacing and structural-identity mechanisms.
Each fading word was a span with an opacity transition, which the compositor gives its own layer; once a reply streams smoothly those transitions actually run, and the layers held hundreds of MiB of GPU memory while replies streamed (gone with reduced motion). Words now fade their own color from transparent, which repaints the word and creates no layer. Links, inline code and blocks keep their opacity fade.
A stream that has only ever had one delta returned that delta as is, so a delta sliced from a larger string kept the larger string alive. The first read now copies it, as later reads copy appended text.
When a stream's owner skips a window (Codex below its next checkpoint), its deltas stayed raw, so a delta sliced from a larger string kept that string alive. The skipped window now joins its text like any other read.
A reply that redraws whole draws each save in two steps on timers, outside the step clock that lets typing go first. Each of those redraws now waits up to four 50 ms turns while a key or click is pending, so the input is handled before the long redraw instead of after it. The input check moves to the reveal scheduler module, which both paths share.
|
Status: not ready. One open finding (typing latency), so this needs a decision. Measured on the PR head against main (c475b79). Better than main:
Open:
Checks: perf scan clean; latest code audit pass; real-agent QA pass on ef04467. CI is rerunning on 336f892, which fixes a max-lines failure from the main merge. |
|
Status: code ready. One accepted trade-off. Problem. Long native-chat replies streamed unevenly: the reply could stall for seconds mid-stream, and 10 long chats at once used a lot of memory in the main process and the GPU. Change. Streamed text now appears in steady steps instead of stalls. A reply that is redrawn whole (footnotes) draws half of each new piece at once and the rest shortly after, waiting briefly while you type. The main process appends to each stream instead of re-joining it, and new words fade in by color instead of opacity, so they no longer each get a GPU layer. Brennan's decision. While a reply streams, key-dispatch p95 is 534 ms vs 402 ms on main; keystroke to painted frame p95 is better, 541 vs 607 ms. Brennan accepted this trade-off for smoother streaming: "accept it". Perf waiver (Brennan): "accept it" #35462 (comment) Verified.
Deferred. The perf scan's pre-existing, non-blocking long-word scan in |
…he text before them
…ng the final delta; drop a stray lockfile change
|
Perf scan (fresh reviewer), head 7686535. Full scan of the PR at 88f1d54 found two P1s, both fixed (subagent sheet header rebuilt per text window: 2953abb; skipped coalescer windows re-copied the whole reply: 88f1d54). Incremental scans of the truncation fixes found two more P1s, fixed in 4303654 and b42c20d. Final incremental scan below. No P0/P1 findings. The earlier clean result still holds for the two scoped files at Reviewed all five commits, the net diff from
Concrete adverse input inspected: The six scan questions resolve as follows:
Evidence is source inspection on this Mac. The surrogate correctness assertions and existing N/10N live-text contract were inspected, not executed. No edits, app launches, delegation, or runtime timing/heap claims. The marker carries forward the supplied earlier full-scan coverage and adds the two inspected test files. |
|
Status: code ready. One trade-off, accepted by Brennan. Problem. Long native-chat replies streamed unevenly: a reply could stall for seconds mid-stream, and 10 long chats at once used a lot of main-process and GPU memory. Change. Streamed text now appears in steady steps instead of stalls. A reply that redraws whole (footnotes) draws half of each new piece at once and the rest shortly after, waiting briefly while you type. The main process appends to each stream instead of re-joining it, and new words fade in by color instead of opacity, so they no longer each get a GPU layer. Brennan's decision. While a reply streams, key dispatch is slower: p95 904 vs 764 ms on the low-spec run below (534 vs 402 ms on the earlier run). Keystroke to painted frame is better (928 vs 987 ms). Brennan accepted this for smoother streaming: "accept it". Perf waiver (Brennan): "accept it" #35462 (comment) Fixed since the last status (336f892 → 7686535). Main was merged again, and fresh reviewers found and I fixed:
Verified on 7686535.
Deferred. The perf scan's pre-existing, non-blocking long-word scan in |





ELI5
Before: while Claude or Codex wrote a long reply in a chat, the reply often sat still for many seconds and then jumped ahead. The longer it got, the longer each wait, up to a minute. Typing in the message box could also lag while the reply streamed.
Now: the reply grows smoothly, a few words at a time, however long it gets. New words fade in briefly. Typing and scrolling stay responsive while it streams. If the agent pauses, the text written so far shows at once and survives a reload.
What Changed
As the user sees it:
The mechanism:
Why
Before, the screen updated only on saves, and saves are spaced by growth so long replies don't rewrite the database constantly. Tying the screen to saves made long replies freeze. Separating them keeps disk writes the same as before and lets the screen follow the text. The reveal backs off by how long its own steps take to draw, not at a fixed rate, so slow-to-draw replies can't starve input. Fixed rates either froze those replies or made typing lag.
Linked Issue
N/A: maintainer change, no pre-existing issue.
Visual Proof
(screenshot removed: contained real product data)
(screenshot removed: contained real product data)
Testing
Platforms: macOS (M4 MacBook Air) and Windows 11 (isolated QA copies). Linux is covered by CI only. Phones were checked through the shared reveal and the bounded live frames.
Measured on macOS, against main:
Known difference and follow-up
Performance
This adds work on a repeated trigger, bounded as follows:
Risk
Level: Medium.
AI Disclosure
Review
Agent skill upstream boundary
Notes
Security: no change. Cross-platform: the frame clock, timers and CSS work the same on all platforms. Remote: remote desktops get only the new text. Mobile: phones use the same shared reveal and bounded live frames. Backwards compatible with older clients. Performance: see Testing.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)