Skip to content

fix(exec): resolve PATH key case-insensitively for Windows pathPrepend#28821

Closed
Glucksberg wants to merge 1 commit intoopenclaw:mainfrom
Glucksberg:fix/issue-25399
Closed

fix(exec): resolve PATH key case-insensitively for Windows pathPrepend#28821
Glucksberg wants to merge 1 commit intoopenclaw:mainfrom
Glucksberg:fix/issue-25399

Conversation

@Glucksberg
Copy link
Contributor

Summary

Test plan

  • Run pnpm vitest run src/agents/bash-tools.test.ts
  • Verify findPathKey and applyPathPrepend tests pass

🤖 Generated with Claude Code

@chatgpt-codex-connector
Copy link

You have reached your Codex rate limits. Please try again later.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 27, 2026

Greptile Summary

Fixed Windows-specific bug where PATH environment variable prepending would create a duplicate uppercase PATH key instead of updating the existing mixed-case Path key.

  • Added findPathKey() helper to locate PATH key case-insensitively in env objects
  • Updated applyPathPrepend() and applyShellPath() to preserve original PATH key casing
  • Added comprehensive tests covering Windows-style Path key handling and edge cases

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The fix is targeted and well-tested, addressing a specific Windows PATH casing issue. The implementation is backward compatible, adds proper case-insensitive lookup, and includes comprehensive test coverage that verifies the fix works correctly while preventing regressions.
  • No files require special attention

Last reviewed commit: a2ea6bc

Copy link

@nikolasdehor nikolasdehor left a comment

Choose a reason for hiding this comment

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

Clean fix for Windows PATH case sensitivity. The findPathKey helper with uppercase-first preference is correct. Good test coverage for all case combinations.

@Takhoffman
Copy link
Contributor

Thanks again for the original patch and investigation here.

I’m closing this PR as superseded by #31879, which carries the same fix and was merged after this PR became blocked by a persistent GitHub head-ref sync issue.

Credit for the original fix remains with @Glucksberg.

@Takhoffman Takhoffman closed this Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling close:superseded PR close reason size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tools.exec.pathPrepend replaces PATH entirely on Windows instead of prepending

3 participants