Skip to content

fix(tui): live plan strip + simplified top bar - #112

Merged
jkyberneees merged 2 commits into
mainfrom
fix/plan-realtime
Sep 12, 2026
Merged

fix(tui): live plan strip + simplified top bar#112
jkyberneees merged 2 commits into
mainfrom
fix/plan-realtime

Conversation

@jkyberneees

Copy link
Copy Markdown
Contributor

Summary

Two fixes in one consolidated PR (user-reported defects + requested simplification):

1. Plan strip frozen at "plan 0/6" (805e685)

Two root causes froze the plan progress strip mid-run:

  • One transient error killed the poll chain forever — any fetch error (timeout under load, 5xx, transport blip) marked the plan endpoint unavailable and every future tick dropped. Now only a 404 (old engine, route absent) is permanent, carried by a new client.ErrPlanUnavailable sentinel (ErrJobsUnavailable pattern); transient errors keep polling.
  • The planDirty deadlock — the live tick refused to fetch while dirty, waiting for an in-flight tool_result confirm that could already be dead (superseded by a poll bumping planReqSeq; opening the /plan tab mid-turn does exactly that). The tick now re-issues an idempotent confirm — but only after the debounce actually fired one (planConfirmIssued gate), so a pre-write store snapshot can never wipe the optimistic patch. Turn boundaries (planFollowup) also re-issue a dead confirm, and resetPlanState clears the flag.

2. Top-bar simplification (1029603)

The header drops three indicators whose data lives elsewhere: the plan x/t count (the /plan tab + busy-line strip own it), the odek engine version (new ⬢ engine row in the cockpit stats sheet — rendered exactly once, before the first turn; the server card's duplicate row removed), and the live tok/s chip (cockpit speed row carries sealed last/mean/peak plus a live row while streaming; per-turn rate stays on the turn footer). bodek's version, ctx gauge, sandbox badge, session spend, and the jobs instrument stay.

Review panel (3 sequential adversarial reviewers, reports in .odek-artifacts/)

  1. Correctness/races — found the pre-write confirm re-issue regression (P2: my first fix could fetch the pre-write store mid-tool and wipe the optimistic patch) — fixed with the planConfirmIssued gate; dead field and stale comment cleaned.
  2. UX/state — found duplicate engine-version rows in the cockpit, README staleness, and the frozen-dirty-across-turns case — all fixed (single engine row, README rewritten, turn-boundary confirm re-issue).
  3. Tests/docs/release — found the docs overclaim (live rate was actually rendered nowhere mid-turn) — fixed by adding the live-rate row to the sheet; count-once and lifecycle test gaps closed. Verdict: no blockers.

Testing

  • RED-first: plan_realtime_test.go and header_simplify_test.go fail on origin/main (verified by reviewers on a main worktree)
  • make fmt vet lint test green: vet clean, lint 0 issues, full -race suite, 8 packages
  • 6 tests that pinned the old header contracts updated; 8 new tests across the plan lifecycle, cockpit rows, and header shape

…confirms

Two defects froze the plan progress strip at a stale count (the reported
plan 0/6 forever). First, any fetch error — a timeout under load, a 5xx,
a transport blip — marked the plan endpoint unavailable forever and the
tick chain dropped every future poll; only a 404 (old engine, route
absent) is permanent now, carried by a new ErrPlanUnavailable sentinel
the client wraps (ErrJobsUnavailable pattern). Second, the live tick
refused to fetch while planDirty, waiting for the in-flight tool_result
confirm — but that reply could already be dead (superseded by a poll
that bumped planReqSeq), deadlocking the strip at the optimistic patch;
the tick now re-issues an idempotent confirm fetch alongside re-arming.
Existing tests that pinned the over-eager classification and the
wait-forever behavior are updated to the corrected contract.
The header drops three indicators whose data already lives elsewhere:
the plan x/t count (the /plan tab owns plan progress, and the busy-line
strip still shows it while a turn runs), the odek engine version (moved
into the cockpit stats sheet as an engine row — rendered once, before
the first turn, with the server card's duplicate row removed), and the
live tok/s chip (the cockpit's speed row carries last/mean/peak for
sealed turns and a live row while a turn streams; the sealed turn
footer keeps the per-turn rate). bodek's own version stays beside the
logo and the jobs instrument stays — a running or failed job is
actionable from any surface. README and AGENTS.md header-contract
paragraphs updated to the new shape. Includes adversarial-review
hardenings from all three review rounds.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 12, 2026

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 1029603 Commit Preview URL

Branch Preview URL
Sep 12 2026, 08:23 AM

@jkyberneees
jkyberneees merged commit 6068cb0 into main Sep 12, 2026
9 checks passed
@jkyberneees
jkyberneees deleted the fix/plan-realtime branch September 12, 2026 08:27
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