Description
Pressing Ctrl+C during slow slash commands (e.g., /skills browse) terminates the entire CLI session instead of interrupting the command and returning to the input prompt.
Steps to Reproduce
- Start
hermes in interactive mode
- Run a slow slash command:
/skills browse
- Press
Ctrl+C while the command is still loading
Expected Behavior
The slash command is interrupted and the user is returned to the input prompt (same as interrupting an agent mid-task with a normal prompt).
Actual Behavior
The entire CLI session exits and returns to the shell. The session may not be saved to state.db, making hermes -c unable to resume.
Root Cause
Slash commands are handled outside the agent loop (e.g., _handle_skills_command() → hermes_cli/skills_hub.py). The KeyboardInterrupt from Ctrl+C is not caught in this path, so it propagates to the outermost except (EOFError, KeyboardInterrupt, BrokenPipeError): pass in cli.py (around line 8011), which silently exits the session.
In contrast, Ctrl+C during agent execution is caught within run_agent.py's agent loop, properly interrupting the current task and returning to the input prompt.
Environment
- Hermes Agent (latest
main)
- Terminal: SSH session (Ghostty on Mac → VPS)
Description
Pressing
Ctrl+Cduring slow slash commands (e.g.,/skills browse) terminates the entire CLI session instead of interrupting the command and returning to the input prompt.Steps to Reproduce
hermesin interactive mode/skills browseCtrl+Cwhile the command is still loadingExpected Behavior
The slash command is interrupted and the user is returned to the input prompt (same as interrupting an agent mid-task with a normal prompt).
Actual Behavior
The entire CLI session exits and returns to the shell. The session may not be saved to
state.db, makinghermes -cunable to resume.Root Cause
Slash commands are handled outside the agent loop (e.g.,
_handle_skills_command()→hermes_cli/skills_hub.py). TheKeyboardInterruptfromCtrl+Cis not caught in this path, so it propagates to the outermostexcept (EOFError, KeyboardInterrupt, BrokenPipeError): passincli.py(around line 8011), which silently exits the session.In contrast,
Ctrl+Cduring agent execution is caught withinrun_agent.py's agent loop, properly interrupting the current task and returning to the input prompt.Environment
main)