Skip to content

fix(tui): normalize shell progress output#37710

Open
opencode-agent[bot] wants to merge 2 commits into
v2from
shell-output-preview
Open

fix(tui): normalize shell progress output#37710
opencode-agent[bot] wants to merge 2 commits into
v2from
shell-output-preview

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

What

Fix agent-invoked shell commands whose progress output is separated by carriage returns (\r), such as git worktree add.

The V2 agent shell card already has the V1-style 10-line collapsed preview and click-to-expand interaction. The discrepancy was that V2 passed raw carriage returns into collapseToolOutput, which counts newline-delimited rows. OpenTUI rendered each carriage-return frame as a visible row, but the collapse logic saw one line and could let the entire progress stream fill the viewport.

This normalizes CRLF and bare CR to \n before applying the existing shell preview, for both completed and background shell output. The final PR diff does not change user-invoked shell messages.

Verification

  • bun typecheck in packages/tui
  • bun test test/cli/tui/collapse-tool-output.test.ts in packages/tui (2 passing)
  • OpenCode Drive against the real V2 TUI with a simulated agent-invoked shell tool producing 30 carriage-return progress frames:
    • origin/v2: all 30 frames flood the card
    • PR: the card stays within its 10-line budget
    • clicking the card expands all 30 frames

Requested by: @rekram1-node (Aiden Cline via Slack)

@opencode-agent opencode-agent Bot changed the title fix(tui): collapse direct shell output fix(tui): normalize shell progress output Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant