Repository navigation
Stream thread tails over IPC instead of the full transcript, and memoize message rows - #51
Merged
currentbits merged 2 commits intoAug 15, 2026
Conversation
pushDetail cloned the whole transcript on every stream event (~4 MB on the largest thread). It now diffs against the last push by element identity and sends only what changed, with a per-thread seq so a renderer that missed a push (web reconnect) refetches instead of merging onto a stale prefix. Renderer: Markdown and the message row are memo'd, so a push only re-parses the message that actually changed instead of every message in the thread. Fixes #28 Co-Authored-By: Claude Opus 5 <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
stopAll marks every active run idle with an interruption event, then called store.save() — which only arms a 250 ms unref'd timer since the store write debounce landed. On quit that write can be lost (a SIGTERM never runs the exit hook that flushes it), so the next launch sees status "working" and recoverInterruptedRuns re-stamps the run as a generic failure. saveNow() puts the bytes on disk before the process goes away. This is the one test failing in CI on this branch and on main. Co-Authored-By: Claude Opus 5 <[email protected]>
currentbits
deleted the
coder/ipc-full-transcript-pushed-on-every-chun-617bbd
branch
October 3, 2026 16:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #28.
Why
pushDetail(electron/runner.js) sent the result ofgetThreadDetail— the entiremessages+workLogarrays — on every stream event. The largest thread's message array is ~4 MB, structured-cloned per chunk. On the renderer side nothing was memoized, so each push re-ran react-markdown + remark-gfm over every message in the thread and rebuilt the whole timeline.What changed
Backend — send only what changed.
pushDetaildiffs the messages/work-log arrays against the last push by element identity (the store patches items immutably, so an unchanged item keeps its reference) and sends the tail plus its start index. Payload keeps theThreadDetailshape withmessagesFrom/workLogFromadded, so the channel name, preload allowlist, web bridge and the devCoder mock needed no changes — a full push is simply index 0.Renderer — merge the tail.
src/threadPatch.tsrebuildsprefix + tail; because the tail replaces everything from its index onward, a shrinking transcript (checkpoint restore, compaction) merges correctly too.useCodermerges into the open detail and refetches the full transcript when it cannot merge:seqskips a number — a web client that reconnects mid-run would otherwise keep a stale message in the middle (e.g. a tool card stuck on "running") forever.Renderer — stop re-parsing everything.
Markdownand the timeline's message row arememo'd; the row'smetaobject prop was flattened to scalars so the default shallow compare actually hits. A push now re-parses only the message that changed.Verification
electron/test/*: 682 pass / 11 fail — the same 11 (orch-server,stopAll, worktree-create) fail on unmodifiedmain.renderer
test/*: 727 pass / 0 fail.tsc --noEmitclean.New:
runner.test.jsasserts the tails fold back to the exact store transcript and that later pushes never re-send the full array;test/threadPatchWiring.test.tsxdrives the realAppthrough a tail merge, a seq gap and a hole. All three fail if the merge is reverted tosetDetail(next).Two existing tests read
push.payload.workLogas a complete log; they now fold the pushes / read the store.PR created by the Claude Code agent