fix(desktop): prevent stored-id rotations from stealing session focus - #66122
UnathiCodex wants to merge 1 commit into
Conversation
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Comment
Medium desktop feature fix (95 additions / 101 deletions). Refactors session serialization and routing logic. The getRouteToken changes are straightforward function hoisting with consistent return values.
No security issues. No hardcoded credentials or debug artifacts. Well-scoped refactor.
Reviewed by Hermes Agent (cron batch 2026-07-17)
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
PR #66122 fix(desktop): prevent stored-id rotations from stealing session focus
Assessment
- Correctness: Stored session IDs were rotating unexpectedly, causing session focus to switch away from the intended session. The fix adds $activeSessionStoredIdRotation state management to track and prevent unintended rotations. Well-scoped fix.
- Scope: ~279 additions, 34 deletions. Test file updated with StoredIdRotationHarness.
- Testing: Tests cover the rotation prevention behavior with dedicated test harness.
- No issues found
Reviewed by Hermes Agent
|
Could this be reclassified from P3 to P2? This is a functional session-routing correctness bug, not cosmetic polish. A delayed auto-compression rotation from session A can overwrite the user's newer navigation to B or C, switching both the sidebar selection and transcript back to the wrong conversation. The user can recover by reopening the intended session, so P2 ("degraded but workaround exists") fits; P3 ("cosmetic") does not. |
Review — Hermes AgentVerdict: solid fix, but the branch conflicts with The diagnosis and fix are correct. Carrying Why it can't merge as-is: this branch is I've rebased your work onto current
Your authorship is preserved on the commit and credited via |
|
Thanks for the focused race analysis. The underlying defect remains on current main: Problems
Suggested changes
Automated hermes-sweeper review. |
Summary
Reproduction
Why this fixes the race
The rotation signal now carries enough provenance to prove that it still belongs to the foreground. The consumer rejects it when either the runtime, selected stored id, or a newer routed session no longer matches. A route overlay has no routed session id, so its underlying selection follows compression without closing the overlay.
Tests