Skip to content

fix(cli): show last-turn preview after /resume so restored context is visible (#30351)#31331

Closed
haran2001 wants to merge 1 commit into
NousResearch:mainfrom
haran2001:fix/resume-show-last-turn-preview
Closed

fix(cli): show last-turn preview after /resume so restored context is visible (#30351)#31331
haran2001 wants to merge 1 commit into
NousResearch:mainfrom
haran2001:fix/resume-show-last-turn-preview

Conversation

@haran2001

Copy link
Copy Markdown
Contributor

Summary

  • After /resume, the classic CLI prints only ↻ Resumed session <id> (N user messages, M total) and returns to the prompt. The full transcript is not re-rendered (the TUI ships a dedicated overlay for that), so on native Windows 11 terminals — where there is no scrollback that survives the resume — users cannot tell whether the previous conversation context was actually restored.
  • This PR adds a compact Last turn: preview after every successful /resume that has restored history: one [You] line + one [Hermes] line (both truncated to 240 chars), plus a tip to use /history for the full transcript.
  • Empty resumed sessions are unchanged: they still print starting fresh and no preview header.
  • Self-contained: no behavior change outside _handle_resume_command and the new _show_resume_context_preview helper.

Test Plan

  • python -m pytest tests/cli/test_cli_init.py -q -o 'addopts=' -k 'resume or sessions' — 10 passed (3 new + 7 existing resume/sessions tests still green).
    • new: test_resume_prints_last_turn_preview — asserts last user + last assistant content is rendered and earlier turns are not.
    • new: test_resume_preview_truncates_long_messages — verifies the 240-char cap with ellipsis suffix.
    • new: test_resume_empty_session_skips_preview — asserts the starting fresh branch does not print a Last turn: header.

Closes #30351

@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 May 24, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Closing as superseded by PR #31695 (merged), which bundles this fix and several sibling PRs in the /resume recap cluster.

PR #31695 wires _display_resumed_history() into in-session /resume (the missing 1-line bug fix) AND exposes the recap truncation limits + tool-call-only skip as configurable display.* keys. Eight contributors independently filed PRs against this same UX gap — thanks for being one of them.

Authorship for the cherry-picked commits is preserved in git log via rebase-merge. If your PR included specific behavior that PR #31695 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.

Improve /resume UX and restored context display on native Windows 11

3 participants