fix(tui): bound sub-agent failure notes to the alert dwell - #68
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Field report: a transient
sub-agent SAX timeoutnote never disappears.Root cause:
subagentTerminalNotepushederror/timeoutnotes with azero 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:
⏱ timeout/✗ error)sub-agents: 5 ✓ · 1 ✗ — #4 timeout)The now-dead
clearStickyNotes(whose sole purpose was retiring thesesticky 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 afteralertTTL; all terminal notes bounded. ExistingTestStickyFailureAndVerdictupdated deliberately to the new contract(
TestFailureNoteBoundedAndVerdict) — verdict assertions unchanged.Verification
go test -race -count=1 ./...— 7/7 packages okgo vet/go fmtclean (golangci-lint via CI)