mirror of
https://github.com/nesquena/hermes-webui.git
synced 2026-05-25 11:10:18 +00:00
e62338d3a0
When a session finishes streaming while the user has switched to a different session, setBusy(false) was draining S.session.session_id (the currently *viewed* session) instead of the session that actually finished. Queued follow-up messages were silently dropped. Root cause: setBusy() has no context about which session triggered it. The activeSid closure variable inside attachLiveStream() knew the right session but was not propagated. Fix: add _queueDrainSid module global (null by default). Stream done and error handlers set it to activeSid immediately before calling setBusy(false). setBusy(false) reads and clears _queueDrainSid, falling back to S.session if it is unset (the common case where the user hasn't switched away). Handlers patched: done event, start-call error handler, stream_end/stream_stop reconnection fallback, and max-retry error exit. Co-authored with Claude Sonnet 4.6 / Anthropic.