fix(file-tools): normalize MSYS paths in _resolve_path_for_task on Windows (#44726) - #44765
Closed
HrushiYadav wants to merge 1 commit into
Closed
Conversation
…ndows - call _msys_to_windows_path before Path construction so /d/Project resolves to D:\Project instead of D:\d\Project - reuses existing normalization from tools/environments/local.py
Collaborator
Author
|
Closing as duplicate of #44735. |
This was referenced Jun 15, 2026
This was referenced Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On Windows + Git Bash/MSYS2, file tools silently write to wrong paths when the LLM passes MSYS-style paths (
/d/Project/file.sh). Python'spathlib.Pathtreats/d/Projectas "root\on the current drive", resolving it toD:\d\Projectinstead ofD:\Project.The normalization already exists in the codebase (
_msys_to_windows_pathintools/environments/local.py) and is used by the terminal tool, but was missing fromfile_tools._resolve_path_for_task.Changes
tools/file_tools.py: import and call_msys_to_windows_pathat the top of_resolve_path_for_taskbeforePath()constructiontests/tools/test_file_tools_msys_path.py: 4 tests covering MSYS drive paths on Windows, native Windows paths passthrough, and non-Windows no-opTest plan
pytest tests/tools/test_file_tools_msys_path.py)pytest tests/tools/test_local_env_windows_msys.py)write_filewith/d/Project/fileresolves toD:\Project\fileFixes #44726