fix(session-overview): done sessions never transition to idle#384
fix(session-overview): done sessions never transition to idle#384dimakis wants to merge 2 commits into
Conversation
…reattach EventSource auto-reconnect reuses the original URL, which never included the ?sessions= query param. This meant the server never ran handleReconnect on auto-reconnect — no watch, no reattach, no event replay. Users had to send multiple messages before the session would respond. Move reconnect from URL query param to explicit POST in the welcome handler. This fires on every reconnect (auto or explicit), ensuring the server always runs the full reconnect flow: watch + reattach + event replay. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Two bugs caused sessions to stay visible in the Active Sessions list indefinitely instead of disappearing after 5 minutes: 1. No proactive idle timer — the done→idle transition was only checked during on-demand state derivation. If no events occurred after a session finished, the server never re-evaluated or broadcast the state change. Fixed by scheduling a broadcast at DONE_TIMEOUT_MS after each touch(). 2. Persistent attention sessions hardcoded to "done" — sessions from EventStore's getAttentionSessions() always returned state:'done' regardless of age. Fixed by applying the same elapsed-time check as live sessions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Centaur ReviewFound 4 issue(s) (1 warning).
|
Summary
touch()now schedules a broadcast atDONE_TIMEOUT_MS(5 min) so the done→idle transition fires proactively, even when no other events occurpersistentToActivity()now applies the same elapsed-time check instead of hardcodingstate: 'done'— old attention sessions transition to idle and disappear from the active listRoot cause
Sessions were stuck as "done" in the Active Sessions list indefinitely because:
getAttentionSessions()(assistant spoke last) were always returned asdoneregardless of ageTest plan
🤖 Generated with Claude Code