Skip to content

fix(tui): bound sub-agent failure notes to the alert dwell - #68

Merged
jkyberneees merged 1 commit into
mainfrom
fix/subagent-note-ttl
Sep 3, 2026
Merged

fix(tui): bound sub-agent failure notes to the alert dwell#68
jkyberneees merged 1 commit into
mainfrom
fix/subagent-note-ttl

Conversation

@jkyberneees

Copy link
Copy Markdown
Contributor

Problem

Field report: a transient sub-agent SAX timeout note never disappears.
Root cause: subagentTerminalNote pushed error/timeout notes with a
zero expiry — sticky by design until the turn finalized. A turn that
kept streaming after the sub-agent died kept the note on screen
indefinitely; a turn that never finalized client-side kept it forever.

Fix

Failure notes (error, timeout) now surface at alert tier
(alertTTL, 10s) — same contract as every other alert in the strip:
long enough to read, guaranteed to fade. User-initiated cancels stay
transient (3s), unchanged.

Nothing is lost by the fade — the failure is permanently recorded
where it belongs:

  • the agent chip on the delegate step (⏱ timeout / ✗ error)
  • the turn's swarm verdict (sub-agents: 5 ✓ · 1 ✗ — #4 timeout)

The now-dead clearStickyNotes (whose sole purpose was retiring these
sticky notes at finalize) is removed; the strip now has exactly one
notice lifetime rule: every note has an expiry.

Tests (RED-first)

New subagent_timeout_note_test.go: timeout note exists, is non-sticky,
the agent card still records timeout, and the note is gone after
alertTTL; all terminal notes bounded. Existing
TestStickyFailureAndVerdict updated deliberately to the new contract
(TestFailureNoteBoundedAndVerdict) — verdict assertions unchanged.

Verification

  • go test -race -count=1 ./... — 7/7 packages ok
  • go vet / go fmt clean (golangci-lint via CI)

Sub-agent error/timeout notes were pushed with a zero expiry — sticky
until the turn finalized. A turn that kept streaming after the sub-agent
died kept the note on screen indefinitely ('sub-agent SA4 timeout' never
fading), and a turn that never finalized client-side kept it forever.

Failure notes now dwell at alert tier (10s) like every other alert in
the strip. Nothing is lost: the failure stays on the card's agent chip
(⏱/✗) and the turn's swarm verdict records it permanently. The now-dead
clearStickyNotes (sole purpose: retiring those sticky notes) is removed.
@jkyberneees
jkyberneees merged commit 650b6c0 into main Sep 3, 2026
7 checks passed
@jkyberneees
jkyberneees deleted the fix/subagent-note-ttl branch September 3, 2026 16:33
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