Skip to content

feat(cli): add /resume interactive picker and numeric selection (#4988)#4990

Closed
bg-l2norm wants to merge 1 commit into
NousResearch:mainfrom
bg-l2norm:fix/issue-4988-resume-picker
Closed

feat(cli): add /resume interactive picker and numeric selection (#4988)#4990
bg-l2norm wants to merge 1 commit into
NousResearch:mainfrom
bg-l2norm:fix/issue-4988-resume-picker

Conversation

@bg-l2norm

Copy link
Copy Markdown
Contributor

Summary

Fixes #4988 by making /resume in 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 /resume behavior in cli.py was:

  • /resume <session_id_or_title>: works
  • /resume with no arg: prints usage + static recent-session table

So 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 by hermes sessions browse, but it was not wired into in-chat /resume.

What changed

1) Interactive picker path for /resume with no args

In HermesCLI._handle_resume_command:

  • If no target and terminal is interactive (stdin/stdout are TTY), call picker with recent sessions.
  • If a session is selected, continue resume flow using that selected session_id.
  • If picker is cancelled, return with a friendly cancellation message.

2) Non-interactive fallback improvements

For non-interactive /resume with no args:

  • Show a numbered recent-session list.
  • Updated hint text to include number-based resume syntax.

3) Numeric index resolution

Added support for:

  • /resume 1
  • /resume 2
    etc.

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:

  • Existing no-arg resume display test updated for new fallback hint text
  • New test: no-arg /resume uses picker in TTY mode
  • New test: numeric /resume <n> resolves to the corresponding recent session

Validation

  • python -m py_compile cli.py tests/test_cli_init.py
  • python -m pytest -q -o addopts='' tests/test_cli_init.py::TestHistoryDisplay
    • Result: 5 passed

(Used isolated venv for test runtime dependencies.)

@alt-glitch

Copy link
Copy Markdown
Collaborator

Competing implementation with #7880 (same feature, different approach). Both implement #4988.

@teknium1

Copy link
Copy Markdown
Contributor

Closing as superseded by PR #31709 (merged), which adds numbered /resume selection to both the CLI and the gateway.

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 git log via rebase-merge.

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.)

@teknium1 teknium1 closed this May 24, 2026
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/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: /resume with no arguments should show an interactive session picker

3 participants