Found by a live tmux-driven TUI test sweep (fake provider rigs). Evidence: .tmp/tui-test/results/ (core.md, info.md, destructive.md, inputux.md).
Bugs (acceptance criteria — each fixed with a regression test)
Test plan
Failing Go regression tests first per bug (pattern-match sse_events_test.go, compact_command_test.go, undo_command_test.go), then minimal fixes; scripts/test-regression.sh green.
Rollout/rollback
TUI-only changes in cmd/harnesscli/tui/; rollback by reverting the branch.
Found by a live tmux-driven TUI test sweep (fake provider rigs). Evidence:
.tmp/tui-test/results/(core.md, info.md, destructive.md, inputux.md).Bugs (acceptance criteria — each fixed with a regression test)
assistant.message.delta(cmd/harnesscli/tui/model.go:4237); the finalassistant.messagehas no handler. Blast radius:/exportmissing replies,/searchcan't find reply text, ctrl+s copies empty text. Fix: render finalassistant.messagecontent when no deltas accumulated./cancelwedges the TUI in a permanent(esc to interrupt)spinner:run.cancellednot treated as terminal inSSEDoneMsg(model.go:4445); reconnect loop subscribes to a dead run forever./v1/runs/{id}/cancel; server run executes to completion (model.go:2829 region).usage.deltacumulative values are assigned, not accumulated (model.go:4386-4393); status bar cost went DOWN across prompts;/costand/contextshow only the latest run./statstotal cost shows $0.00 after spend:upsertTodayDataPointreplaces instead of adds (model.go:5071);$%.2fhides sub-cent amounts./initis dead code:completeInitAgentsMd()only runs from theRunCompletedMsghandler (model.go:3910), but no production code emitsRunCompletedMsg; wirependingInitAgentsMdinto the realSSEDoneMsgcompletion path (bridge.go:301)./compacttranscript block vanishes at run completion; ctrl+o then expands the wrong card.43;1R) leaks into the input after undo-triggered transcript rebuild; rebuild stalls ~4-5s.Test plan
Failing Go regression tests first per bug (pattern-match
sse_events_test.go,compact_command_test.go,undo_command_test.go), then minimal fixes;scripts/test-regression.shgreen.Rollout/rollback
TUI-only changes in
cmd/harnesscli/tui/; rollback by reverting the branch.