feat(cli): add /resume interactive picker and numeric selection (#4988)#4990
Closed
bg-l2norm wants to merge 1 commit into
Closed
feat(cli): add /resume interactive picker and numeric selection (#4988)#4990bg-l2norm wants to merge 1 commit into
bg-l2norm wants to merge 1 commit into
Conversation
This was referenced Apr 27, 2026
Collaborator
Contributor
|
Closing as superseded by PR #31709 (merged), which adds numbered Four contributors filed independently-overlapping PRs against this same UX gap — thanks for being one of them. PR #31709 picked @daizhonggeng's version because it was the only one that covered BOTH the CLI and the gateway code paths in one PR. Authorship for the cherry-picked commit is preserved in If your PR included specific behavior that PR #31709 missed, please reopen with a follow-up scoped to that delta. (Bulk-closed during a CLI PR triage sweep.) |
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.
Summary
Fixes #4988 by making
/resumein the interactive CLI open an in-chat interactive session picker when called without arguments, with a robust fallback for non-interactive contexts.Understanding and diagnosis
Before changes, CLI
/resumebehavior incli.pywas:/resume <session_id_or_title>: works/resumewith no arg: prints usage + static recent-session tableSo the core discoverability issue was real: users inside an active session had no selection UX (only manual copy/paste of IDs/titles).
I also confirmed there was already a mature picker implementation in
hermes_cli.main._session_browse_picker(...)used byhermes sessions browse, but it was not wired into in-chat/resume.What changed
1) Interactive picker path for
/resumewith no argsIn
HermesCLI._handle_resume_command:stdin/stdoutare TTY), call picker with recent sessions.session_id.2) Non-interactive fallback improvements
For non-interactive
/resumewith no args:3) Numeric index resolution
Added support for:
/resume 1/resume 2etc.
The number resolves against the recent-session list ordering shown in fallback output.
New helper methods (cli.py)
_resume_picker_enabled()_pick_recent_session_id(sessions)_resolve_numeric_resume_target(target, limit=20)Tests
Updated/added tests in
tests/test_cli_init.py:/resumeuses picker in TTY mode/resume <n>resolves to the corresponding recent sessionValidation
python -m py_compile cli.py tests/test_cli_init.pypython -m pytest -q -o addopts='' tests/test_cli_init.py::TestHistoryDisplay(Used isolated venv for test runtime dependencies.)