hermes-agent/apps/desktop/src/app
joaomarcos 2afa92c74f fix(desktop): pin composer draft scope to the swap-effect owner, not the render ref
Fixes #54527 — a message typed into one TUI session could be silently
misrouted into (or overwritten by) another concurrently-open session.

Root cause: activeQueueSessionKeyRef is written on every render, but the
debounced draft-persist timer, the pagehide flush, and dispatchSubmit's
reject-restore path all read it lazily at async-resolve time instead of
capturing the scope that was active when the operation started. A session
switch landing between capture and resolve relabels one session's text
under the other session's key. A large paste widens the window (slower
synchronous render), which matches the original report.

Fix: introduce draftScopeRef, written only by the draft-swap effect (so it
always reflects the session whose text is actually loaded in the editor)
and read it instead of the render-time ref at both async write sites.
dispatchSubmit's restore() now uses the submittedScope already captured at
dispatch instead of re-reading the live ref.

Also adds isPendingDraftPersistCurrent as defense-in-depth: before the
debounce timer commits a write, it verifies its captured {scope, text}
pair is still the one on file. This is a no-op under the fix above (a
session swap or a newer keystroke already clears/replaces the pending
entry via clearTimeout), but turns any future regression that reintroduces
a stale/live-ref read at this call site into a dropped write instead of a
silent cross-session misroute.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-10 19:35:05 -07:00
..
agents refactor(desktop): adopt shared utils + app-wide cleanups 2026-07-03 13:48:44 -05:00
artifacts cleanup(desktop): npm run fix for fmtting 2026-07-08 16:24:16 -07:00
chat fix(desktop): pin composer draft scope to the swap-effect owner, not the render ref 2026-07-10 19:35:05 -07:00
command-center refactor(desktop): adopt shared utils + app-wide cleanups 2026-07-03 13:48:44 -05:00
command-palette Revert "Merge pull request #30179 from NousResearch/feat/iron-proxy" 2026-07-04 13:38:59 -07:00
cron refactor(desktop): localize settled TODO(i18n) literals (#57924) 2026-07-03 20:43:50 +00:00
gateway/hooks feat(desktop): soft gateway switch + gateway-settings polish 2026-07-10 02:57:02 -05:00
hooks feat(desktop): Capabilities foundation — shared utils, master-detail, editors, primitives 2026-07-03 05:08:13 -05:00
learning refactor(desktop): localize settled TODO(i18n) literals (#57924) 2026-07-03 20:43:50 +00:00
messaging refactor(desktop): localize settled TODO(i18n) literals (#57924) 2026-07-03 20:43:50 +00:00
overlays refactor(desktop): adopt shared utils + app-wide cleanups 2026-07-03 13:48:44 -05:00
pet-generate style(desktop,tui): fix all lint/type/formatting issues 2026-06-26 01:04:33 -05:00
pet-overlay feat(desktop): TikTok-style vibe hearts on a reusable particle system 2026-07-10 05:42:14 -05:00
profiles feat(desktop): Capabilities foundation — shared utils, master-detail, editors, primitives 2026-07-03 05:08:13 -05:00
right-sidebar refactor(desktop): adopt shared utils + app-wide cleanups 2026-07-03 13:48:44 -05:00
session/hooks feat(desktop): TikTok-style vibe hearts on a reusable particle system 2026-07-10 05:42:14 -05:00
settings feat(desktop): soft gateway switch + gateway-settings polish 2026-07-10 02:57:02 -05:00
shell refactor(desktop): adopt shared utils + app-wide cleanups 2026-07-03 13:48:44 -05:00
skills cleanup(desktop): npm run fix for fmtting 2026-07-08 16:24:16 -07:00
starmap fix(desktop,gateway,mcp): post-merge — CI contract, review corrections, hub search 2026-07-03 15:22:43 -05:00
desktop-controller-utils.test.ts refactor(desktop): thin desktop-controller by extracting session-list actions 2026-06-30 01:34:12 -05:00
desktop-controller-utils.ts fix(desktop,gateway,mcp): post-merge — CI contract, review corrections, hub search 2026-07-03 15:22:43 -05:00
desktop-controller.tsx feat(desktop): ts-ify everything 2026-07-08 16:24:16 -07:00
floating-hud.ts refactor(desktop): adopt shared utils + app-wide cleanups 2026-07-03 13:48:44 -05:00
index.tsx Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
layout-constants.ts feat(desktop): cap overlay inner-page width at 75rem 2026-07-02 20:40:57 -05:00
master-detail.tsx refactor(desktop): localize settled TODO(i18n) literals (#57924) 2026-07-03 20:43:50 +00:00
model-picker-overlay.tsx Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
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 fix(desktop,gateway,mcp): post-merge — CI contract, review corrections, hub search 2026-07-03 15:22:43 -05:00
routes.ts feat(desktop): Memory Graph — playable radial timeline of memories + skills 2026-06-30 00:54:21 -05: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 refactor(desktop): adopt shared utils + app-wide cleanups 2026-07-03 13:48:44 -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 style(desktop): bring the install & update overlays onto the design system 2026-06-30 14:46:28 -05:00