Skip to content

CLI interrupt /stop command not working — agent runs uncontrollably #22176

@fwends

Description

@fwends

Bug Description

The /stop command and typing "stop" do not reliably interrupt a running agent on the CLI. When an agent is in a long-running task or queued operation, there is no effective way to halt execution.

Steps to Reproduce

  1. Start a long-running task (e.g., file operations, web automation, multi-step coding)
  2. Type /stop or "stop" while the agent is running
  3. Observe that the agent continues executing regardless
  4. Try Ctrl+C or other interrupt signals
  5. Agent keeps running, consuming tokens and executing tools

Expected Behavior

  • /stop should immediately halt the current agent run
  • Typing "stop" in busy/queue mode should cancel the pending operation
  • There should be a reliable keyboard interrupt (Ctrl+C) that kills the agent loop
  • The TUI and classic CLI should both respect stop commands consistently

Actual Behavior

  • /stop is ignored or queued behind other operations
  • "stop" typed during execution is not recognized as an interrupt
  • The agent continues running tool calls, API requests, and subagent spawns
  • No way to force-quit without killing the entire Hermes process
  • This is especially bad with subagents and delegate_task — they spawn children that also can't be stopped

Environment

  • OS: macOS
  • Hermes: latest (May 2026)
  • Terminal: both classic CLI and TUI
  • Model: various (OpenAI, Kimi, MiniMax)

Impact

This makes Hermes CLI effectively unusable for real work. When an agent goes off-track or gets stuck in a loop, the user has no recourse except to kill the terminal window. This wastes API credits, time, and creates a frustrating experience where the user feels they have lost control of their own machine.

Additional Context

  • The issue happens in both queue mode and when the agent is actively executing tools
  • Subagent delegate_task calls are particularly bad — they spawn independent processes that the parent can't kill
  • There should be an emergency brake that works at every level: agent loop, tool execution, subagent dispatch
  • Consider: SIGINT handler, a dedicated stop thread, or a process group kill mechanism

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High — major feature broken, no workaroundcomp/agentCore agent loop, run_agent.py, prompt buildercomp/cliCLI entry point, hermes_cli/, setup wizardcomp/tuiTerminal UI (ui-tui/ + tui_gateway/)type/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions