← Back to PRs

#10714: fix: handle Windows PATH case-sensitivity in node register invoke

by Yida-Dev open 2026-02-06 21:48 View on GitHub →
cli stale
## 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