Bug: busy_input_mode: queue only works during gateway drain, not normal task execution
Description
The busy_input_mode: queue configuration in display.busy_input_mode only takes effect during gateway drain (restart/shutdown). During normal task execution, new incoming messages always interrupt the running agent with "⚡ Interrupting current task...", regardless of the config setting.
This contradicts the expected behavior documented in the code comments and the CLI's behavior:
# cli.py line 1846 (CLI mode — works correctly)
# busy_input_mode: "interrupt" (Enter interrupts current run) or "queue" (Enter queues for next turn)
Expected Behavior
When display.busy_input_mode: queue is set, new messages received while the agent is executing a task should:
- Not interrupt the running agent
- Be queued for processing as the next turn after the current task completes
- User receives an acknowledgment that the message was queued
Actual Behavior
Regardless of busy_input_mode setting, new messages during normal task execution:
- Always interrupt the running agent
- Show "⚡ Interrupting current task (X min elapsed, iteration N/M)..."
- The agent abandons the current tool-calling loop
Root Cause
gateway/run.py lines 1249-1250:
def _queue_during_drain_enabled(self) -> bool:
return self._restart_requested and self._busy_input_mode == "queue"
This function gates queue mode behind _restart_requested, meaning queue mode only activates during gateway shutdown drain.
The function _handle_active_session_busy_message (line ~1554, "Normal busy case" branch) does not check self._busy_input_mode at all — it unconditionally interrupts the running agent.
Reproduction Steps
- Set
display.busy_input_mode: queue in profile config.yaml
- Configure gateway with Discord platform
- Send Zeus a long-running task: "list all files recursively in /root and analyze"
- While agent is processing, send a second message: "hi, are you busy?"
- Observe: agent shows "⚡ Interrupting..." instead of "⏳ Message queued..."
Environment
- Hermes version: 0.10.0
- Commit: ce08916
- Platform: Discord (gateway mode)
- Profile config has
display.busy_input_mode: queue
Suggested Fix
Add early return in _handle_active_session_busy_message checking _busy_input_mode before the interrupt logic. The pending_messages mechanism already handles queue processing — only the ack message and skip-interrupt logic need to be added.
I have a working local patch that I can submit as a PR if helpful. The change is ~25 lines, fully backward compatible (default behavior unchanged when busy_input_mode != "queue").
Impact
- Users configure queue mode expecting it to work, but get interrupt behavior
- Long-running tasks lose context when users send follow-up clarifications
- Inconsistent behavior between CLI mode (works) and gateway mode (broken)
Bug:
busy_input_mode: queueonly works during gateway drain, not normal task executionDescription
The
busy_input_mode: queueconfiguration indisplay.busy_input_modeonly takes effect during gateway drain (restart/shutdown). During normal task execution, new incoming messages always interrupt the running agent with "⚡ Interrupting current task...", regardless of the config setting.This contradicts the expected behavior documented in the code comments and the CLI's behavior:
Expected Behavior
When
display.busy_input_mode: queueis set, new messages received while the agent is executing a task should:Actual Behavior
Regardless of
busy_input_modesetting, new messages during normal task execution:Root Cause
gateway/run.pylines 1249-1250:This function gates queue mode behind
_restart_requested, meaning queue mode only activates during gateway shutdown drain.The function
_handle_active_session_busy_message(line ~1554, "Normal busy case" branch) does not checkself._busy_input_modeat all — it unconditionally interrupts the running agent.Reproduction Steps
display.busy_input_mode: queuein profile config.yamlEnvironment
display.busy_input_mode: queueSuggested Fix
Add early return in
_handle_active_session_busy_messagechecking_busy_input_modebefore the interrupt logic. The pending_messages mechanism already handles queue processing — only the ack message and skip-interrupt logic need to be added.I have a working local patch that I can submit as a PR if helpful. The change is ~25 lines, fully backward compatible (default behavior unchanged when
busy_input_mode != "queue").Impact