Skip to content

fix(opencode): invoke Bash helpers on native Windows - #5110

Open
Futuri-Risk wants to merge 7 commits into
kunchenguid:mainfrom
Futuri-Risk:fix/opencode-windows-bash-seams
Open

Futuri-Risk wants to merge 7 commits into
kunchenguid:mainfrom
Futuri-Risk:fix/opencode-windows-bash-seams

Conversation

@Futuri-Risk

@Futuri-Risk Futuri-Risk commented Sep 21, 2026 •

Copy link
Copy Markdown

Intent

Fix the remaining OpenCode primary lifecycle seams that ask native Windows Node/Bun to execute tracked POSIX shell scripts directly.

This is the narrow native-seam scope approved in Futuri-Risk/firstmate-fleet#20 and implements Futuri-Risk/firstmate-fleet#21 and #22.

What changed

  • Session-start nudge invokes bash <script> on win32; macOS/Linux retain direct execution.
  • Turn-end guard invokes bash <script> on win32 while preserving the same stdin payload and return-code handling.
  • Persistent-cd and watcher-arm PreToolUse checks invoke Bash on win32, preserving exit-2 blocking and fail-open launch-error behavior.
  • OpenCode harness documentation now records the platform split.
  • The existing OpenCode live-E2E script now runs a fast native-Windows seam regression before its credentialed live gate. It exercises all four affected plugin callbacks with real Bash helpers: session-start exactly once, unhealthy turn-end follow-up delivery, allowed pre-tool commands proceeding, and denied commands still throwing.

The Windows regression fails against the pre-fix code because direct .sh child launches surface EFTYPE; the repaired paths reach the helper scripts through Bash.

Scope

No watcher, tmux, recovery, dispatch, ACPx, ZCode, PR-flow, or generic lifecycle redesign. The production diff is limited to the four approved OpenCode launch sites.

Validation

The branch is based directly on current upstream main at 631bc26d7b08b57e724f08a1734cc2eb2a0abf52. Portable OpenCode tests continue to exercise the non-Windows direct-exec path; the added regression is gated to native Windows.

@Futuri-Risk
Futuri-Risk force-pushed the fix/opencode-windows-bash-seams branch from dadcd7d to 835a19f Compare September 21, 2026 07:07
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.

1 participant