Skip to content

feat: Alt+Enter queues follow-up messages, Alt+Up recalls them#8492

Open
iRonin wants to merge 5 commits into
NousResearch:mainfrom
iRonin:ironin/queue-followup
Open

feat: Alt+Enter queues follow-up messages, Alt+Up recalls them#8492
iRonin wants to merge 5 commits into
NousResearch:mainfrom
iRonin:ironin/queue-followup

Conversation

@iRonin

@iRonin iRonin commented Apr 12, 2026

Copy link
Copy Markdown
Contributor

Two complementary keybindings for managing a follow-up message queue while the agent is running.

Alt+Enter -- Queue follow-up

Queues the current input as a follow-up message instead of interrupting the running agent. Status bar shows queued count.

Alt+Up -- Recall queued follow-up

Pulls the most recently queued follow-up back into the input (LIFO).

Closes #5504

iRonin added 5 commits April 12, 2026 11:05
Alt+Enter now queues the current input as a follow-up to be sent after
the agent finishes responding, instead of inserting a newline.

- Alt+Enter → puts message into _pending_input (non-interrupting)
- Enter (agent running) → still interrupts via _interrupt_queue
- _followup_queue list mirrors pending items for display
- Status bar shows 📬 N when follow-ups are queued
- Placeholder hints update: shows queue depth while agent runs,
  and persists after it finishes until queue drains
- Ctrl+J remains the newline key for multi-line input

Closes: the need for Shift+Enter queue (terminals can't distinguish
Shift+Enter from Enter; Alt+Enter is the reliable alternative)
Alt+Up pops the most recently queued follow-up (LIFO) from
_followup_queue, appends it to the current input with a newline---
separator, and marks it cancelled so process_loop skips it.

Repeated Alt+Up recalls one at a time until queue is empty.
_cancelled_followups set is checked in process_loop and discarded
on match to avoid sending the recalled message twice.
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.
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard labels Apr 28, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related: #5319 is an earlier open PR for the dual-queue feature (also closes #5504). This PR appears to be a focused subset (follow-up queue only, no steering mode). If this supersedes #5319, consider closing the older PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: dual queue — follow-up (Alt+Enter) + steering (Enter/queue mode)

2 participants