Skip to content

[Bug] Ctrl+C during slow slash commands exits session instead of interrupting #5142

@marmia

Description

@marmia

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

  1. Start hermes in interactive mode
  2. Run a slow slash command: /skills browse
  3. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/cliCLI entry point, hermes_cli/, setup wizardtype/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