Skip to content

fix(gateway): respect busy_input_mode=queue during normal agent runs#14762

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-185441ae
Apr 23, 2026
Merged

fix(gateway): respect busy_input_mode=queue during normal agent runs#14762
teknium1 merged 2 commits into
mainfrom
hermes/hermes-185441ae

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Queue mode now works during normal operation, not just during gateway restart drain. With display.busy_input_mode: queue, a second message arriving while the agent is working gets queued for the next turn instead of calling running_agent.interrupt() — which was killing in-flight delegate_task subagents.

Default (interrupt) behavior is unchanged. Opt-in only.

Root cause

_handle_active_session_busy_message() unconditionally called running_agent.interrupt(event.text). The _busy_input_mode config was only consulted inside _queue_during_drain_enabled(), so queue mode silently did nothing outside restart drain.

Changes

  • gateway/run.py: branch on is_queue_mode = self._busy_input_mode == 'queue' before calling interrupt(); ack wording branches between Interrupting and Queued for the next turn. All other debounce/status logic stays shared.
  • tests/gateway/test_busy_session_ack.py: adds test_queue_mode_suppresses_interrupt_and_updates_ack.

Validation

Before After
2nd message in interrupt mode agent interrupted agent interrupted (unchanged)
2nd message in queue mode agent interrupted, subagents killed message queued, agent keeps running

8 tests pass in tests/gateway/test_busy_session_ack.py (including the new queue-mode test).

Credit

Salvaged from #13894 by @whitehatjr1001 — cleanest of three parallel fixes (#8544, #12235, #13894) for the same bug. Also credit to @dpaluy (#12235) for an earlier implementation. Repro and confirmation from @barteq100 in Discord reporting that interrupt-mode broke his research_queue Telegram topic skill by killing delegate_task subagents.

Closes #12235, #13894, #8544.

@teknium1 teknium1 merged commit d001814 into main Apr 23, 2026
10 of 11 checks passed
@teknium1 teknium1 deleted the hermes/hermes-185441ae branch April 23, 2026 22:12
@alt-glitch alt-glitch added type/bug Something isn't working P1 High — major feature broken, no workaround comp/gateway Gateway runner, session dispatch, delivery labels Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P1 High — major feature broken, no workaround type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants