#10714: fix: handle Windows PATH case-sensitivity in node register invoke
cli
stale
Cluster:
Windows Path and Exec Fixes
## Summary
- Same Windows PATH case-sensitivity bug as in `bash-tools.exec.ts` (PR #10708), but in `register.invoke.ts`
- `applyPathPrepend` hardcodes `env.PATH`, which on Windows creates a duplicate key that shadows the real `Path` entry
- Add `resolvePathKey()` helper for case-insensitive PATH key resolution
## Test plan
- [x] Verified resolvePathKey prefers exact `PATH`, falls back to case-insensitive match
- [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 a Windows-specific PATH case-sensitivity issue in `src/cli/nodes-cli/register.invoke.ts` where writing `env.PATH` could create a second PATH-like entry and shadow the real one.
- Introduces `resolvePathKey()` to prefer an exact `PATH` key and otherwise reuse the existing case variant (e.g., `Path`) already present in the env object.
- Updates `applyPathPrepend()` to read/write via the resolved key so PATH prepends behave consistently across platforms.
- Change is localized to node invoke/run environment construction and does not affect other CLI commands.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk.
- Change is small, localized, and corrects a concrete Windows env-var behavior by preserving the existing PATH key casing when mutating env; no other logic paths are altered.
- No files require special attention
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#10708: fix: handle Windows PATH case-sensitivity in exec environment
by Yida-Dev · 2026-02-06
92.3%
#19931: Config: merge PATH env vars and bootstrap Windows bins
by Kemalau · 2026-02-18
84.2%
#9250: Fix: Add shell:true for Windows .cmd files to prevent spawn EINVAL ...
by vishaltandale00 · 2026-02-05
78.6%
#20330: Fix SSH tunnel startup on Windows by resolving ssh from PATH
by graysurf · 2026-02-18
78.3%
#13848: fix(test): normalize paths in source-display test for windows
by gengmao · 2026-02-11
78.0%
#5168: Fix: force UTF-8 for Windows exec
by ManojINaik · 2026-01-31
77.4%
#21733: security(exec): platform-aware allowlist matching and restricted sa...
by Esubaalew · 2026-02-20
77.2%
#23142: fix(test): Windows CI — use path.join for XDG path assertions in qm...
by ihsanmokhlisse · 2026-02-22
77.2%
#23480: fix(test): use path.join for cross-platform XDG path assertions in ...
by hydro13 · 2026-02-22
77.0%
#11529: fix(wizard): strip shell-style backslash escapes from workspace paths
by mcaxtr · 2026-02-07
76.7%