mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-16 14:32:34 +00:00
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> |
||
|---|---|---|
| .. | ||
| agents | ||
| artifacts | ||
| chat | ||
| command-center | ||
| command-palette | ||
| cron | ||
| gateway/hooks | ||
| hooks | ||
| learning | ||
| messaging | ||
| overlays | ||
| pet-generate | ||
| pet-overlay | ||
| profiles | ||
| right-sidebar | ||
| session/hooks | ||
| settings | ||
| shell | ||
| skills | ||
| starmap | ||
| desktop-controller-utils.test.ts | ||
| desktop-controller-utils.ts | ||
| desktop-controller.tsx | ||
| floating-hud.ts | ||
| index.tsx | ||
| layout-constants.ts | ||
| master-detail.tsx | ||
| model-picker-overlay.tsx | ||
| model-visibility-overlay.tsx | ||
| page-search-shell.tsx | ||
| routes.ts | ||
| session-picker-overlay.tsx | ||
| session-switcher.tsx | ||
| types.ts | ||
| updates-overlay.tsx | ||