Skip to content

feat(tui): render server-initiated wake turns from bg-job completion - #66

Merged
jkyberneees merged 1 commit into
mainfrom
feat/bg-wake-turns
Sep 2, 2026
Merged

feat(tui): render server-initiated wake turns from bg-job completion#66
jkyberneees merged 1 commit into
mainfrom
feat/bg-wake-turns

Conversation

@jkyberneees

Copy link
Copy Markdown
Contributor

What

Consumes odek ≥ v1.40's wake-on-complete surface so a background job finishing while the session is idle produces a visible, properly-rendered turn instead of silently dropped output.

Why

odek v1.40 wakes idle sessions itself: the session frame arrives stamped system_initiated and the model's report streams like any turn. bodek's cards previously opened only on the local send path, so every streamed event of a wake turn was dropped — the LLM engaged, the operator saw nothing.

Changes

  • client: decode system_initiated on the session frame (omitempty — version-safe both directions)
  • tui: openWakeTurn opens the streaming card from the wire (busy, relayout, status waking for bg job); suppressed while an operator turn is live
  • transcript: wake cards carry the systemWake marker — head renders ⬡ odek · wake; never rendered as a user message; --plain prints a [wake] line
  • bg_wake frames → transient note ("background job finished · agent waking")
  • bg_job frames → immediate jobs snapshot via kickJobsFetch(); the REST watcher stays as fallback, generation guards untouched
  • docs: README (features + jobs tab) and AGENTS.md updated — including correcting the stale "odek pushes no WS frames" claim

Verification

  • 10 new tests (RED-first): decode ×2, wire-open ×4 (guard, suppression, full lifecycle + marker render, plain mode), bg_wake note, bg_job kick end-to-end against httptest server, routing
  • go vet clean · go test -race -count=1 ./... 7/7 packages green
  • Adversarial judge (diff-only review, odek wire contract cross-checked against odek source): verdict CLEAN — no P1/P2; wire-open guard, never-a-user-message, jobs-chain convergence under frame bursts, jobsOff sentinel, reconnect safety all verified

odek >= v1.40 wakes idle sessions when a background job finishes: the
session frame arrives stamped system_initiated and the model's report
streams like any turn. Cards previously opened only on the local send
path, so every streamed event of a wake turn dropped silently.

- client: decode system_initiated on the session frame
- tui: openWakeTurn opens the card from the wire (busy, relayout,
  status 'waking for bg job'); suppressed during operator turns
- transcript: systemWake cards render 'odek - wake', never as a user
  message; plain mode prints a [wake] line
- bg_wake frames surface a transient note; bg_job frames kick an
  immediate jobs snapshot (kickJobsFetch), watcher stays fallback
- docs: README + AGENTS updated for push frames and wake rendering
@jkyberneees
jkyberneees merged commit 559b1e3 into main Sep 2, 2026
7 checks passed
@jkyberneees
jkyberneees deleted the feat/bg-wake-turns branch September 2, 2026 18:38
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