Skip to content

feat: interactive session picker for /resume and hermes resume#7880

Open
iRonin wants to merge 5 commits into
NousResearch:mainfrom
iRonin:feat/interactive-session-picker-clean
Open

feat: interactive session picker for /resume and hermes resume#7880
iRonin wants to merge 5 commits into
NousResearch:mainfrom
iRonin:feat/interactive-session-picker-clean

Conversation

@iRonin

@iRonin iRonin commented Apr 11, 2026

Copy link
Copy Markdown
Contributor

Interactive Session Picker

Add an inline prompt_toolkit panel for browsing and resuming sessions, accessible via /resume or hermes resume.

Features

  • Inline panel — opens inside the running CLI TUI (no curses subprocess, no nested app)
  • Page-based navigation — loads up to 2000 sessions (configurable), shows 25 per page
    • Space / n: next page
    • b: previous page
    • / : move one item within page
  • Fuzzy search — press / or s to enter search mode, matches against title, preview text, and session ID
  • Expanded preview — selected session shows first 3 lines of the actual first user message (with real newlines preserved)
  • Clean display — unnamed sessions show "—" in the title column, preview in its own column
  • Configurable via display.resume_* settings:
    • resume_session_limit (default: 2000) — total sessions loaded
    • resume_page_size (default: 25) — sessions per page
    • resume_preview_length (default: 60) — column preview width
    • resume_full_preview_length (default: 500) — expanded preview char limit
    • resume_preview_lines (default: 3) — expanded preview line count

New subcommand

  • hermes resume — launches Hermes with the session picker panel pre-opened
  • hermes resume --limit 100 — override session count
  • hermes resume --source telegram — filter by platform

Changes

  • cli.py: added _render_resume_panel, show_sessions_full, resume keybindings, layout injection
  • hermes_cli/config.py: added 5 new display.resume_* config keys
  • hermes_cli/main.py: added resume subcommand
  • hermes_state.py: added preview_length and full_preview_length params to list_sessions_rich() (preserves newlines in full preview)
  • tests/cli/test_resume_panel.py: 4 new tests for panel rendering
  • tests/test_hermes_state.py: 6 new tests for preview params

@iRonin iRonin force-pushed the feat/interactive-session-picker-clean branch 2 times, most recently from b5dfbad to 603258e Compare April 11, 2026 20:36
iRonin added 4 commits April 12, 2026 08:39
1. resume_panel_widget passed to _build_tui_layout_children (was missing)
2. handle_enter blocked when resume panel is open (prevents input submission)
3. 'any' catch-all keybinding blocks typed chars from reaching input
4. ESC binding uses eager=True so it fires immediately
5. _handle_resume_command uses self._session_db directly (not new instance)
6. Session ID prefix match for truncated IDs from panel
@iRonin iRonin force-pushed the feat/interactive-session-picker-clean branch 2 times, most recently from cce75a9 to 98bda74 Compare April 12, 2026 13:00
@iRonin iRonin force-pushed the feat/interactive-session-picker-clean branch 2 times, most recently from 744ed7d to a40ec8f Compare April 12, 2026 14:03
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard comp/tui Terminal UI (ui-tui/ + tui_gateway/) labels Apr 28, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related: #4988 (feature request), #4990 (competing open PR), #8493 (prior closed attempt with same title).

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/tui Terminal UI (ui-tui/ + tui_gateway/) 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.

2 participants