You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When opening a new chat session in Hermes Desktop, the composer is pre‑filled with text that was the first input of a different (previous) session — not an empty box, and not the user's own __new__ draft. The user must manually clear it before typing.
This is not the intended per‑session draft‑restore behavior. A brand‑new session should start empty (or with the user's own __new__ bucket, which should be empty).
apps/desktop/src/store/composer.ts:38 — draftKey(scope) falls back to __new__ when scope is empty/whitespace; keys otherwise by activeQueueSessionKey.
The per‑thread swap lives in useComposerDraft:
apps/desktop/src/app/chat/composer/hooks/use-composer-draft.ts:309-331 — on activeQueueSessionKey change it does takeSessionDraft(activeQueueSessionKey) → loadIntoComposer(text, attachments).
apps/desktop/src/app/chat/composer/hooks/use-composer-draft.ts:222-262 — the composerRuntime.subscribe(sync) debounced stash (DRAFT_PERSIST_DEBOUNCE_MS) writes draftRef.current under draftScopeRef.current.
The cross‑session prefill indicates the scope/key used at stash or restore time does not match the actually‑visible session in some transition (new‑session creation, rapid session switch, or a thread swap where activeQueueSessionKey is briefly null/empty and resolves to __new__ but the restored text came from a real session id). Worth checking the takeSessionDraft key path against the key used when the outgoing session was stashed, especially around the __new__ bucket.
then restart Hermes.app. The prefill disappears (clears cached drafts only; sent messages untouched). The leak recurs until the root cause is fixed.
Suggested fix direction
Audit the session‑key passed to stashSessionDraft / takeSessionDraft across the new‑session transition and rapid switches; ensure a freshly created session never restores a real session id's draft, and that the __new__ bucket is only ever written with the user's in‑progress (unsent) new‑chat text.
Problem
When opening a new chat session in Hermes Desktop, the composer is pre‑filled with text that was the first input of a different (previous) session — not an empty box, and not the user's own
__new__draft. The user must manually clear it before typing.This is not the intended per‑session draft‑restore behavior. A brand‑new session should start empty (or with the user's own
__new__bucket, which should be empty).Environment
0.17.0(install‑stampbuiltAt: 2026-07-12T07:05:57Z,commit: 2043436af,source: local)0.18.2Suspected root cause (from source inspection)
Draft storage is a single
localStoragemap keyed by session scope:apps/desktop/src/store/composer.ts:27—SESSION_DRAFTS_STORAGE_KEY = 'hermes:composer-drafts:v3'apps/desktop/src/store/composer.ts:29—NEW_SESSION_DRAFT_KEY = '__new__'apps/desktop/src/store/composer.ts:38—draftKey(scope)falls back to__new__when scope is empty/whitespace; keys otherwise byactiveQueueSessionKey.The per‑thread swap lives in
useComposerDraft:apps/desktop/src/app/chat/composer/hooks/use-composer-draft.ts:309-331— onactiveQueueSessionKeychange it doestakeSessionDraft(activeQueueSessionKey)→loadIntoComposer(text, attachments).apps/desktop/src/app/chat/composer/hooks/use-composer-draft.ts:222-262— thecomposerRuntime.subscribe(sync)debounced stash (DRAFT_PERSIST_DEBOUNCE_MS) writesdraftRef.currentunderdraftScopeRef.current.apps/desktop/src/app/chat/composer/hooks/use-composer-draft.ts:90-91, 237—draftScopeRefis meant to track "the session whose text is actually loaded in the editor" to avoid a session‑switch‑mid‑flight writing one session's draft under another's key (Bug: Gateway message routing misdirects user input between TUI sessions -- prompt permanently lost #54527).The cross‑session prefill indicates the scope/key used at stash or restore time does not match the actually‑visible session in some transition (new‑session creation, rapid session switch, or a thread swap where
activeQueueSessionKeyis briefly null/empty and resolves to__new__but the restored text came from a real session id). Worth checking thetakeSessionDraftkey path against the key used when the outgoing session was stashed, especially around the__new__bucket.Workaround (verified)
Desktop
Cmd+Option+I→ Console:then restart Hermes.app. The prefill disappears (clears cached drafts only; sent messages untouched). The leak recurs until the root cause is fixed.
Suggested fix direction
Audit the session‑key passed to
stashSessionDraft/takeSessionDraftacross the new‑session transition and rapid switches; ensure a freshly created session never restores a real session id's draft, and that the__new__bucket is only ever written with the user's in‑progress (unsent) new‑chat text.