Skip to content

feat: /resume command accepts position numbers (1 = most recent)#17617

Closed
hash7in wants to merge 2 commits into
NousResearch:mainfrom
hash7in:feat/resume-by-position
Closed

feat: /resume command accepts position numbers (1 = most recent)#17617
hash7in wants to merge 2 commits into
NousResearch:mainfrom
hash7in:feat/resume-by-position

Conversation

@hash7in

@hash7in hash7in commented Apr 29, 2026

Copy link
Copy Markdown

Summary

Makes /resume much faster for the common case — instead of copying a session ID or typing a long title, you can just do /resume 1 for the most recent session, /resume 2 for the second most recent, etc.

Running /resume with no arguments now shows all recent sessions numbered — both title and untitled — not just named ones.

Key changes

  1. hermes_state.py — new SessionDB.resolve_session_by_position(position, source, limit) method resolves a 1-based position index to a session ID, using the same list_sessions_rich ordering (most recent last_active first).

  2. gateway/run.py_handle_resume_command rewritten:

    • No-arg listing shows 1. 2. 3. positions for all sessions (not just titled)
    • Digit arguments resolved via resolve_session_by_position
    • Non-digit arguments fall through to existing title resolution
  3. cli.py_show_recent_sessions adds a # column with 1-based position numbers; _handle_resume_command intercepts digit targets and resolves by position before falling through to _resolve_session_by_name_or_id

  4. Tests updated — existing assertion strings updated to match new output format; 10/10 tests pass

Motivation

Copying session IDs or long titles from the listing is friction-heavy. 90% of /resume use is for one of the last 3 sessions — e.g. /resume 1 is vastly faster than /resume "My Long Project Name That I Have To Copy".

@hash7in

hash7in commented Apr 29, 2026

Copy link
Copy Markdown
Author

Oops, the "Closes #17179" in the description was a mistake — that's my other PR about Telegram draft streaming, completely unrelated to this one. Sorry for the noise!

@alt-glitch alt-glitch added type/feature New feature or request comp/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have labels Apr 29, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #11461 and #4990 — both implement numbered session list with interactive resume/numeric selection.

1 similar comment
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #11461 and #4990 — both implement numbered session list with interactive resume/numeric selection.

…ages

The resume command messages used \\n (escaped backslash + n) which
Telegram displayed as literal text '\n' instead of actual line breaks.
Changed to \n so Python produces real newline characters.
@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 comp/gateway Gateway runner, session dispatch, delivery 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.

3 participants