hermes - 💡(How to fix) Fix Bug: /sessions command is registered but has no handler — silent no-op in gateway and CLI

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

The /sessions command is registered in COMMAND_REGISTRY (hermes_cli/commands.py L113) but has no handler in either the gateway dispatcher (gateway/run.py) or the CLI dispatcher (cli.py). It results in a silent no-op — the user sends /sessions and gets zero response.

Root Cause

The /sessions command is registered in COMMAND_REGISTRY (hermes_cli/commands.py L113) but has no handler in either the gateway dispatcher (gateway/run.py) or the CLI dispatcher (cli.py). It results in a silent no-op — the user sends /sessions and gets zero response.

Fix Action

Fix / Workaround

The /sessions command is registered in COMMAND_REGISTRY (hermes_cli/commands.py L113) but has no handler in either the gateway dispatcher (gateway/run.py) or the CLI dispatcher (cli.py). It results in a silent no-op — the user sends /sessions and gets zero response.

2. No handler in gateway dispatcher

The gateway command dispatch chain in gateway/run.py (starting ~L5892) has canonical == "resume" (L6003) but no canonical == "sessions" branch. Unrecognized registered commands hit the "agent is running" guard or fall through silently.

Code Example

# hermes_cli/commands.py L112-113
# Configuration
CommandDef("sessions", "Browse and resume previous sessions", "Session"),

---

CommandDef("sessions", "Browse and resume previous sessions", "Session",
           cli_only=True),
RAW_BUFFERClick to expand / collapse

Summary

The /sessions command is registered in COMMAND_REGISTRY (hermes_cli/commands.py L113) but has no handler in either the gateway dispatcher (gateway/run.py) or the CLI dispatcher (cli.py). It results in a silent no-op — the user sends /sessions and gets zero response.

Details

1. Command is registered without cli_only=True

# hermes_cli/commands.py L112-113
# Configuration
CommandDef("sessions", "Browse and resume previous sessions", "Session"),

No cli_only=Truesessions is included in GATEWAY_KNOWN_COMMANDS → the gateway recognizes it as valid.

2. No handler in gateway dispatcher

The gateway command dispatch chain in gateway/run.py (starting ~L5892) has canonical == "resume" (L6003) but no canonical == "sessions" branch. Unrecognized registered commands hit the "agent is running" guard or fall through silently.

3. No handler in CLI dispatcher

cli.py process_command() (~L6748) also has no elif canonical == "sessions" branch.

4. Result: silent failure

Since sessions is in GATEWAY_KNOWN_COMMANDS:

  • Gateway does not emit the "Unknown command" fallback
  • Gateway does not forward it as plain text to the LLM
  • No handler runs → zero response to the user

The CLI hermes sessions browse works fine — this is specifically about the /sessions slash command inside an active chat session.

Suggested fixes (pick one)

Option A: Mark as cli_only (minimal)

The interactive session picker (hermes sessions browse) needs keyboard navigation and is not feasible in a messaging gateway. Mark it cli_only=True so the gateway properly rejects it:

CommandDef("sessions", "Browse and resume previous sessions", "Session",
           cli_only=True),

Option B: Add a gateway handler (full experience)

Add _handle_sessions_command() to gateway that lists recent sessions (similar to /resume with no args, but showing all sessions, not just titled ones). Users could then /resume <name> to switch.

Environment

  • Hermes Agent version: current main
  • Platform: Telegram gateway (affects all gateway platforms)
  • Reproduction: send /sessions in any gateway chat → no response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING