mirror of
https://github.com/nesquena/hermes-webui.git
synced 2026-05-25 03:00:23 +00:00
d2d464aac3
Replaces the 1.5s HTTP polling loop for clarify with a Server-Sent Events endpoint at /api/clarify/stream that pushes clarify events to the browser instantly. Mirrors the approval SSE pattern from v0.50.248 (#1350) including all the correctness lessons: - Atomic subscribe + initial snapshot under clarify._lock - _clarify_sse_notify called inside _lock for ordering guarantees (no notify-out-of-order race) - Notify passes head=q[0].data (head-fidelity, not the just-appended entry) - resolve_clarify also calls notify after pop so trailing clarifies surface immediately (no stuck-clarify bug) - Empty-state notify with None,0 after pop-empty so frontend hides the card - 30s keepalive comments, _CLIENT_DISCONNECT_ERRORS handling - Bounded queue (maxsize=16) with silent drop on full - Frontend: EventSource with automatic 3s HTTP polling fallback on onerror Co-authored-by: fxd-jason <wujiachen7@gmail.com>