Repository navigation
Persist the mid-run follow-up queue on the thread record - #218
Merged
currentbits merged 1 commit intoAug 17, 2026
Merged
Conversation
The type-ahead queue lived only in renderer memory, so a reload dropped it and other threads could not show a pending hint. Store it on ThreadInfo.queued, append or clear via threads:setQueued (no updatedAt bump), derive the renderer queue from thread records, flush leftover queues on load, and hint pending queues in the sidebar. Fixes #137
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
currentbits
deleted the
coder/queued-follow-up-messages-live-only-in-r-80ec03
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 #137.
Problem
The type-ahead queue for a running thread lived only in renderer memory (
useCoder'squeuedstate +queuedRef) — the code carried its own admission of this in aponytail:comment. Two consequences:App.tsxrendered the queued strip only for the selected thread, so a queue pending elsewhere was invisible.Change
ThreadInfo.queued: { prompt, attachments? } | null— the queue now lives on the thread record, normalized inelectron/store.js(absent →null, same shape as the other late-added fields).threads:setQueuedendpoint, plumbed exactly wheresetPinnedis (services / ipc / preload / wireClient / shared ipc types / devCoder / fakeCoder).prompt: nullclears; a non-null prompt appends to any existing queue. The append moved from the renderer into the service on purpose: the old code did a synchronous read-modify-write on a ref, and once that hop is asynchronous, two quick follow-ups could race-replace each other. It never bumpsupdatedAt— queueing is not activity, same rule assetPinned.useCoderderivesqueuedfrom the thread records viauseMemo; the local state, the ref andapplyQueuedare gone. Persistence gives reactivity for free, since threads already stream in overthreads:changed/thread:updated.working. Without this, a queue that outlived a crash would never fire, because the settle transition that normally flushes it already happened.data-queued-doton the thread card, with the queued text as itstitle, alongside the existing unread and wait badges.Flush-on-settle behaviour is unchanged — the queue still delivers at the run's terminal, including
stopped.Tests
electron/test/services.test.js:setQueuedappends on a second call, clears onprompt: null, leavesupdatedAtalone, and throws naming an unknown thread.test/queuedFollowup.test.tsx: the queue round-trips through the API and survives a remount (and shows the sidebar dot); a leftover queue on a non-working thread flushes after load and clears the persisted copy before starting the run.electron/test/ipc-seam.test.jsgainedsetQueuedin its endpoint enumeration.Verification
tsc --noEmitclean. Renderer suite 718/718 pass. Electron suite 803 pass / 11 fail — all 11 reproduce unchanged at the base commit (10 orch-server tests that cannot bind a port in this environment, 1 webBridge socket reconnect test), confirmed 3/3 runs in a scratch worktree at6b19285. No delta from this change.