Skip to content

fix(tui): refresh open drawer tabs from wire events and live cards - #111

Merged
jkyberneees merged 1 commit into
mainfrom
fix/realtime-tabs
Sep 11, 2026
Merged

fix(tui): refresh open drawer tabs from wire events and live cards#111
jkyberneees merged 1 commit into
mainfrom
fix/realtime-tabs

Conversation

@jkyberneees

Copy link
Copy Markdown
Contributor

Summary

Fixes the realtime-freshness audit findings (user-reported: /agents does not update sub-agent progress live). Plan: .plans/REALTIME_TABS_FIX_PLAN.md; audit: .odek-artifacts/task-1653a571e2f02095/REALTIME_FRESHNESS_AUDIT.md.

F1 (P1) — agents tab

  • subagent_state wire frames now refresh the open tab immediately: they set a kickAgents flag drained by flushKicks() into one coalesced fetch per burst — a per-event cmd would starve inside ingestWireBatch (frames arrive in bursts) and would flood /api/subagents
  • Row renderer prefers the live card's phase/tool/step/iters/tokens/cost/duration over the up-to-3s-lagging REST snapshot, including the final telemetry at finish (discarding it rolled numbers backward); lost cards (disconnect) never override the fresher REST row; the glyph reads the merged state so a row never shows a spinner beside a finished summary

F2 (P2) — events tab

  • Seq-guarded 3s poll while visible (runsTickMsg pattern); fetches are seq-stamped so a late landing never clobbers a filter change or run drill-in; open/toggle/clear bump the generation; feed shrinks clamp the selection; tick chain heals via reopen

F3 (P2) — memory tab

  • memory_event frames refetch the open tab through the same coalesced flag mechanism; facts written mid-session now appear without a manual reload

Cross-cutting

  • Drawer selections anchor by identity (fact text / TaskID) across rebuilds — a refresh never silently retargets the open detail or the two-step stop gate
  • Docs synced: README /events + Agents rows, AGENTS.md drawer-cadence contract

Review panel

3 adversarial reviewers, sequential, distinct surfaces (reports in .odek-artifacts/):

  1. Correctness & races — found the P1 batch-starvation + flood pair, lost-card override, cost-pairing; all fixed (coalesced flags design)
  2. UX & state machine — found filter-clobber race, glyph/detail disagreement, finish-telemetry rollback, index-anchored selection swap; all fixed
  3. Tests/docs/release — verified RED-first honesty, flagged 3 test gaps + doc gap + nil-client hardening; all closed. Verdict: no blockers

Testing

  • RED-first: core tests compile-fail/behavior-fail on main; 18 new/updated tests covering kicks, coalescing, tick chain, stale-msg drop, anchoring, glyph merge, fallback branches
  • make fmt vet lint test green (vet clean, lint 0 issues, full -race suite, 8 packages)
  • Changed functions 80–100% covered; package coverage parity with main (88.5%, no regression)

The agents tab no longer waits out the 3s poll while sub-agents run:
subagent_state frames set a kickAgents flag drained by flushKicks() into
ONE coalesced fetch per burst (per-event cmds would starve inside
ingestWireBatch and flood the endpoint), and the row renderer prefers
the live card's phase/tool/step/iters/tokens/cost/duration over the
coarser REST snapshot — including the final telemetry at finish, never a
lost card's frozen values, with the glyph reading the merged state. The
events tab gains a seq-guarded 3s tick chain while visible with
seq-stamped fetches so a late landing never clobbers a filter change or
drill-in, and memory_event frames refetch the open memory tab the same
coalesced way. Drawer selections now anchor by identity (fact text /
TaskID) across rebuilds so a refresh never silently retargets the detail
view or the stop gate, and events feed shrinks clamp the selection.
Docs updated: README /events + Agents rows, AGENTS.md cadence contract.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bodek 8bc0a7e Commit Preview URL

Branch Preview URL
Sep 11 2026, 08:07 PM

@jkyberneees
jkyberneees merged commit 230e887 into main Sep 11, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant