Skip to content

fix(cli): resume selected chat when a bare number follows /resume#34834

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-2b95698e
May 29, 2026
Merged

fix(cli): resume selected chat when a bare number follows /resume#34834
teknium1 merged 2 commits into
mainfrom
hermes/hermes-2b95698e

Conversation

@teknium1

@teknium1 teknium1 commented May 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Bare /resume now arms a one-shot prompt so typing just a number on the next line resumes that session — the natural list-then-pick flow.

Salvage of #34588 by @Bartok9, cherry-picked onto current main with authorship preserved.

Root cause

Running /resume (no args) printed the recent-sessions list and said "Use /resume ", but armed no selection state. When the user typed bare 3 on the next line, the digit fell through to the agent as a normal chat message and nothing resumed. (/resume 3 always worked — only list-then-type-a-number was broken.)

Changes

  • cli.py: bare /resume stashes _pending_resume_sessions; process_loop intercepts the next bare number before chat routing via _consume_pending_resume_selection. One-shot — any other input (free text, another command, blank) disarms it, so a later number meant as chat is never hijacked. Index resolution reuses _list_recent_sessions(limit=10), so displayed numbers always match resolved sessions. Out-of-range numbers are reported, not sent to the agent.
  • tests/cli/test_cli_resume_command.py: +7 tests (arm on bare /resume, no-arm when no sessions, numbered resume, out-of-range, non-numeric fall-through + disarm, no-pending no-op, disarm-on-other-command).

Validation

Before After
/resume then bare 3 sent to agent as chat, no resume resumes session #3
/resume 3 resumes resumes (unchanged)
bare 3 with no armed prompt chat chat (unchanged)
  • scripts/run_tests.sh tests/cli/test_cli_resume_command.py — 12 passed.
  • E2E against a real SessionDB + real HermesCLI methods: bare /resume arms the list, bare 3 switches session_id to the Architecture planning #3 session, loads its history, disarms; bare 3 with no armed prompt returns False (falls through to chat).

Closes #34584.

Infographic

resume-numbered-selection-fix

Bartok9 and others added 2 commits May 29, 2026 12:59
A bare `/resume` printed the recent-sessions list but armed no selection
state, so typing just `3` on the next line was sent to the agent as chat
instead of resuming session #3. `/resume 3` worked, but the natural
list-then-pick flow did not.

Arm a one-shot pending-resume prompt when bare `/resume` shows the list,
and consume the next bare numeric input as the selection (out-of-range is
reported, non-numeric/other commands disarm it). Resolves against the same
_list_recent_sessions(limit=10) list used everywhere else.

Closes #34584.
test_notification_poller_requeues_when_busy drained and reused the
process-global process_registry.completion_queue, so a concurrent test
in the same xdist worker could put/get on the shared singleton mid-run
and empty the event the poller requeues — flaking 'assert not
completion_queue.empty()' under parallel CI load only.

Monkeypatch a fresh Queue onto the singleton for the test's duration so
nothing external can interleave. The poller reads completion_queue by
attribute at runtime, so the isolated queue is what it operates on.
monkeypatch restores the original on teardown. Verified immune: 50/50
passes under a background thread hammering the global queue.
@github-actions

Copy link
Copy Markdown
Contributor

🔎 Lint report: hermes/hermes-2b95698e vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 9453 on HEAD, 9453 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 4907 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard labels May 29, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Salvage of #34588 by @Bartok9 onto current main. Fixes #34584 (regression from #31709).

@teknium1 teknium1 merged commit 4fd8521 into main May 29, 2026
23 checks passed
@teknium1 teknium1 deleted the hermes/hermes-2b95698e branch May 29, 2026 20:29
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 P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: /resume numbered selection does not resume chat

3 participants