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
{{ message }}
Repository navigation
feat(events): reconnect with last_event_id — replay missed events instead of losing them silently #14818
Events published while a client is disconnected are lost silently. There is no gap detection
anywhere, so the failure is invisible to both the user and the logs.
Current state:
autobot-frontend/src/services/LiveEventService.ts:218 reconnects with exponential backoff and
correctly re-subscribes its channels on reopen (:148).
autobot-frontend/src/services/GlobalWebSocketService.ts:447 reconnects with backoff plus a /api/health polling wait mode.
Neither sends a last-seen event id, and api/live_events.py has nowhere to receive one.
LiveEventService.ts:409 receives event_id and only logs it — no high-water mark, no gap check.
This is the pattern AHP specifies as reconnect { clientId, lastSeenServerSeq, subscriptions[] },
answered with either replayed actions or a fresh snapshot when the gap exceeds the buffer
(AHP docs/specification/lifecycle.md).
api/live_events.py accepts last_event_id on subscribe and replays from a per-channel Redis Stream; when it cannot produce a complete history it emits an explicit resync frame rather than a partial one. LiveEventService.ts tracks a high-water mark per channel, never lowers it, and clears it on resync. A lost durable write is recorded so an affected client is resynced instead of silently short-changed.
Tests: 13 backend + 19 frontend, covering gap-beyond-retention, Redis unavailable, corrupt entry, by-design gaps, and marker-never-goes-backwards.
CI on the merged head 889e3ac4a: 57 passed / 0 failed / 0 cancelled / 0 pending
Codecov: "All modified and coverable lines are covered by tests" — 100% patch coverage
Independent code-reviewer pass run before merge; all 3 findings fixed in-PR with regression tests
Content verified present in origin/Dev_new_gui after merge
Not verified on a host. The tests above exercise the seams, but no running instance has confirmed the end-to-end behaviour (a second tab receiving events, a reconnect replaying the gap). If that matters for this issue, reopen against a deployed check.
Closing by hand: Closes #N does not fire here, since the PR targeted Dev_new_gui rather than the default branch.
Activity
mrveiss commentedon Aug 22, 2026
Audit trail and full analysis: #14826 —
docs/research/agent-host-and-agent-client-protocols.md.Sources for this finding:
feat(events): replay missed events on reconnect via last_event_id (#1…
fix(frontend): declare lastGlobalEventId and type ApiClient responses (…
fix(events): register the channel-stream env vars and regenerate the …
test(frontend): cover client replay, channel unwrapping and server se…
test(frontend): set the connected precondition for subscribe-frame as…
test(chat): cover session synchronization, resync and teardown (#14820,
test(frontend): close the remaining patch-coverage gaps (#14818, #14820…
fix(events): deny unrecognised channels, detect lost durable writes, …
feat(events): multi-client session synchronization, replay and an ACP…
mrveiss commentedon Aug 23, 2026
Delivered and merged.
api/live_events.pyacceptslast_event_idon subscribe and replays from a per-channel Redis Stream; when it cannot produce a complete history it emits an explicitresyncframe rather than a partial one.LiveEventService.tstracks a high-water mark per channel, never lowers it, and clears it on resync. A lost durable write is recorded so an affected client is resynced instead of silently short-changed.Tests: 13 backend + 19 frontend, covering gap-beyond-retention, Redis unavailable, corrupt entry, by-design gaps, and marker-never-goes-backwards.
Evidence
ded8d07e7intoDev_new_gui889e3ac4a: 57 passed / 0 failed / 0 cancelled / 0 pendingcode-reviewerpass run before merge; all 3 findings fixed in-PR with regression testsorigin/Dev_new_guiafter mergeNot verified on a host. The tests above exercise the seams, but no running instance has confirmed the end-to-end behaviour (a second tab receiving events, a reconnect replaying the gap). If that matters for this issue, reopen against a deployed check.
Closing by hand:
Closes #Ndoes not fire here, since the PR targetedDev_new_guirather than the default branch.