Skip to content

fix(gateway): session toggle commands silently discarded during agent…#10116

Closed
elkimek wants to merge 2 commits into
NousResearch:mainfrom
elkimek:fix/toggle-commands-silently-discarded
Closed

fix(gateway): session toggle commands silently discarded during agent…#10116
elkimek wants to merge 2 commits into
NousResearch:mainfrom
elkimek:fix/toggle-commands-silently-discarded

Conversation

@elkimek

@elkimek elkimek commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Title: fix(gateway): session toggle commands silently discarded during agent run

What

/yolo, /verbose, /fast, /reasoning sent while an agent is running get silently discarded with no response to the user.

Why

When an agent is running, incoming messages hit the interrupt path and get queued as pending text. A safety net then discards slash commands from the queue. Other session-level commands (/status, /stop, /restart, /new, /approve, /deny, /background) are already intercepted early and execute immediately — these four were simply never added to that list.

Fix

Add /yolo, /verbose, /fast, /reasoning to the early-intercept section in _process_text_command() so they execute immediately without interrupting the running agent.

How to test

  1. Start gateway on any platform
  2. Send a message that triggers a slow agent response
  3. While agent is running, send /yolo
  4. Before fix: no response, command silently discarded
  5. After fix: immediate response toggling YOLO mode

Tested on: Ubuntu 22.04, Matrix gateway

elkimek added 2 commits April 15, 2026 06:02
… run

/yolo, /verbose, /fast, /reasoning sent while an agent is running
get queued as pending text and then discarded by the safety net
with no feedback to the user.

Add them to the early-intercept section alongside /status, /stop,
/approve etc. so they execute immediately without interrupting the
running agent.
Main upstream added a broader catch-all in _process_text_command() that
rejects any recognized slash command reaching the running-agent guard
with a "busy — wait or /stop first" message (fixes NousResearch#5057, NousResearch#6252, NousResearch#10370).

Keep the PR's specific handlers for /yolo, /verbose, /fast, /reasoning
BEFORE the catch-all — these four are state toggles that should actually
run (not be rejected) mid-agent. Resolution merges both blocks:

1. Toggle handlers (PR) — run yolo/verbose/fast/reasoning immediately
2. Dedicated info handlers (main) — help/commands/profile/update
3. Catch-all (main) — graceful "busy" reject for anything else

Dropped /reasoning from the catch-all's example list since it now has
an explicit handler above.

Verified: 151 related tests pass.
teknium1 pushed a commit that referenced this pull request Apr 20, 2026
/yolo and /verbose are safe to dispatch while an agent is running:
/yolo can unblock a pending approval prompt, /verbose cycles the
tool-progress display for the ongoing stream. Both modify session
state without needing agent interaction. Previously they fell through
to the running-agent catch-all (PR #12334) and returned the generic
busy message.

/fast and /reasoning stay on the catch-all — their handlers explicitly
say 'takes effect on next message', so nothing is gained by dispatching
them mid-turn.

Salvaged from #10116 (elkimek), scoped down.
teknium1 pushed a commit that referenced this pull request Apr 20, 2026
/yolo and /verbose are safe to dispatch while an agent is running:
/yolo can unblock a pending approval prompt, /verbose cycles the
tool-progress display for the ongoing stream. Both modify session
state without needing agent interaction. Previously they fell through
to the running-agent catch-all (PR #12334) and returned the generic
busy message.

/fast and /reasoning stay on the catch-all — their handlers explicitly
say 'takes effect on next message', so nothing is gained by dispatching
them mid-turn.

Salvaged from #10116 (elkimek), scoped down.
@teknium1

Copy link
Copy Markdown
Contributor

Salvaged via #12955 (merged as afd08b7 + 9d7aac7 on main). Your commit was cherry-picked with authorship preserved — git log shows you as the author of the fix.

Scoped down from 4 commands to 2 during review: /yolo and /verbose dispatch mid-run as you intended. /fast and /reasoning stay on the catch-all busy message — their handlers explicitly say "takes effect on next message," so dispatching them mid-turn just writes config with no observable benefit.

Also added 4 regression tests pinning both sides of the allowlist.

Thanks for the fix!

ulasbilgen pushed a commit to ulasbilgen/hermes-adhd-agent that referenced this pull request May 1, 2026
/yolo and /verbose are safe to dispatch while an agent is running:
/yolo can unblock a pending approval prompt, /verbose cycles the
tool-progress display for the ongoing stream. Both modify session
state without needing agent interaction. Previously they fell through
to the running-agent catch-all (PR NousResearch#12334) and returned the generic
busy message.

/fast and /reasoning stay on the catch-all — their handlers explicitly
say 'takes effect on next message', so nothing is gained by dispatching
them mid-turn.

Salvaged from NousResearch#10116 (elkimek), scoped down.
aj-nt pushed a commit to aj-nt/hermes-agent that referenced this pull request May 1, 2026
/yolo and /verbose are safe to dispatch while an agent is running:
/yolo can unblock a pending approval prompt, /verbose cycles the
tool-progress display for the ongoing stream. Both modify session
state without needing agent interaction. Previously they fell through
to the running-agent catch-all (PR NousResearch#12334) and returned the generic
busy message.

/fast and /reasoning stay on the catch-all — their handlers explicitly
say 'takes effect on next message', so nothing is gained by dispatching
them mid-turn.

Salvaged from NousResearch#10116 (elkimek), scoped down.
Luminet2023 pushed a commit to Luminet2023/hermes-agent that referenced this pull request May 1, 2026
/yolo and /verbose are safe to dispatch while an agent is running:
/yolo can unblock a pending approval prompt, /verbose cycles the
tool-progress display for the ongoing stream. Both modify session
state without needing agent interaction. Previously they fell through
to the running-agent catch-all (PR NousResearch#12334) and returned the generic
busy message.

/fast and /reasoning stay on the catch-all — their handlers explicitly
say 'takes effect on next message', so nothing is gained by dispatching
them mid-turn.

Salvaged from NousResearch#10116 (elkimek), scoped down.
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
/yolo and /verbose are safe to dispatch while an agent is running:
/yolo can unblock a pending approval prompt, /verbose cycles the
tool-progress display for the ongoing stream. Both modify session
state without needing agent interaction. Previously they fell through
to the running-agent catch-all (PR NousResearch#12334) and returned the generic
busy message.

/fast and /reasoning stay on the catch-all — their handlers explicitly
say 'takes effect on next message', so nothing is gained by dispatching
them mid-turn.

Salvaged from NousResearch#10116 (elkimek), scoped down.
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
/yolo and /verbose are safe to dispatch while an agent is running:
/yolo can unblock a pending approval prompt, /verbose cycles the
tool-progress display for the ongoing stream. Both modify session
state without needing agent interaction. Previously they fell through
to the running-agent catch-all (PR NousResearch#12334) and returned the generic
busy message.

/fast and /reasoning stay on the catch-all — their handlers explicitly
say 'takes effect on next message', so nothing is gained by dispatching
them mid-turn.

Salvaged from NousResearch#10116 (elkimek), scoped down.
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
/yolo and /verbose are safe to dispatch while an agent is running:
/yolo can unblock a pending approval prompt, /verbose cycles the
tool-progress display for the ongoing stream. Both modify session
state without needing agent interaction. Previously they fell through
to the running-agent catch-all (PR NousResearch#12334) and returned the generic
busy message.

/fast and /reasoning stay on the catch-all — their handlers explicitly
say 'takes effect on next message', so nothing is gained by dispatching
them mid-turn.

Salvaged from NousResearch#10116 (elkimek), scoped down.
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.

2 participants