fix(windows): normalize backslash paths to posix in tool titles/patterns#22177
fix(windows): normalize backslash paths to posix in tool titles/patterns#22177tobias-weiss-ai-xr wants to merge 1 commit intoanomalyco:devfrom
Conversation
On Windows, path.relative() returns backslash-separated paths which look wrong in tool call titles and may cause issues in patterns arrays. Add toPosix() helper to convert \\ to / in edit, write, read, glob, ls, multiedit, lsp, and plan tools wherever paths appear in titles or permission patterns.
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
The following comment was made by an LLM, it may be inaccurate: Potential Related PRs Found:
These PRs all address Windows path normalization concerns. PR #21852 in particular seems most directly related as it's a previous fix for Windows path normalization. You may want to verify if PR #22177 duplicates any existing work or if it addresses a different aspect of the Windows path handling issue. |
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
Closes #22189
Issue for this PR Closes # ### Type of change - [x] Bug fix ### What does this PR do? On Windows, tool calls like file search or grep receive paths with backslashes (e.g. src\foo\bar.ts), but internal patterns and titles use forward slashes. This mismatch causes tool invocations to silently fail since glob patterns don't match backslash paths. The fix normalizes backslash paths to forward slashes in tool titles and pattern arguments before they reach the tool execution layer. This only affects the path strings passed to tools, not the filesystem operations themselves. ### How did you verify your code works? - Ran locally on Windows with backslash-containing paths - All 19 packages typecheck clean ### Checklist - [x] I have tested my changes locally - [x] I have not included unrelated changes in this PR