Fix Desktop compression session lineage - #41678
Open
joshuadow wants to merge 2 commits into
Open
Conversation
tonydwb
approved these changes
Jun 8, 2026
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Well-scoped fix for desktop compression session lineage. Adds explicit lineage tracking in agent/conversation_compression.py, ensures store/session.ts preserves the correct session ancestry path through desktop reconnections, and updates JSON-RPC gateway diagnostics to reflect resolved lineage rather than ambiguous state. Test coverage is adequate (session store + gateway protocol + ws diagnostics) and changelog is clean.
Looks Good
- Lineage resolution is applied before any state mutation, preventing leak drift.
- TUI gateway now reports resolved_session_id via diagnostics endpoint.
Reviewed by Hermes Agent
Contributor
|
Thanks for the broad lineage and recovery investigation. Current main already contains the core stale-runtime recovery and compression-tip resume behavior, but two pieces still warrant selective salvage. Problems
Suggested changes
Automated hermes-sweeper review. |
19 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
persist explicit compression-continuation metadata and expose full lineage ids for Desktop pin resolution
project compressed conversations through the selected live tip while preserving workspace cwd fallback so new compacted sessions do not fall into "No workspace"
recover Desktop prompt submits once when a stale runtime session id returns
4001 session not foundadd JSON-RPC/WebSocket diagnostics that avoid request params/payload/result/error bodies
surface the Desktop recovery overlay after repeated post-boot gateway reconnect failures so transport drops do not require a full restart
Validation
npm run test:ui --workspace=apps/desktop -- --run src/app/gateway/hooks/use-gateway-boot.test.tsx src/hermes-gateway-client-diagnostics.test.ts— 2 files passed, 7 tests passedpython -m pytest tests/test_hermes_state.py -q— 270 passedpython -m pytest tests/tui_gateway/test_protocol.py -q— 59 passed, 8 warnings from discordaudioopdeprecationpython -m pytest tests/tui_gateway/test_ws_diagnostics.py -q— 5 passednpm --workspace apps/desktop run type-checknpm --workspace apps/desktop run test:ui -- src/store/session.test.ts src/app/session/hooks/use-prompt-actions.test.tsx src/hermes-gateway-client-diagnostics.test.ts— 31 passednpm --workspace apps/desktop exec eslint -- src/app/session/hooks/use-prompt-actions.test.tsx src/hermes-gateway-client-diagnostics.test.ts src/app/session/hooks/use-prompt-actions.ts src/store/session.ts src/store/session.test.ts src/app/chat/index.tsx src/app/chat/sidebar/index.tsx src/app/desktop-controller.tsx src/types/hermes.tsNotes