hermes-agent/apps/desktop/src/app
Brooklyn Nicholson f7bf740640 fix(desktop): reject cross-wired runtime-id cache on session resume
resumeSession's warm-cache fast-path 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
(pruneSecondaryGateways) re-mints runtime ids, so a recycled id can
resolve to a live-but-DIFFERENT session's cache entry. The only
existing guard was a session.usage 404 -- that catches a fully-dead
runtime id, but a recycled id still 200s, so the fast-path happily
painted the wrong transcript under the current route (open chat A,
chat B loads).

Fold the belongs-to check into a single takeWarmCache() helper used at
BOTH cache reads -- the early transcript-keep decision and the fast-path
itself -- so a cross-wired entry can't even briefly flash a stale
transcript before the full resume repaints. On a mismatch the helper
purges both stale map entries and reports a miss, falling through to a
full resume that rebinds a correct runtime id. The full-resume path
already guards its final paint with isCurrentResume(), so only the
cached fast-path was missing the belongs-to check.

Pre-existing bug from the initial desktop app (#20059); not introduced
by the session-switch perf work (#49807), which left these lines
untouched.

Tests: two cases in use-session-actions.test.tsx driven through a
harness that owns the two cache maps -- a cross-wired mapping is
rejected + purged (the bug), and a correctly-wired cache still serves
from memory with no needless refetch (no perf regression).

Supersedes #50464 by @professorpalmer, reimplemented to also guard the
early transcript-keep read (whole-class fix, not just the fast-path).

Co-authored-by: professorpalmer <professorpalmer@users.noreply.github.com>
2026-06-25 16:11:18 -05:00
..
agents fix(desktop): make Agents indicator match the Spawn-tree panel 2026-06-24 18:16:14 -05:00
artifacts fix(desktop): open remote-gateway artifacts via authenticated download (#46895) 2026-06-15 23:50:19 -05:00
chat fix(desktop): wire Ctrl+B voice, declutter voice settings, stop endless TTS hang 2026-06-24 18:26:14 -05:00
command-center fix(desktop): make rendered logs selectable so they can be copied 2026-06-19 10:03:46 -05:00
command-palette feat(pets): Pokédex generate UI — overlay, animated egg, hatch FX, manage 2026-06-24 13:51:34 -05:00
cron fix(desktop): cron overlay mutations sync the sidebar instantly 2026-06-06 16:47:46 -05:00
gateway/hooks Merge pull request #47959 from NousResearch/bb/pets-gen 2026-06-24 19:41:34 -05:00
hooks Merge pull request #47959 from NousResearch/bb/pets-gen 2026-06-24 19:41:34 -05:00
messaging fix(desktop): offer a Restart gateway action on messaging save/toggle toasts 2026-06-19 10:03:24 -05:00
overlays refactor(desktop): converge cron overlay onto profiles' split layout 2026-06-06 16:39:56 -05:00
pet-generate refactor(pets): tighten remix comments and confirm handler 2026-06-25 01:10:56 -05:00
pet-overlay feat(desktop): floating pet, pop-out overlay + Cmd+K picker 2026-06-20 14:18:40 -05:00
profiles feat(dashboard): clone profiles from any source 2026-06-13 07:33:58 -07:00
right-sidebar fix(desktop): replace native title tooltips with styled Tip component 2026-06-23 10:19:30 -07:00
session/hooks fix(desktop): reject cross-wired runtime-id cache on session resume 2026-06-25 16:11:18 -05:00
settings feat(moa): expose MoA presets as selectable virtual models (#46081) 2026-06-25 13:52:06 -07:00
shell feat(moa): expose MoA presets as selectable virtual models (#46081) 2026-06-25 13:52:06 -07:00
skills feat(computer-use): surface macOS permission preflight in the desktop 2026-06-22 17:33:52 -05:00
desktop-controller.tsx feat(pets): Pokédex generate UI — overlay, animated egg, hatch FX, manage 2026-06-24 13:51:34 -05:00
floating-hud.ts style(desktop): use the nous overlay surface (--stroke-nous + --shadow-nous) for the HUDs 2026-06-09 23:49:02 -05:00
index.tsx
layout-constants.ts feat(desktop): hover-reveal collapsed sidebars as fixed overlays (#41670) 2026-06-07 22:41:21 -05:00
model-picker-overlay.tsx
model-visibility-overlay.tsx feat(desktop): inline model picker in the status bar 2026-06-02 19:09:41 -05:00
page-search-shell.tsx feat(desktop): add i18n with Simplified Chinese (zh-Hans) support 2026-06-05 10:32:26 -07:00
routes.ts chore(desktop): zero eslint/typecheck debt + prettier pass (#39100) 2026-06-04 14:10:38 +00:00
session-picker-overlay.tsx desktop: registry-driven slash commands + first-class /resume & /handoff (#42351) 2026-06-11 01:49:24 +00:00
session-switcher.tsx feat(desktop): theme the terminal ANSI palette + restyle the Cmd-K / Ctrl-Tab HUDs 2026-06-09 23:37:50 -05:00
types.ts fix(desktop): render send/prefill directive notices (/goal, /undo) (#49073) 2026-06-19 07:28:50 -07:00
updates-overlay.tsx Merge pull request #52210 from helix4u/fix/desktop-update-progress-visibility 2026-06-24 19:45:05 -05:00