Skip to content

fix: resolve TUI resume to session tips#26631

Open
lsaether wants to merge 1 commit into
NousResearch:mainfrom
lsaether:fix/tui-resume-lineage-tip
Open

fix: resolve TUI resume to session tips#26631
lsaether wants to merge 1 commit into
NousResearch:mainfrom
lsaether:fix/tui-resume-lineage-tip

Conversation

@lsaether

Copy link
Copy Markdown
Contributor

Summary

  • Resolve TUI session.resume titles through SessionDB.resolve_session_by_title() so /resume Project selects the latest numbered lineage variant.
  • Resolve the chosen session through SessionDB.resolve_resume_session_id() so compressed session heads resume at the transcript-holding descendant.
  • Add TUI gateway regression coverage for title lineage and compression-tip redirection.

Test Plan

  • scripts/run_tests.sh tests/tui_gateway/test_protocol.py::test_session_resume_returns_hydrated_messages tests/tui_gateway/test_protocol.py::test_session_resume_title_uses_latest_lineage_variant tests/tui_gateway/test_protocol.py::test_session_resume_id_redirects_to_compression_tip -q
  • scripts/run_tests.sh tests/tui_gateway/test_protocol.py -q
  • scripts/run_tests.sh tests/hermes_state/test_resolve_resume_session_id.py tests/test_hermes_state.py::TestTitleLineage -q
  • Patch dry-run: git apply --check and git am --3way against a fresh origin/main worktree, then focused new TUI regression tests.

Notes

  • This keeps the change scoped to tui_gateway/server.py plus protocol tests.
  • CLI resume already uses the session-tip resolver; this aligns TUI resume with that existing behavior.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/tui Terminal UI (ui-tui/ + tui_gateway/) labels May 15, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related: #13374 (TUI compression tip following on resume), #15742 (resolve_resume_session_id compression chain). This PR adds both title lineage resolution via resolve_session_by_title() and compression tip redirection — verify it doesn't conflict with those open PRs.

@lsaether

Copy link
Copy Markdown
Contributor Author

@alt-glitch thanks for calling this out — I dug into the overlap.

#13374 is definitely the same TUI-side symptom, and it conflicts mechanically with this branch in both merge orders: both touch the session.resume block in tui_gateway/server.py and adjacent protocol tests.

The reason I’d lean toward this shape is that it keeps the resume policy in the shared session layer instead of adding compression-specific logic directly to the TUI gateway. #13374 calls get_compression_tip() from tui_gateway/server.py; this branch routes TUI resume through SessionDB.resolve_resume_session_id(), which is already the shared abstraction used for resume-target normalization. That keeps TUI behavior aligned with the rest of Hermes and gives future resume callers one place to inherit the same semantics.

This branch also covers a second resume issue: title-based resume now goes through resolve_session_by_title(), so /resume Project can resolve to the latest Project #N lineage variant before applying resume-tip resolution. That part is separate from the compression-tip fix and is not covered by #13374.

My read of the relationships is:

So if maintainers prefer a single landing unit, I’m happy to fold the helper-layer change from #15742 into this branch. Otherwise the clean path seems to be #15742 first, then this PR; #13374’s TUI-specific redirect would be covered by the shared-resolver wiring here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

2 participants