← Back to PRs

#10708: fix: handle Windows PATH case-sensitivity in exec environment

by Yida-Dev open 2026-02-06 21:42 View on GitHub →
agents stale
## Summary - On Windows, the system PATH variable is `Path` (mixed case), not `PATH` - `applyPathPrepend` and `applyShellPath` hardcoded `env.PATH`, creating a duplicate key that shadows the real system path - Add `resolvePathKey()` helper for case-insensitive PATH key resolution ## Test plan - [x] Unit tests for resolvePathKey logic (5 cases) - [x] All existing tests pass Closes #10560 Generated with [Claude Code](https://claude.com/claude-code) <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> - Fixes Windows `PATH` case-sensitivity by resolving the existing PATH key (e.g., `Path`) before prepending/merging. - Updates `applyPathPrepend` and `applyShellPath` to write back to the resolved key to avoid shadowing. - Adjusts gateway shell-path fallback gating to treat any case-variant of PATH in `params.env` as “provided”. <h3>Confidence Score: 3/5</h3> - This PR is mostly safe to merge, but the added test currently does not validate the production implementation it claims to cover. - Core code change is small and localized (PATH key resolution and a safer check for user-provided PATH), but the new unit test duplicates the algorithm inline rather than asserting behavior of the actual `resolveKey` used in production, reducing confidence that future refactors won’t break Windows PATH handling unnoticed. - src/agents/bash-tools.exec.resolve-path-key.test.ts <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs