hermes-agent/apps/desktop/src
Brooklyn Nicholson cd5fb760a5 fix(desktop): restore cross-wired runtime-id guard on session resume
resumeSession's warm-cache fast-path once again trusted the
storedSessionId -> runtimeId -> ClientSessionState mapping without
checking the cached state still BELONGS to the session being resumed. A
pooled profile backend that gets idle-reaped and respawned re-mints
runtime ids, so a recycled id resolves to a live-but-DIFFERENT session's
cache entry and paints the wrong transcript under the current route:
click thread A, a totally different thread (often from another worktree)
loads. The session.usage 404 guard only catches a fully-dead id; a
recycled-live id 200s, so the fast-path happily served the stale cache.

Straight regression, not a new bug. f7bf74064 ("reject cross-wired
runtime-id cache on session resume") landed takeWarmCache() + its
regression test; 62af32efe ("keep active sessions aligned with cwd"),
rebased off a stale branch, restructured resumeSession and silently
reverted both 29 minutes later -- the exact stale-branch squash clobber
AGENTS.md warns about ("Squash merges from stale branches silently
revert recent fixes").

Re-apply the whole-class fix on top of the current cwd-aligned code:
takeWarmCache() validates state.storedSessionId === storedSessionId at
BOTH cache reads (the early transcript-keep decision and the fast-path),
purging a cross-wired mapping on a miss so it falls through to a full
resume that rebinds a correct runtime id. Restore the two regression
tests guarding it.

Tests: resumeSession warm-cache mapping integrity -- a cross-wired
mapping is rejected + purged (the bug), a correctly-wired cache is still
served with no needless refetch (no perf regression).

Co-authored-by: professorpalmer <professorpalmer@users.noreply.github.com>
2026-06-28 18:23:09 -05:00
..
app fix(desktop): restore cross-wired runtime-id guard on session resume 2026-06-28 18:23:09 -05:00
components test(browser): cover open timeout diagnostics and failed navigate title 2026-06-28 12:14:21 -05:00
fonts fix(desktop): crisp terminal text via opaque xterm canvas 2026-06-12 19:36:30 -05:00
hooks feat(desktop): add shared project UI primitives 2026-06-25 16:40:27 -05:00
i18n fix(browser): extend first-open timeout and surface daemon errors 2026-06-28 12:14:21 -05:00
lib fix(desktop): remote project picker UX and profile-scoped fs/git routing 2026-06-28 16:23:39 -05:00
store fix(desktop): remote project picker UX and profile-scoped fs/git routing 2026-06-28 16:23:39 -05:00
themes style(desktop,tui): fix all lint/type/formatting issues 2026-06-26 01:04:33 -05:00
types style(desktop,tui): fix all lint/type/formatting issues 2026-06-26 01:04:33 -05:00
global.d.ts Merge pull request #52828 from helix4u/fix/desktop-backend-update-indicator 2026-06-26 11:49:07 -05:00
hermes-profile-scope.test.ts fix(desktop): route gateway restart / status / update to the active profile 2026-06-24 19:16:26 -05:00
hermes.test.ts fix(desktop): route profile session reads 2026-06-11 18:09:24 -05:00
hermes.ts style(desktop,tui): fix all lint/type/formatting issues 2026-06-26 01:04:33 -05:00
main.tsx feat(desktop): floating pet, pop-out overlay + Cmd+K picker 2026-06-20 14:18:40 -05:00
styles.css feat(desktop): show a calm "will resume" notice for background delegate_task 2026-06-25 19:57:51 -05:00
vite-env.d.ts Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00