fix(cli): wire /sessions slash command in the classic CLI - #25986
Merged
Conversation
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.
12 tasks
Contributor
🔎 Lint report:
|
This was referenced May 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Salvage of #25231 by @explainanalyze.
/sessionsis in the centralCOMMAND_REGISTRY(registered since #20805) and surfaces in/help, tab-completion, and the gateway. The TUI wires it to itsSessionPickeroverlay. The gateway dispatchessessions browse. But the classic CLI'sprocess_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
pytest tests/cli/test_cli_init.py -k sessionspytest tests/cli/test_cli_init.pyresolve_command("sessions")"canonical == \"sessions\""inprocess_commandsourceHermesCLI._handle_sessions_commandexistsReuses existing primitives — no new state, no new config keys. Closes #25231.