Skip to content

feat(cli): Add numbered session list with interactive resume#11461

Closed
zzhan111 wants to merge 8 commits into
NousResearch:mainfrom
zzhan111:feat/session-numbered-resume
Closed

feat(cli): Add numbered session list with interactive resume#11461
zzhan111 wants to merge 8 commits into
NousResearch:mainfrom
zzhan111:feat/session-numbered-resume

Conversation

@zzhan111

Copy link
Copy Markdown

Summary

Add numbered session lists and interactive session resumption for both CLI and slash command interfaces.

Changes

• Added '#' column showing session numbers (1, 2, 3...) in hermes sessions list output
• After displaying session list, prompts user to enter a number to resume that session
/resume command without arguments now shows a numbered list of recent sessions (up to 10)
• Users can type a number (1-N) to quickly resume a session, or press Enter to cancel
• Graceful error handling for invalid input with friendly error messages

Example Usage

Terminal Command

$ hermes sessions list
#    Title                            Preview                                  Last Active    ID
───────────────────────────────────────────────────────────────────────────────────────────────────
1    My Project                      Let me help you with the code...         2 hours ago    abc123...
2    Debug Session                   I found the bug in the function...       1 day ago      def456...

Enter session number to resume (1-2), or press Enter to cancel: 1
Resuming session: abc123...

Slash Command

/resume
  Recent sessions:
  #    Title                            Preview                                  Last Active    ID
  ──── ──────────────────────────────── ──────────────────────────────────────── ───────────── ────────────────────────
  1    My Project                      Let me help you with the code...         2 hours ago    abc123...
  
  Enter session number to resume (1-1), or press Enter to cancel:

Impact

  • Modules affected: cli.py (HermesCLI._handle_resume_command), hermes_cli/main.py (cmd_sessions)
  • User experience: Users can resume sessions without copying/pasting session IDs
  • Backward compatibility: Existing /resume <session_id> usage continues to work
  • Breaking changes: None

Files Modified

  • cli.py - 41 lines added
  • hermes_cli/main.py - 40 lines added

• 在 hermes sessions list 命令输出中增加#列显示会话序号
• 列表显示后提示用户输入序号来恢复对应会话
• /resume 命令无参数时显示带编号的最近会话列表供选择
• 支持输入 1-N 数字快速恢复会话,回车取消
• 无效输入时显示友好错误提示

影响:
- 涉及模块:cli.py (HermesCLI._handle_resume_command), hermes_cli/main.py (cmd_sessions)
- 增强用户体验,无需复制会话 ID 即可恢复会话
- 向后兼容:仍支持原有的 /resume <session_id> 用法
- 无破坏性变更
@zzhan111 zzhan111 force-pushed the feat/session-numbered-resume branch from c7e0dda to 0e4e4db Compare April 17, 2026 08:14
zzhan111 added 7 commits April 17, 2026 16:15
• Fixed _cprint() calls that were missing required text argument
• Changed _cprint() to _cprint("") for blank lines in /resume command
• Resolves error: _cprint() missing 1 required positional argument: 'text'
• Ctrl+B key binding now only registered when _voice_mode is True
• Prevents Ctrl+B from causing exit when voice mode is disabled
• Key binding is conditional on voice mode initialization state
• Maintains all existing voice functionality when enabled
• Changed from conditional registration to always registering handler
• When voice mode disabled, handler silently consumes key without action
• Prevents any default terminal behavior (bell, exit) on Ctrl+B
• Maintains full voice functionality when mode is enabled
• Added eager=True flag to ensure voice key handler runs first
• Prevents Ctrl+B from triggering default behavior when voice mode is disabled
• Handler now consumes the key event before any other handlers can process it
• Fixes issue where Ctrl+B would exit when input box was empty
• Added explicit event consumption to prevent Ctrl+B from causing exit
• Handler now always runs first (eager=True) and consumes the event
• Voice recording only activates when voice mode is enabled
• Works with both empty and non-empty input boxes
• First handler always consumes Ctrl+B event (no-op) to prevent default behavior
• Second handler with filter activates voice recording only when voice mode enabled
• This ensures Ctrl+B is always consumed before any default behavior can trigger
• Single handler approach - always consumes Ctrl+B event
• When voice mode disabled: consumes event and returns (no action)
• When voice mode enabled: performs voice recording toggle
• Simplified from dual-handler approach
@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 labels Apr 24, 2026
@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 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