fix(cli): surface recent sessions inside /history and /resume - #4448
Closed
kshitijk4poor wants to merge 1 commit into
Closed
fix(cli): surface recent sessions inside /history and /resume#4448kshitijk4poor wants to merge 1 commit into
kshitijk4poor wants to merge 1 commit into
Conversation
Contributor
|
Merged via PR #4728. Your commit was cherry-picked onto current main with your authorship preserved in git log. Style adjustments made on top: replaced ASCII box drawing with the column-header style matching |
teknium1
pushed a commit
that referenced
this pull request
Apr 3, 2026
When /history is used in an empty chat, show a table of recent resumable sessions instead of a dead-end message. When /resume is called with no argument, show the same table with resume guidance. - Add _list_recent_sessions() and _show_recent_sessions() to HermesCLI - Remove redundant exclude_sources (already filtered by source='cli') - Center the table header properly Cherry-picked from PR #4448.
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 28, 2026
When /history is used in an empty chat, show a table of recent resumable sessions instead of a dead-end message. When /resume is called with no argument, show the same table with resume guidance. - Add _list_recent_sessions() and _show_recent_sessions() to HermesCLI - Remove redundant exclude_sources (already filtered by source='cli') - Center the table header properly Cherry-picked from PR NousResearch#4448.
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
The interactive CLI made session recovery too discoverability-hostile at the exact point users need it most: right after opening chat. If the current chat had no in-memory messages,
/historyonly saidNo conversation history yet, and/resumerequired already knowing a session id or title.This PR keeps Hermes' session-boundary resume model intact, but brings the in-chat UX closer to what other agent CLIs do when users need to recover prior work:
/sessionssurface (aliases/resume,/continue) for listing and switching sessions.Hermes should preserve its frozen-session semantics, but it should not require users to leave the chat TUI just to discover resumable sessions.
What Changed
HermesCLI._list_recent_sessions()to fetch recent CLI sessions from the session DB while excluding the current sessionHermesCLI._show_recent_sessions()to render a compact inline session table inside the active chat TUI/historyso an empty current chat now shows recent resumable sessions instead of a dead-endNo conversation history yet/resumewith no argument so it lists recent sessions inline and shows resume guidance, instead of only telling users to runhermes sessions listWhy This Shape
Hermes should not copy CLIs that mutate a live session's underlying model/runtime state in-place, because Hermes relies on frozen per-session prompt identity and cache-friendly resume boundaries.
But discoverability is orthogonal to that constraint. Showing resumable sessions from inside the TUI improves the UX without:
So this follows the competitor UX pattern at the discovery layer, while keeping Hermes-safe session switching semantics underneath.
Testing
source /Users/kshitij/Projects/hermes-agent/.venv/bin/activate && python -m pytest tests/test_cli_init.py tests/test_resume_display.py -qHERMES_HOME+SessionDBcli.show_history()prints an inline recent-session table when the active chat has no messagesNotes
Related to the broader
/resumeparity/discoverability thread in #2591, but this PR focuses specifically on the in-chat session-listing UX gap that still remained after CLI resume support landed.