Skip to content

fix(peer-job-runner): prefer Git Bash over WSL on native Windows - #1292

Merged
tmchow merged 20 commits into
EveryInc:mainfrom
SomSamantray:fix/1268-prefer-git-bash-over-wsl
Jul 31, 2026
Merged

fix(peer-job-runner): prefer Git Bash over WSL on native Windows#1292
tmchow merged 20 commits into
EveryInc:mainfrom
SomSamantray:fix/1268-prefer-git-bash-over-wsl

Conversation

@SomSamantray

Copy link
Copy Markdown
Contributor

On native Windows, peer workers that launched through bare bash (or the cross-model env … bash script.sh shape) could land on System32 WSL bash, miss Windows jq/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, bash prefix, 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 after env VAR=…) before detach. Residual: WindowsApps/Sysnative WSL aliases are not specially rejected.

Agent Disclosure

  • Model: Cursor · Grok

SomSamantray and others added 2 commits July 31, 2026 15:55
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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread tests/fixtures/peer-job-runner-unit.py Outdated
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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread skills/ce-brainstorm/scripts/peer-job-runner.py Outdated
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>
@SomSamantray

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread skills/ce-brainstorm/scripts/peer-job-runner.py Outdated
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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread skills/ce-brainstorm/scripts/peer-job-runner.py Outdated
…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>
@SomSamantray

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread skills/ce-brainstorm/scripts/peer-job-runner.py Outdated
Comment thread skills/ce-brainstorm/scripts/peer-job-runner.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread skills/ce-doc-review/scripts/peer-job-runner.py
- 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread skills/ce-brainstorm/scripts/peer-job-runner.py Outdated
- 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread skills/ce-brainstorm/scripts/peer-job-runner.py Outdated
- 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread skills/ce-brainstorm/scripts/peer-job-runner.py
- 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread tests/fixtures/peer-job-runner-windows-smoke.py
- 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread skills/ce-brainstorm/scripts/peer-job-runner.py Outdated
- 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread skills/ce-brainstorm/scripts/peer-job-runner.py Outdated
Comment thread tests/fixtures/peer-job-runner-windows-smoke.py
- 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread skills/ce-brainstorm/scripts/peer-job-runner.py Outdated
Comment thread skills/ce-brainstorm/scripts/peer-job-runner.py Outdated
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 --.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread skills/ce-brainstorm/scripts/peer-job-runner.py Outdated
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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread skills/ce-brainstorm/scripts/peer-job-runner.py
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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread skills/ce-brainstorm/scripts/peer-job-runner.py
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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread skills/ce-brainstorm/scripts/peer-job-runner.py Outdated
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.
@tmchow
tmchow merged commit 5788604 into EveryInc:main Jul 31, 2026
3 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 31, 2026
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.

fix(cross-model): prefer Git Bash over WSL on native Windows

2 participants