fix(shell): keep Git Bash coreutils on PATH#108136
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 15, 2026, 10:55 PM ET / July 16, 2026, 02:55 UTC. Summary PR surface: Source +59, Tests +92. Total +151 across 4 files. Reproducibility: yes. source-reproducible: use a Windows-style environment whose inherited key is Review metrics: none identified. Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Keep the Bash-specific boundary, but collapse all case-insensitive PATH variants into one canonical property before prepending the verified Git Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: use a Windows-style environment whose inherited key is Is this the best way to solve the issue? No. A Bash-specific environment is the right boundary, but the implementation must canonicalize Windows PATH casing and validate the environment received by an actual child process. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7f9d519fcb0d. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +59, Tests +92. Total +151 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
ed5b434 to
85ab133
Compare
85ab133 to
bd40eb9
Compare
|
Merged via squash.
|
* fix(windows): expose Git Bash coreutils to commands Co-authored-by: luyifan <[email protected]> * test(windows): inject duplicate PATH variants * test(windows): run Git Bash integration in CI * refactor(windows): keep shell env helper private --------- Co-authored-by: Peter Steinberger <[email protected]>
Closes #108133
What Problem This Solves
Windows users could launch Git Bash through OpenClaw but still get command-not-found failures for Git-for-Windows tools when
Git\usr\binwas absent from the parent PATH. Duplicate case variants such asPATHandPathcould also make Node pass a different value than the one OpenClaw augmented.This affected the Bash tool and
!commandconfig values that rely on Git Bash tools such ascat,sed,grep, andcygpath.Why This Change Was Made
The fix builds one canonical Windows PATH before spawning. For a verified Git-for-Windows Bash, it prepends the matching
usr\bindirectory. Verification requires the siblingcmd\git.exemarker, so unrelated MSYS2 or custom Bash installations keep their own toolchain layout. The lookup is bounded and process-stable.Both Bash execution paths now share this environment:
!commandconfig resolutionRegular Windows PowerShell execution is unchanged.
User Impact
Git-for-Windows users can run Bash-backed OpenClaw commands without adding
Git\usr\binto their global PATH. Custom MSYS2 users are unaffected.Evidence
Focused local proof:
node scripts/run-vitest.mjs src/agents/shell-utils.test.ts src/agents/sessions/tools/bash.test.ts src/agents/sessions/windows-git-bash-path.test.ts-> 43 passed, 1 skipped; two Windows-only integration tests skipped on macOSoxlint-> passedoxfmt --check-> passedgit diff --check-> passedNative Windows Testbox proof:
9c26baf3a34e-> passed9c26baf3a34eb7cc4435f4cdb53447bb7be3c965src/agents/sessions/windows-git-bash-path.test.ts-> 2 passed, exercising the Bash tool and!commandagainst Git-for-WindowscygpathCoverage also includes standard and portable Git-for-Windows roots, unrelated MSYS2 roots, case-insensitive PATH-key deduplication, and the actual child-process environment.