Skip to content

fix(cli): wire /sessions slash command in the classic CLI - #25986

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-3e6ee7c3
May 14, 2026
Merged

fix(cli): wire /sessions slash command in the classic CLI#25986
teknium1 merged 2 commits into
mainfrom
hermes/hermes-3e6ee7c3

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Salvage of #25231 by @explainanalyze.

/sessions is in the central COMMAND_REGISTRY (registered since #20805) and surfaces in /help, tab-completion, and the gateway. The TUI wires it to its SessionPicker overlay. The gateway dispatches sessions browse. But the classic CLI's process_command() was missing the elif branch — the canonical name fell through to "Unknown command: sessions". Community user hit this on Windows and WSL ("Unknown command: /sessions").

Changes

  • cli.py: new _handle_sessions_command() + elif branch next to /resume. No-arg prints the recent-sessions table; /sessions <id_or_title> delegates to _handle_resume_command() for parity with /resume.
  • tests/cli/test_cli_init.py: 4 regression tests covering dispatcher wiring + handler paths.

Validation

Result
pytest tests/cli/test_cli_init.py -k sessions 6 passed (5 new + 1 pre-existing resume)
pytest tests/cli/test_cli_init.py 38 passed
resolve_command("sessions") returns CommandDef (registered)
"canonical == \"sessions\"" in process_command source True (after this PR)
HermesCLI._handle_sessions_command exists True (after this PR)

Reuses existing primitives — no new state, no new config keys. Closes #25231.

explainanalyze and others added 2 commits May 14, 2026 15:58
The 'sessions' command has been registered in the central command
registry since #20805 (May 2025) and surfaces in /help and tab-completion,
but the classic CLI's process_command() never had an elif branch for it.
The canonical name fell through and printed 'Unknown command: sessions'.
The TUI side was wired up correctly via the SessionPicker overlay; only
the legacy CLI was missing the dispatch.

Adds _handle_sessions_command() which mirrors /resume's no-arg behavior
inline (the CLI has no overlay primitive equivalent to the TUI picker):

- /sessions and /sessions list  → print the recent-sessions table
- /sessions <id_or_title>       → delegates to _handle_resume_command

Includes regression tests covering the dispatcher wiring (the original
bug) plus the three handler branches.
@teknium1
teknium1 merged commit 74e47c0 into main May 14, 2026
13 of 15 checks passed
@teknium1
teknium1 deleted the hermes/hermes-3e6ee7c3 branch May 14, 2026 23:00
@github-actions

Copy link
Copy Markdown
Contributor

🔎 Lint report: hermes/hermes-3e6ee7c3 vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 8374 on HEAD, 8374 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 4408 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants