Skip to content

fix(shell): avoid non-string stdout parsing in cygpath path resolution#28075

Open
jeevan6996 wants to merge 1 commit into
anomalyco:devfrom
jeevan6996:fix-26932-bash-stdout-parse
Open

fix(shell): avoid non-string stdout parsing in cygpath path resolution#28075
jeevan6996 wants to merge 1 commit into
anomalyco:devfrom
jeevan6996:fix-26932-bash-stdout-parse

Conversation

@jeevan6996
Copy link
Copy Markdown

@jeevan6996 jeevan6996 commented May 17, 2026

Issue for this PR

Closes #26932

Type of change

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

What does this PR do?

This fixes a bash-tool failure where a non-string stdout shape could flow into a split path during Windows cygpath resolution. I replaced the spawner.lines(...) call with explicit spawn + stdout stream decode + exit-code check, then only parse the first line when the command succeeds.

This keeps the same fallback behavior (undefined on failure) but removes the non-string split hazard that could abort tool execution.

How did you verify your code works?

  • Ran bun test test/tool/shell.test.ts from packages/opencode (22 passing tests)
  • Push hook ran bun turbo typecheck successfully before branch push

Screenshots / recordings

N/A (non-UI change)

Checklist

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

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels May 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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 always returns "(result.stdout ?? "").split is not a function" - shell subprocess never executes

1 participant