feat: dual queue — follow-up (Alt+Enter) + steering (Enter/queue mode)#5319
Open
iRonin wants to merge 4 commits into
Open
feat: dual queue — follow-up (Alt+Enter) + steering (Enter/queue mode)#5319iRonin wants to merge 4 commits into
iRonin wants to merge 4 commits into
Conversation
This was referenced Apr 5, 2026
44f240b to
bbf9c4a
Compare
Both queues now hold in their list only — _pending_input is fed
exclusively by the post-turn drain, enforcing strict priority:
1. After each turn: dispatch steering queue first (one_by_one or
all_at_once per config). Follow-up is skipped this turn.
2. Only when steering queue is empty: dispatch follow-up queue.
Previously, one_by_one items went directly to _pending_input at
keypress time, so follow-ups queued before a steering message would
be processed first (FIFO). Now both queues are always deferred and
the drain decides order.
Follow-up when agent is idle still sends immediately (no deferral
needed when nothing is running to steer).
display.steering_dispatch: all_at_once | one_by_one (default) display.followup_dispatch: one_by_one (default) | all_at_once all_at_once: items held in the queue list only until the current agent turn completes, then drained and joined with \n---\n into a single combined message for the next turn. one_by_one: existing behaviour — each queued item goes straight into _pending_input and triggers its own agent turn.
Addresses review feedback from britrik (NousResearch#4788): - Replace text-based cancellation with UUID tags — identical messages queued twice no longer cancel each other incorrectly - Wrap Alt+Enter payloads as {_followup_tag, payload} dicts so process_loop can identify followup items by ID, not content - Fix phantom _followup_queue pops: display sync now only happens for tagged (Alt+Enter) items, not regular Enter messages - _cancelled_followups stores UUIDs (bounded, auto-discarded on match) Note: the image-payload cancel check was already correct in the original — both sides extracted text via payload[0] — but UUID tagging makes the intent unambiguous regardless of payload shape.
bbf9c4a to
4b884f5
Compare
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.
Two independent message queues for interacting with a running agent:
📬 Follow-up queue (Alt+Enter)
Queue messages to send after the current response completes, without interrupting.
📬 Ncount🎯 Steering queue (Enter in queue mode)
Queue mid-run steering messages that are dispatched at the earliest opportunity.
🎯 NcountConfiguration
Queue persistence
Both queues are saved to disk between turns and survive crashes. On resume (
hermes -cor/resume), pending items are restored.