Skip to content

Send queued follow-ups as one turn when the agent finishes (#468) - #1665

Merged
currentbits merged 2 commits into
mainfrom
coder/combine-queued-follow-ups-into-one-turn-eaaf8b
Oct 18, 2026
Merged

currentbits merged 2 commits into
mainfrom
coder/combine-queued-follow-ups-into-one-turn-eaaf8b

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Several messages queued while the agent works now go to it as one turn, numbered in the order you typed them, instead of one turn each. Typing "also fix X", "and add a test", "don't touch Y" no longer gives you three runs that each re-pay the prompt prefix, where the second can't see the third. Closes #468.

Changes

  • When a turn finishes, every waiting follow-up is sent together. The model sees 3 follow-ups queued while you were working, oldest first. Handle them together as one request: followed by [1/3] …, [2/3] …, [3/3] …. The transcript shows the messages as typed, without the numbering.
  • Send now on a paused queue still sends only the top item as its own turn. The rest follow as one combined turn.
  • The queue is grabbed and cleared in one synchronous step, so a message queued after that waits for the next turn.
  • New setting Combine queued follow-ups into one turn in Settings → Threads (combineQueuedFollowUps), on by default. Off restores Workflow round 2: sign-in status, project defaults, queue + plan upgrades, lazy Git pane, terminal cleanup #1501's one-per-turn drain.

Verification

  • electron/test/queued-drain.test.js: 22/22. The Workflow round 2: sign-in status, project defaults, queue + plan upgrades, lazy Git pane, terminal cleanup #1501 one-per-turn tests now run with the setting off. New tests cover: on by default, three items become one run, an item queued after the take waits, Send now sends the head then the rest combined, and the label format.
  • npm run typecheck clean. test/settingsModal.test.tsx (new toggle test) and test/queuedFollowup.test.tsx pass. npx vite build passes.
  • npm run test:electron after rebasing onto main: the only failures were in mcp-inject.test.js, and that file passes 13/13 when run alone. The run was killed (SIGTERM) at about 968 of roughly 1,000 top-level tests, so the last ~30 suites didn't run on the rebased tree. The full pre-rebase run finished, and its remaining failures passed when rerun alone. A clean main checkout failed 3 of those same files, so they look environmental.

Notes for reviewers

  • Defaulting to on reverses Workflow round 2: sign-in status, project defaults, queue + plan upgrades, lazy Git pane, terminal cleanup #1501's one-per-turn behaviour for existing users. That's what the issue asks for ("default on, like Grok").
  • If a combined turn fails to start, the whole set goes back to the front of the queue (restoreQueuedHead already handles multi-item takes). A failed or stopped turn still never auto-starts what's left.
  • Left alone on purpose: when a fresh prompt is sent while queued items are waiting, they are still joined into it with plain line breaks, not numbered.

claude-opus-5-5 via Claude Code

🤖 Generated with Claude Code

When a turn finishes, every waiting type-ahead item now goes to the
agent as one numbered turn instead of one turn each. Send now still
sends only the head. A new setting, combineQueuedFollowUps (default on,
Settings > Threads), brings back #1501's one-per-turn drain.

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

chatgpt-codex-connector Bot commented Oct 18, 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-18T19:58:19.777301Z ace2dd2 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ace2dd2c38

ℹ️ 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".

Comment thread electron/runner.js
prompt: formatQueuedPrompt(taken),
prompt: formatQueuedPrompt({
...taken,
prompt: combinedQueuedPrompt(taken.items),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve slash-command dispatch when combining queued items

When two or more follow-ups are queued and one is a slash command such as /handoff, /advisor, /committee, or a custom command, this wrapper moves the slash away from the beginning of the prompt. Consequently, startRun skips both its orchestration-command interception and later custom-command expansion, so the command is sent as ordinary text to the current provider instead of performing its documented action; previously, draining each queued item separately preserved those semantics. Slash-command items should be drained separately or processed before adding the combined prompt header.

Useful? React with 👍 / 👎.

@currentbits
currentbits merged commit c97e2b5 into main Oct 18, 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.

Combine queued follow-ups into one turn

1 participant