fix(tui): mutate sub-agent logs in place, newest first - #51
Merged
Conversation
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.
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.
Fixes the sub-agent card log staleness reported during the audit session:
Root cause —
attachSubLogstopped 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 Nheader 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.gorenderss.logsin index order, so no renderer change is needed;findsearch is order-agnostic.TDD:
TestSubagentLogMutatesInPlaceDescwritten RED-first (12 frames fed, log was frozen at steps 1–8), now asserts the exact DESC sequencestep-12 … step-05under the cap. Three assertions inTestSubagentLogPayloadflipped deliberately from tail (len-1) to head ([0]) — semantic change: newest lands at index 0.Gate:
go vetclean ·golangci-lint0 issues ·go test -race ./... -count=17/7 packages ok.