Repository navigation
Keep the queue when a fresh turn fails preflight (#924) - #1652
Merged
currentbits merged 2 commits intoOct 16, 2026
Merged
Conversation
startRun folded the idle queue into a new user turn before the budget, provider and worktree gates, so a rejected start dropped the queued text and attachments on disk. Restore the taken queue (in front of anything queued since) on any throw before the turn is accepted, and record only the turn's own prompt on a worktree failure so Retry cannot deliver the queue twice. 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. |
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 #924.
Problem
startRuntook the idle queue (takeQueued) and folded it into a new user turn before the budget gate, the provider-binary check and worktree setup. When any of those threw, the queued text and attachments were gone, and they were gone on disk too.Fix (
electron/runner.js)startRunis now a thin wrapper around the old body (startRunFolded). The body records the queue it took infold.taken. On any throw before the turn is accepted, the wrapper calls the existingrestoreQueuedHead, which puts the queue back in front of anything queued in the meantime.fold.takenis cleared, at three points: the orchestrator fork launches, the turn is parked in the run queue (enqueueRunholds the combined prompt), or the user message is about to be appended. This keeps delivery to exactly once.Tests (
electron/test/queued-drain.test.js, real Store +createRunner)saveNowand a freshStoreload.Cases 1–4 fail on the unfixed runner. Full electron suite in a CI-like env (CODER_* unset, minimal PATH): 4745 pass, 2 fail. Both failures are in
provider-usage.test.js; that file passes 22/22 when run alone, so they look like timing failures under load.🤖 Generated with Claude Code