4 Commits
Author SHA1 Message Date
bzuccaro f98043c21b fix: self-heal in-flight counts by pruning stale request ids
On a long-lived SSE connection a missed remove leaves a stale request id in
the tracker forever; llama-swap only sends a fresh snapshot on connect, so
counts drifted up and stayed stuck. The tracker now timestamps each request
id (upserts refresh it) and prunes ids not updated within 120s, on every
inflight event and on a 30s runtime interval. Removes also accept numeric
ids defensively.
2026-08-15 14:26:28 -06:00
c4ch3c4d3 4727bdcf46 feat: decode activity SSE events and expose tracker total 2026-08-14 12:53:40 -06:00
bzuccaro 07fea457f1 fix: track in-flight requests by id; handle llama-swap upsert/remove events
llama-swap emits inflight events with operation 'upsert' (a single request,
re-emitted as elapsed_ms updates) and id-only 'remove' events. The decoder
ignored 'upsert' and dropped every id-only remove, so the tracker only ever
reflected the connect-time snapshot and the count got stuck (e.g. at '1').

The tracker now keys in-flight state by request id (snapshot/add replace by
id; remove deletes by id), and the decoder normalizes 'upsert' to 'add' and
extracts the id from bare removes.
2026-08-14 12:08:02 -06:00
bzuccaro b54eeeadc4 feat: add SSE parser and in-flight request tracker 2026-08-14 10:42:17 -06:00