fix: exec gstack-brain-sync through bash on Windows - #2451
Closed
vaston-viji wants to merge 1 commit into
Closed
Conversation
The garrytan#1731 fix gated the brain-sync spawns behind `shell: NEEDS_SHELL_ON_WINDOWS`, but that routes through cmd.exe, which cannot execute an extensionless bash shebang script. Every /sync-gbrain run on Windows errored with "'gstack-brain-sync' is not recognized as an internal or external command" and the stage reported "brain-sync exited 1". Invoke the script through bash explicitly on Windows (Git Bash ships with git, a hard gstack dependency); POSIX keeps the direct shebang exec. Also surface spawn errors (e.g. bash missing from PATH) in the stage summary instead of a bare exit code, and update the garrytan#1731 tripwire test to pin the new invariant: brain-sync spawns must exec bash, not rely on shell:true. Observed on Windows 11, bun 1.3.14. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
9 tasks
Owner
|
Closing: this was absorbed or superseded on main by v1.67.0.0 or earlier (see the v1.67 tracker-wave receipts in PR #2604). Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The #1731 fix gated the orchestrator's brain-sync spawns behind
shell: NEEDS_SHELL_ON_WINDOWS, but that routes through cmd.exe, which cannot execute an extensionless bash shebang script. Every/sync-gbrainrun on Windows errors:and the stage reports
ERR brain-sync — gstack-brain-sync exited 1.Fix
In
runBrainSyncPush(bin/gstack-gbrain-sync.ts), exec the script through bash explicitly on Windows:spawnSync("bash", [brainSyncPath, flag]). Git Bash ships with git, which gstack already requires, so bash is a safe dependency. POSIX keeps the direct shebang exec with no shell. Spawn errors (e.g. bash missing from PATH) now surface in the stage summary instead of a bare exit code.The #1731 tripwire test pinned the old shape (
spawnSync(brainSyncPath, ...)with the shell flag), so it is updated to pin the new invariant: brain-sync spawns must exec bash on Windows and must not rely onshell: true.Verification
On Windows 11 (bun 1.3.14):
ERR brain-sync — gstack-brain-sync exited 1with the "not recognized" cmd error.OK brain-sync — curated artifacts pushed (0.2s).bun test test/gbrain-spawn-windows-shell.test.ts: 5 pass, 0 fail.Related: #2450 fixes the separate Windows probe-timeout false-negative in the same sync pipeline.
🤖 Generated with Claude Code