Skip to content

Conversation

@newhook
Copy link
Owner

@newhook newhook commented Jan 15, 2026

Summary

Fixes console output corruption in the TUI when performing work operations. Previously, when destroying a work unit or creating an auto work from plan mode, fmt.Println() calls would write directly to stdout, corrupting the Bubble Tea TUI display.

Changes

  • Added io.Writer parameter to functions that produce console output:

    • SpawnWorkOrchestrator() - Creates zellij tabs for work units
    • EnsureWorkOrchestrator() - Ensures orchestrator tab exists
    • TerminateWorkTabs() - Terminates zellij tabs when destroying work
    • DestroyWork() - Destroys work units and their resources
    • runFullAutomatedWorkflow() - Runs automated workflow
    • runAutomatedWorkflowForWork() - Runs automated workflow for existing work
    • RunWork() - Creates tasks and ensures orchestrator is running
  • TUI callers now pass io.Discard to suppress console output

  • CLI callers pass os.Stdout to maintain normal output behavior

  • Changed TUI's destroyWork() from spawning an exec.Command to calling DestroyWork() directly with io.Discard

Issues Resolved

  • ac-n55f: In the TUI destroying a work spews console output
  • ac-oqbt: Create an auto work from plan mode spews console output

Testing

  • Verified destroying a work from the TUI no longer corrupts the display
  • Verified creating an auto work from plan mode no longer spews console output
  • CLI commands continue to produce expected output

🤖 Generated with Claude Code

Add io.Writer parameter to functions that produce console output, allowing
TUI callers to pass io.Discard to suppress output while CLI callers use
os.Stdout.

Changes:
- TerminateWorkTabs, SpawnWorkOrchestrator, EnsureWorkOrchestrator in
  internal/claude/runner.go now accept io.Writer
- DestroyWork, runAutomatedWorkflowForWork in cmd/work.go updated
- runFullAutomatedWorkflow, RunWork in cmd/run.go updated
- TUI callers (tui.go, tui_work.go, tui_plan.go) pass io.Discard
- CLI callers (work.go, run.go, work_automated.go) pass os.Stdout
- destroyWork in tui.go now calls DestroyWork directly instead of
  shelling out to 'co work destroy' via exec.Command

Fixes: ac-n55f, ac-oqbt

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@newhook newhook merged commit de9e610 into main Jan 15, 2026
@newhook newhook deleted the feat/in-the-tui-destroying-a-work-spews-console-output branch January 16, 2026 01:43
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.

2 participants