mirror of
https://github.com/nesquena/hermes-webui.git
synced 2026-07-08 16:52:02 +00:00
4ef9d7c5cb
A visible tab can permanently miss a server-initiated turn (self-wake / cron / restart hook) when its per-session SSE is momentarily down at the emit instant. server_turn_started is a fire-and-forget broadcast with no replay buffer; if the turn also finishes before the tab reconnects, the on-subscribe self-heal finds no live run in ACTIVE_RUNS and replays nothing, so the transcript stays stale until a hard refresh. Extend the self-heal: the (re)subscribing tab reports its last-known message_count (?known_count); when there is no live run to replay, the handler compares the persisted count and, if the server is ahead, emits a lightweight session-updated frame. The frontend syncs incrementally via the #5189 keepStaleUntilLoaded swap-in-place loadSession path (no clear+refetch, so the #5177/#5189 blank-gap jump is not reintroduced). Idle-only and pane-scoped; emits only when the server is strictly ahead.