Skip to content

fix(tui): mutate sub-agent logs in place, newest first - #51

Merged
jkyberneees merged 1 commit into
mainfrom
fix/subagent-log-desc
Aug 31, 2026
Merged

fix(tui): mutate sub-agent logs in place, newest first#51
jkyberneees merged 1 commit into
mainfrom
fix/subagent-log-desc

Conversation

@jkyberneees

Copy link
Copy Markdown
Contributor

Fixes the sub-agent card log staleness reported during the audit session:

Root causeattachSubLog stopped writing once the log hit its 8-line cap (if len < maxSubLogs), so a long-running sub-agent's card froze on its first frames while the live ⟳ SA1 · step N header raced ahead.

Fix — each new line prepends (DESC) and the oldest rolls off the cap: the card now always shows the 8 most recent activity frames, newest first, mutating in place. view.go renders s.logs in index order, so no renderer change is needed; find search is order-agnostic.

TDD: TestSubagentLogMutatesInPlaceDesc written RED-first (12 frames fed, log was frozen at steps 1–8), now asserts the exact DESC sequence step-12 … step-05 under the cap. Three assertions in TestSubagentLogPayload flipped deliberately from tail (len-1) to head ([0]) — semantic change: newest lands at index 0.

Gate: go vet clean · golangci-lint 0 issues · go test -race ./... -count=1 7/7 packages ok.

attachSubLog froze after maxSubLogs lines, pinning a long-running
agent's card on its first frames while the live header raced ahead.
Lines now prepend (DESC) and the oldest roll off the cap, so the card
always shows the agent's latest activity.
@jkyberneees
jkyberneees merged commit a47b385 into main Aug 31, 2026
7 checks passed
@jkyberneees
jkyberneees deleted the fix/subagent-log-desc branch August 31, 2026 06:11
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