fix(peer-job-runner): prefer Git Bash over WSL on native Windows - #1292
Conversation
Resolve POSIX shell via CE_PEER_BASH, CLAUDE_CODE_GIT_BASH_PATH, well-known Git installs (including LocalAppData), then non-System32 PATH — rewrite bare bash/sh argv and fail closed instead of detaching into WSL (EveryInc#1268). Co-authored-by: Cursor <cursoragent@cursor.com>
Rewrite bare bash/sh after env VAR=… (cross-model start shape) and walk all PATH shells so System32 WSL is not a dead end when a later Git Bash exists. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: add38420ab
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Patch MOD.os.path to ntpath while simulating Windows so Ubuntu bun test no longer mis-parses C:\ paths in the EveryInc#1268 resolver fixture (PR EveryInc#1292 Codex P1). Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 97ff1313c4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Keep caller-supplied absolute Git Bash paths (portable installs) instead of always substituting the preferred resolver. Bare names and System32 WSL still resolve/fail-closed (EveryInc#1292 P2). Co-authored-by: Cursor <cursoragent@cursor.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1b3336ba0e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Teach _env_bash_index that -C/--chdir and -S/--split-string (plus -u/--unset) consume their arguments so a chdir directory named bash is not rewritten and bash after a real -C DIR is still rewritten (EveryInc#1292). Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 54e19abb27
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…tring `env -S "bash script.sh"` (and the attached/long-option forms) word-splits its operand the same way `env` itself parses argv, so a bash/sh command hidden inside the split string was never inspected and could still resolve to System32 WSL bash -- the exact class of bug EveryInc#1268 fixed for the plain `env VAR=... bash` shape. `_env_bash_index` now parses -S/--split-string content via the same assignment-then-command walk as top-level argv, and `_rewrite_env_split_string_value` rewrites the resolved shell in place, preserving the -S/--split-string= prefix. An unparsable operand (bad quoting) raises RunnerError instead of silently passing through (EveryInc#1292 Codex). Co-authored-by: Cursor <cursoragent@cursor.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8f2b732548
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ed0517f661
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- search ProgramW6432 before 32-bit Program Files roots - deduplicate equivalent well-known Git Bash locations - add focused resolver ordering and deduplication coverage Note: full bun run test retains pre-existing native Windows failures outside these files.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 876fbfc7fd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- parse operand-taking options inside GNU env short clusters - reject unsupported clusters before native Windows detach - cover separate and attached u/C operands Note: full bun run test retains pre-existing native Windows failures outside these files.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 99540776f2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- fail closed on abbreviated and unknown env long options - preserve exact supported long forms and option terminator semantics - add unit and native pre-detach regression coverage Note: full bun run test retains pre-existing native Windows failures outside these files.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d39c3b14e3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- support exact no-operand GNU env long aliases - keep abbreviated and unknown long options fail-closed - add parser, rewrite, and native Windows coverage Note: full bun run test retains pre-existing native Windows failures outside these files.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4b2c52d9f6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- reject env --null when a command would follow - assert successful Windows smoke workers reach done - retain supported ignore-environment and debug aliases Note: full bun run test retains pre-existing native Windows failures outside these files.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa5e63a376
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- classify env assignments before matching shell commands - preserve assignment values ending in bash or sh - add unit and native Windows worker coverage Note: full bun run test retains pre-existing native Windows failures outside these files.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bf2f991121
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- reject Sysnative aliases for System32 WSL launchers - require done state in core Windows launch smokes - add resolver and native classification coverage Note: full bun run test retains pre-existing native Windows failures outside these files.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4a6aa0d5ac
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Classify active env option tokens before basename matching so attached chdir operands cannot be mistaken for the command shell. Reject env null-output options before detached execution, and cover attached operands, option termination, and native Windows behavior.
Remove a post-terminator synthetic command whose basename intentionally differs between POSIX and Windows path semantics. The remaining cases directly verify that option parsing stops after env --.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c9da4776fc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Treat GNU env's lone dash as empty-environment mode and the end of option parsing, allowing following option-shaped assignments while still rewriting the actual Bash command. Cover both terminator forms in unit and native Windows smoke tests.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a231a69caa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Stop parsing options after the first GNU env NAME=VALUE operand so later option-shaped assignments remain assignments and the following Bash command can be rewritten. Cover the transition in unit and native Windows smoke tests.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2554a00654
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Accept GNU env's exact signal-handling long options and their documented attached signal forms while retaining fail-closed handling for unknown or abbreviated options. Exercise each accepted form through unit and native Windows smoke tests.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fb333dc431
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Recognize GNU env assignments with an empty name so the parser continues to the actual Bash command. Extend unusual-assignment unit and native Windows smoke coverage with =x.
On native Windows, peer workers that launched through bare
bash(or the cross-modelenv … bash script.shshape) could land on System32 WSL bash, miss Windowsjq/Claude CLI, and silently skip. They now resolve Git Bash first (env overrides → well-known installs → non-WSL PATH), rewrite those bash/sh tokens before detach, and fail closed with a clear error when nothing usable remains.Session-settled from planning: own only #1268; fail closed with no WSL fallback; rewrite bare
bash/sh(user-directed).Validation: unit fixture (PATH order, env-prefix rewrite, fail-closed), Windows smoke (bare
.sh,bashprefix,env … bash), and six-skill runner parity — all green on a native Windows host with Git Bash.Fixes #1268.
Security Disclosure
Changes Windows peer-worker shell selection: prefers Git Bash / configured absolute bash over System32 WSL, and rewrites bare
bash/sh(including afterenv VAR=…) before detach. Residual: WindowsApps/Sysnative WSL aliases are not specially rejected.Agent Disclosure