[codex] Reuse main TUI surface for BTW
Summary
- Replace BTW's side-only TUI renderer with the shared conversation surface used by the main session.
- Route BTW text, reasoning, tool output, usage, notices, compaction, and turn completion through the same event renderer.
- Keep main-only UI affordances behind surface capability flags, and update tests around BTW input, side events, and completion behavior.
Why
BTW had a separate transcript and renderer path, which made it behave very differently from the native main session. Reusing the main surface keeps the UI behavior consistent and removes the duplicate side renderer.
Cache impact
Cache-impact: low - touches agent/boot wiring for BTW side-session rendering, but does not change model cache key construction, prompt text, tool schema generation, history serialization, or cache persistence.
Cache-guard: GOCACHE=/tmp/go-cache GOMODCACHE=/tmp/go-mod-cache go test -count=1 ./internal/boot -run 'TestBuildWiresSideFactoryAndSink|TestBuildSideAgentHasNoBackgroundJobs' plus ./internal/agent focused tests cover the affected wiring boundaries.
System-prompt-review: Codex/taibai233 reviewed boot prompt-sensitive wiring in this PR; the change adds side factory/sink plumbing and tests, with no intended system prompt wording change.
Validation
GOCACHE=/tmp/go-cache GOMODCACHE=/tmp/go-mod-cache make buildGOCACHE=/tmp/go-cache GOMODCACHE=/tmp/go-mod-cache go test -count=1 ./internal/cliGOCACHE=/tmp/go-cache GOMODCACHE=/tmp/go-mod-cache go test -count=1 ./internal/controlGOCACHE=/tmp/go-cache GOMODCACHE=/tmp/go-mod-cache go test -count=1 ./internal/agent -run 'TestPlanMode|TestSideReadOnly'GOCACHE=/tmp/go-cache GOMODCACHE=/tmp/go-mod-cache go test -count=1 ./internal/boot -run 'TestBuildWiresSideFactoryAndSink|TestBuildSideAgentHasNoBackgroundJobs'GOCACHE=/tmp/go-cache GOMODCACHE=/tmp/go-mod-cache go run github.com/golangci/golangci-lint/v2/cmd/[email protected] run --timeout=5mgit --no-optional-locks diff --check