Skip to content

fix(tui): stream running bash output - #40859

Open
zcxGGmu wants to merge 1 commit into
anomalyco:devfrom
zcxGGmu:shell-output-stream
Open

fix(tui): stream running bash output#40859
zcxGGmu wants to merge 1 commit into
anomalyco:devfrom
zcxGGmu:shell-output-stream

Conversation

@zcxGGmu

@zcxGGmuzcxGGmu commented Aug 6, 2026

Copy link
Copy Markdown

Issue for this PR

Fixes#34966

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Streams incremental bash metadata.output updates into the standalone TUI scrollback while the tool is still running. The reducer now appends only the newly observed output slice, so long-running commands can surface available stdout/stderr progress before the final completed tool update arrives.

This keeps the existing first-class shell-event path unchanged and does not change subprocess PTY/PIPE semantics.

How did you verify your code works?

  • bun test test/cli/run/session-data.test.ts --test-name-pattern "streams running bash metadata output into scrollback" --timeout 30000
  • bun test test/cli/run/session-data.test.ts --test-name-pattern "direct shell|legacy bash|shell events|running bash metadata" --timeout 45000
  • bun test test/cli/run/session-data.test.ts --timeout 90000
  • bun test test/cli/run/scrollback.surface.test.ts --timeout 90000
  • bun run typecheck from packages/opencode
  • bun run lint packages/opencode/src/cli/cmd/run/session-data.ts packages/opencode/test/cli/run/session-data.test.ts

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search results, I found one potentially related PR:

Related PR:

This PR appears related as it addresses showing shell output while a command runs. However, since this is from the app package rather than tui, and the current PR (40859) is specifically focused on streaming bash output in the TUI scrollback with incremental metadata updates, they may address different concerns (app vs. tui components).

The other results like #40005 (background long-running commands) and #37653 (batch shell output updates) are related to shell output handling but don't appear to be exact duplicates of the current fix.

No exact duplicate PRs found for PR #40859.

Sign up for freeto 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.

[BUG] Standalone TUI bash tool doesn't stream live output (only shows command + spinner until completion)

2 participants

@zcxGGmu@MaskerFather