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
fix(server): report idle sessions as not-running on reconnect
handleReconnect conflated "query loop alive" with "agent actively
processing a turn". isActive() returns true for sessions whose query
loop is alive but idle between turns (waiting in `for await`). This
caused the reconnected message to report running=true, making the
frontend queue the first user message behind a 5-second fallback timer
instead of sending it immediately — the "two messages to get a response
after reattach" bug.
Fix: check lastSpeaker from EventStore. When lastSpeaker=assistant the
agent completed its last turn and is idle, so report running=false.
When lastSpeaker=user the agent hasn't answered yet, so running=true.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments