Skip to content

Keep the composer draft when a mid-run queue write fails (#922) - #1648

Merged
currentbits merged 2 commits into
mainfrom
coder/failed-mid-run-queue-saves-clear-the-com-6a9ee1
Oct 16, 2026
Merged

currentbits merged 2 commits into
mainfrom
coder/failed-mid-run-queue-saves-clear-the-com-6a9ee1

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Fixes #922.

When a thread was working and threads.setQueued rejected, the busy branch of startRun (src/coder/useCoderRuns.ts) set the error but returned normally. Composer.runAction took the fulfilled promise as success and cleared the draft, attachments and paste cards, so the follow-up was lost even though nothing was queued.

The fix is one rethrow, the same thing the idle start, steer fallback, /btw and /goal branches already do.

Test

test/queuedFollowup.test.tsx runs the real App → useCoder → Composer path with a rejecting setQueued:

  • the draft text and file chip stay in the composer
  • there is no queued strip and no host queue
  • the error is visible
  • a retry that succeeds clears the composer and queues once

The test fails with the fix removed. The queued-follow-up, steer and composer suites pass locally (164/164).

Note

Callers that void onStartRun(...) (e.g. /compact) now get an unhandled rejection when a busy-thread queue write fails. A failed idle runs.start already does the same on those paths.

🤖 Generated with Claude Code

The busy branch of startRun caught a rejected threads.setQueued and
returned normally, so Composer treated the send as delivered and
cleared the draft, attachments and paste cards. Rethrow, like the idle
start, steer fallback, /btw and /goal branches already do.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T07:58:24.910646Z 1aab02d PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@currentbits
currentbits merged commit 02d35d9 into main Oct 16, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failed mid-run queue saves clear the composer and lose the follow-up

1 participant