Skip to content

fix: combine stdout and stderr in bash tool output#300

Merged
thdxr merged 3 commits intoanomalyco:devfrom
monotykamary:fix/bash-tool-stderr-output
Jun 22, 2025
Merged

fix: combine stdout and stderr in bash tool output#300
thdxr merged 3 commits intoanomalyco:devfrom
monotykamary:fix/bash-tool-stderr-output

Conversation

@monotykamary
Copy link
Copy Markdown
Contributor

Summary

  • Fix bash tool to combine stdout and stderr in output, ensuring commands like bun test that output to stderr are visible to users
  • Stderr is still preserved separately in metadata for backward compatibility

Test plan

  • Test with commands that output to stderr (e.g., echo "test" >&2)
  • Verify stderr is still available in metadata
  • Confirm existing functionality remains intact

Fixes #291

🤖 Generated with opencode

@monotykamary
Copy link
Copy Markdown
Contributor Author

Before:
image

After:
image

Copy link
Copy Markdown

@nitsanavni nitsanavni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idea - also return process exitCode in metadata

monotykamary and others added 2 commits June 22, 2025 14:22
Commands like `bun test` that output to stderr were not visible to users.
The bash tool now combines stdout and stderr in the main output while
preserving stderr separately in metadata for backward compatibility.

Fixes anomalyco#291

🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <noreply@opencode.ai>
Include process exit code in bash tool metadata to provide additional
context about command execution status. This helps users understand
whether commands succeeded or failed.

🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <noreply@opencode.ai>
@thdxr thdxr force-pushed the fix/bash-tool-stderr-output branch from a0e6a4c to 3cdbec8 Compare June 22, 2025 18:22
@thdxr thdxr merged commit 0e8c335 into anomalyco:dev Jun 22, 2025
moutansos pushed a commit to moutansos/opencode that referenced this pull request Jun 25, 2025
Co-authored-by: opencode <noreply@opencode.ai>
Co-authored-by: Dax Raad <d@ironbay.co>
achembarpu pushed a commit to achembarpu/opencode that referenced this pull request Aug 4, 2025
Co-authored-by: opencode <noreply@opencode.ai>
Co-authored-by: Dax Raad <d@ironbay.co>
xywsxp pushed a commit to xywsxp/opencode that referenced this pull request Apr 24, 2026
Co-authored-by: opencode <noreply@opencode.ai>
Co-authored-by: Dax Raad <d@ironbay.co>
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.

bash tool blind to stderr

3 participants