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.

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the focused queueing contribution. The requested bindings are not already present on current main, but this implementation needs reconstruction around the current input pipeline.

Problems

  • cli.py:8336 repurposes the shared Alt+Enter tuple. Current main deliberately aliases Shift+Enter and enhanced-terminal Ctrl+Enter to that tuple for multiline input (cli.py:13564-13589; tests/cli/test_cli_shift_enter_newline.py:40-78; tests/cli/test_ctrl_enter_newline.py:97-109), so this would also change those shortcuts into queue actions.
  • The new tagged dict payload has no current-main consumer: cli.py:15186-15199 only unpacks tuple image payloads before dispatch.
  • tests/test_cli_followup_queue.py validates field initialization only, not the shortcut, cancellation, ordering, or image paths.

Suggested changes

  • Rework this against the current handle_enter and process_loop paths while preserving busy-input modes.
  • Preserve the existing multiline key aliases, and add behavioral coverage for queue/recall/cancellation and image payloads.

Automated hermes-sweeper review.

Comment thread cli.py
@@ -8326,14 +8334,83 @@ def handle_enter(event):

@kb.add('escape', 'enter')
def handle_alt_enter(event):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This tuple is no longer Alt-only on current main: Shift+Enter and enhanced-terminal Ctrl+Enter are intentionally aliased to (Escape, ControlM) so they reach the multiline-newline handler (tests/cli/test_cli_shift_enter_newline.py:40-78, tests/cli/test_ctrl_enter_newline.py:97-109). Reassigning it to queueing would change all of those shortcuts as well.

@teknium1 teknium1 added sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 12, 2026
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 sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows 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)

3 participants