hermes-agent/tests/hermes_cli
teknium1 ecac6321c4 feat: interactive session browser with search filtering (#718)
Add `hermes sessions browse` — a curses-based interactive session picker
with live type-to-search filtering, arrow key navigation, and seamless
session resume via Enter.

Features:
- Arrow keys to navigate, Enter to select and resume, Esc/q to quit
- Type characters to live-filter sessions by title, preview, source, or ID
- Backspace to edit filter, first Esc clears filter, second Esc exits
- Adaptive column layout (title/preview, last active, source, ID)
- Scrolling support for long session lists
- --source flag to filter by platform (cli, telegram, discord, etc.)
- --limit flag to control how many sessions to load (default: 50)
- Windows fallback: numbered list with input prompt
- After selection, seamlessly execs into `hermes --resume <id>`

Design decisions:
- Separate subcommand (not a flag on -c) — preserves `hermes -c` as-is
  for instant most-recent-session resume
- Uses curses (not simple_term_menu) per Known Pitfalls to avoid the
  arrow-key ghost-duplication rendering bug in tmux/iTerm
- Follows existing curses pattern from hermes_cli/tools_config.py

Also fixes: removed redundant `import os` inside cmd_sessions stats
block that shadowed the module-level import (would cause UnboundLocalError
if browse action was taken in the same function).

Tests: 33 new tests covering curses picker, fallback mode, filtering,
navigation, edge cases, and argument parser registration.
2026-03-08 17:42:50 -07:00
..
__init__.py test: reorganize test structure and add missing unit tests 2026-02-26 03:20:08 +03:00
test_commands.py feat: session naming with unique titles, auto-lineage, rich listing, resume by name 2026-03-08 15:20:29 -07:00
test_config.py test: reorganize test structure and add missing unit tests 2026-02-26 03:20:08 +03:00
test_doctor.py fix(doctor): recognize OPENAI_API_KEY custom endpoint config 2026-03-06 19:47:09 -08:00
test_model_validation.py feat: /provider command + fix gateway bugs + harden parse_model_input 2026-03-08 06:09:36 -07:00
test_models.py test: enhance session source tests and add validation for chat types 2026-02-26 00:53:57 -08:00
test_session_browse.py feat: interactive session browser with search filtering (#718) 2026-03-08 17:42:50 -07:00
test_set_config_value.py test: add 26 tests for set_config_value secret routing 2026-03-06 04:26:18 -08:00
test_skills_hub.py fix: Initialize Skills Hub on list 2026-03-09 01:43:59 +08:00
test_tools_config.py Fix empty tool selection persistence 2026-03-08 06:11:18 -07:00