fix(state): resume compression continuation tip#15742
fix(state): resume compression continuation tip#15742stephenschoettler wants to merge 2 commits into
Conversation
|
CI note: the red Tests job appears to be pre-existing main instability, not from this two-file session-resume change. Local validation passed:
Recent main Tests runs are also failing before this PR, including main run 24936215121 for 648b899. The PR's Nix, lockfile, attribution, and supply-chain checks passed. |
|
Thanks, good catch. I should have checked open overlapping PRs before opening this. That was an agent workflow miss, not intentional duplication. I looked at #13374 now. My read is that #13374 fixes the TUI/gateway If maintainers prefer consolidating this into #13374, I am happy to close/rebase. Otherwise I think the regression in this PR is still relevant because it covers the "compressed root already has messages" edge case in |
|
Fresh recheck after #10373 was closed and #16306 merged: I do not think this PR should be closed as a duplicate yet. Current That means Why I think this PR is still relevant:
Fresh validation on this PR branch: Result: If maintainers prefer folding this helper fix into #13374, that is fine. Otherwise I think this PR should stay open because it covers the helper-level regression directly. |
|
Rechecked this against current Local repro on current main: I refreshed this branch by merging current
This still looks distinct from the TUI/gateway tip PRs (#13374, #26631): those update gateway/TUI resume projection, while this fixes |
What does this PR do?
Fixes resume behavior for compressed sessions by redirecting resume targets to the live compression continuation tip.
After context compression, post-compression turns live in a child continuation session. Users may still resume the original root session id they saw before compression.
SessionDB.resolve_resume_session_id()previously returned that root unchanged whenever the root already had pre-compression message rows, which can omit post-compaction turns from resumed context.This PR makes the helper follow the compression chain tip first, while preserving the existing fallback for empty placeholder sessions that have child messages.
Related Issue
Related: #10373
Related PRs:
tui_gateway/server.py./resumepath throughSessionDB.resolve_resume_session_id().hermes_state.py.Type of Change
Changes Made
hermes_state.pySessionDB.resolve_resume_session_id()to callget_compression_tip()before returning a session with existing message rows.tests/test_hermes_state.pyHow to Test
Run the focused regression suite:
python -m pytest \ tests/test_hermes_state.py::TestCompressionChainProjection::test_resolve_resume_session_id_returns_compression_tip_even_when_parent_has_messages \ tests/test_hermes_state.py::TestCompressionChainProjection::test_resolve_resume_session_id_returns_self_for_uncompressed_session_with_messages \ tests/test_hermes_state.py::TestCompressionChainProjection::test_get_compression_tip_walks_full_chain \ tests/test_hermes_state.py::TestCompressionChainProjection::test_list_surfaces_tip_for_compressed_root \ -q -o addopts=''Run the full
hermes_statetest module:python -m pytest tests/test_hermes_state.py -q -o addopts=''Run syntax and whitespace checks:
Validation Status
python -m pytest tests/test_hermes_state.py -q -o addopts='': passed locally in the original PR validation.python -m compileall -q hermes_state.py tests/test_hermes_state.py: passed locally in the original PR validation.git diff --check: passed locally in the original PR validation.test,e2e.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation and Housekeeping
docs/, docstrings) or N/Acli-config.yaml.exampleif I added/changed config keys or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows or N/AFor New Skills
N/A. This PR does not add a skill.
Screenshots / Logs
Fresh helper-level repro from a previous PR comment against
origin/main:Expected behavior after this PR:
Fresh focused validation from the previous PR comment: