Repository navigation
feat: queue drains one turn at a time, Steer now, reorder; plan card follow-ups (#1501 G3) - #1504
Conversation
Each queued item now runs as its own turn: drainQueued takes only the head and the next successful terminal drains the next one, so a failed or stopped turn leaves the rest parked. A failed start puts the head back in front. A machine notice flushed at the same terminal keeps the idle slot (a deferred start used to lose to the drain and bounce as "Not delivered"). Send now goes through a new runs.sendQueued. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Steer now injects one queued item into the live turn and drops it from the latest queue (matched by text, so a drain mid-hop cannot remove the wrong item). Hidden when the provider has no supportsSteer. Items drag to a new slot through the same replace write the Up/Down buttons use. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… file (#1501) - Keep planning takes optional notes. A live CLI gets them in the rejection; a persisted plan card sends them first in line as the next planning turn. - Implement in a new thread forks through the ordinary fork path with leavePlan, so the fork starts out of plan mode, and sends the plan as its first prompt. - Save plan to file (threads.savePlan) writes docs/plans/<date>-<slug>.md into the thread's checkout, never overwrites, refuses remote projects. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1f827edb79
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| try { | ||
| // ponytail: attachments stay queued and ride with the next drained | ||
| // head; the blob does not record which item they belong to. | ||
| await api.runs.steer({ threadId: id, prompt: item }); |
There was a problem hiding this comment.
Make steering atomic with removing the queued item
When steering succeeds but the subsequent threads.setQueued write fails, the instruction has already reached the live agent while remaining in the queue, so it will be sent again by the next drain. The same duplication can occur if the active turn completes between these two IPC calls and drains the item before the renderer removes it. Move the take/steer/restore operation into the main process so successful delivery and queue removal cannot diverge.
Useful? React with 👍 / 👎.
| // The start below is deferred, so a queued drain from the same terminal | ||
| // would win the idle slot and this notice would bounce off "already | ||
| // active" (#1501). Hold the drain until the notice turn owns the thread. | ||
| noticeStarting.add(threadId); |
There was a problem hiding this comment.
Block reentrant notice flushes during startup
While the first notice is awaiting startRun—notably during the initial whenPathReady() wait—active is still empty, and a second deliverNotice can enter flushOrchNotices despite this set entry. That second flush deletes its notice from orchNotices and starts a competing run; one start then loses with “already active,” leaving that worker notice permanently undelivered. Check noticeStarting before consuming another notice, rather than using it only to block queued drains.
Useful? React with 👍 / 👎.
| const thread: ThreadInfo = { | ||
| ...detail.thread, | ||
| queued: rest.length ? { prompt: rest.join("\n\n"), items: rest } : null, | ||
| }; |
There was a problem hiding this comment.
Restore the dev queue when Send now fails
In browser/dev mode, this clears the head from detail.thread.queued before calling runs.start, but start can reject—for example because the budget gate fires or a run became active—and there is no rollback. A rejected Send now therefore permanently loses the queued prompt and its attachments, unlike the production implementation's take-and-restore contract.
Useful? React with 👍 / 👎.
Item G3 of #1501.
Queue
drainQueuedtakes only the head item on each successful turn end. A failure or Stop leaves the rest parked, shown as "Queued, paused". A start that fails puts the item back at the front.runs.sendQueued, wired everywhere IPC is declared).isNoticeStarting); its own turn end drains the queue, and a refused notice leaves the queue parked. An "already active" race is no longer recorded as a queue error.Plan card
docs/plans/<date>-<slug>.mdin the thread's checkout. It never overwrites and refuses SSH projects.Verified independently, on main merged with this branch, #1502 and #1503:
vite buildpasses.memory-supMCP-cleanup test, a known load flake that passes alone.Limits:
🤖 Generated with Claude Code