[codex] Fix queued turn anchoring#736
Open
LacBang wants to merge 1 commit into
Open
Conversation
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.
Summary
/queuebefore rendering a user message, then enqueue only the resulting prompt while the main turn is busyCloses #638.
Root cause
Plain busy-turn follow-ups only appeared in the queue indicator above the composer, so their relationship to the tool output visible at submission time was lost when they later rendered as a normal next turn.
The dashboard slash-command path made this worse for
/queue: it optimistically appended the literal command and a pending agent bubble beforeslash.exec/command.dispatchresolved. Those rows became the renderer's latest transcript boundary while the previous turn was still streaming, so later reasoning, tool, and final events appeared after the queued command or updated the wrong bubble.Implementation
queueAnchoring.tscaptures the active turn's last visible message without mutating canonical chat state.MessageListbuilds a visual-only render plan that inserts pending queue notes, and later the real dequeued user message, at that captured boundary. Backend history and stream reducers continue to see the original canonical order.The
/queuesend-directive path now avoids optimistic transcript rows, queues only the resolved prompt while busy, and starts a normal prompt immediately when idle. Other slash commands and/btwretain their existing routing.Verification
npm test— 136 test files passed; 1,458 tests passed and 3 existing tests skippednpm run buildnpm run lint— no errors (existing repository warnings remain)npx lat.md checkReproduction covered
/queue <message>.Related implementation history: #711.