feat: /resume command accepts position numbers (1 = most recent)#17617
feat: /resume command accepts position numbers (1 = most recent)#17617hash7in wants to merge 2 commits into
Conversation
|
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! |
1 similar comment
…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.
|
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.) |
Summary
Makes
/resumemuch faster for the common case — instead of copying a session ID or typing a long title, you can just do/resume 1for the most recent session,/resume 2for the second most recent, etc.Running
/resumewith no arguments now shows all recent sessions numbered — both title and untitled — not just named ones.Key changes
hermes_state.py— newSessionDB.resolve_session_by_position(position, source, limit)method resolves a 1-based position index to a session ID, using the samelist_sessions_richordering (most recentlast_activefirst).gateway/run.py—_handle_resume_commandrewritten:1. 2. 3.positions for all sessions (not just titled)resolve_session_by_positioncli.py—_show_recent_sessionsadds a#column with 1-based position numbers;_handle_resume_commandintercepts digit targets and resolves by position before falling through to_resolve_session_by_name_or_idTests 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
/resumeuse is for one of the last 3 sessions — e.g./resume 1is vastly faster than/resume "My Long Project Name That I Have To Copy".