Skip to content

fix(app): show shell output while a command runs - #37097

Closed
HopelessLoop wants to merge 9 commits into
anomalyco:devfrom
HopelessLoop:shell-output-running
Closed

fix(app): show shell output while a command runs#37097
HopelessLoop wants to merge 9 commits into
anomalyco:devfrom
HopelessLoop:shell-output-running

Conversation

@HopelessLoop

Copy link
Copy Markdown

The web UI collapsed bash tool output by default, so while a shell command executed the user only saw the "Shell" header with a spinner and could not expand it. Expand the tool while its status is running or pending so the command and live output are visible, matching the TUI. After completion it falls back to the shellToolPartsExpanded setting.

Issue for this PR

Closes#22116#37094

Type of change

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

What does this PR do?

In the web UI a shell command (shell mode or /shell) only showed the "Shell" header with a spinner while it ran. The command and its live output were hidden, and the tool could not be expanded. The TUI renders the same bash tool part inline with the command and streaming output.

This makes the web match the TUI:

  • partDefaultOpen now returns true for a bash tool whose status is running or pending, so the tool auto-expands during execution.
  • The bash trigger also shows the command while pending (previously only when not running and not open).

After completion the tool falls back to the shellToolPartsExpanded setting, so the existing collapsed-by-default behavior for finished commands is unchanged.

How did you verify your code works?

  • tsgo --noEmit passes for packages/session-ui.
  • The shell command path creates a bash tool part and streams output into state.metadata.output, finalizing state.output (packages/opencode/src/session/prompt.ts). Both UIs render it through the shared bash registry in session-ui, so expanding the part during running/pending surfaces the same command and output the TUI already shows.
  • Reproduction: run a shell command in the web UI. While it runs, the command and output now appear inline; after completion the tool collapses per the shellToolPartsExpanded setting.

Screenshots / recordings

2d6eaf4f-1345-4c96-b133-59458f95a50c2d6eaf4f-1345-4c96-b133-59458f95a50c

Checklist

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

shionyangand others added 3 commits July 15, 2026 17:21
The web UI collapsed bash tool output by default, so while a shell command executed the user only saw the "Shell" header with a spinner and could not expand it. Expand the tool while its status is running or pending so the command and live output are visible, matching the TUI. After completion it falls back to the shellToolPartsExpanded setting.
@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

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

[BUG] Web UI hides bash output during execution despite streaming data being available

1 participant

@HopelessLoop