WebSocket event replay buffer for disconnect resilience
On reconnect to an active agent run the server now replays all events
emitted since the turn started, then switches to live forwarding.
This eliminates the gap where tool cards, thinking blocks and stream
deltas were permanently lost after a network blip.

Server (_AgentRun):
- events: list[dict] buffers every serialised agent event
- broadcast() serialises and appends before putting in subscriber queues
- reconnect flow: subscribe → replay_count snapshot → stream_start →
  replay events[0:replay_count] → live _stream_to_client

Client:
- onStreamStart() removes the frozen ghost message instead of marking
  done=true, so replay cleanly rebuilds the message from scratch
- replayMode flag suppresses animations during replay
- onReplayStart/onReplayEnd handlers set/clear the flag and restore
  animate on the message once live events resume

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a351b0a commit b43428a1768cbe4672adbdc4e26a07b6f0e65478
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored on 21 Apr
Showing 8 changed files
View
navi/api/websocket.py
View
webclient/dist/assets/index-B3zSedhg.js 0 → 100644
Not supported
View
webclient/dist/assets/index-BMfdKPkG.js 100644 → 0
Not supported
View
webclient/dist/assets/index-C0zKwfri.css 100644 → 0
View
webclient/dist/assets/index-CzedwUs9.js 100644 → 0
Not supported
View
webclient/dist/index.html
View
webclient/src/composables/useWebSocket.js
View
webclient/src/stores/chat.js