Skip to content

fix(windows): normalize backslash paths to posix in tool titles/patterns#22177

Closed
tobias-weiss-ai-xr wants to merge 1 commit intoanomalyco:devfrom
tobias-weiss-ai-xr:feature/windows-path-fixes
Closed

fix(windows): normalize backslash paths to posix in tool titles/patterns#22177
tobias-weiss-ai-xr wants to merge 1 commit intoanomalyco:devfrom
tobias-weiss-ai-xr:feature/windows-path-fixes

Conversation

@tobias-weiss-ai-xr
Copy link
Copy Markdown

@tobias-weiss-ai-xr tobias-weiss-ai-xr commented Apr 12, 2026

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

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.
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 12, 2026

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • "What does this PR do?" section is empty or only contains placeholder text. Please describe your changes.
  • No "Type of change" checkbox is checked. Please select at least one.
  • No issue referenced. Please add Closes #<number> linking to the relevant issue.
  • "How did you verify your code works?" section is empty. Please explain how you tested.
  • Not all checklist items are checked. Please confirm you have tested locally and have not included unrelated changes.

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.

@github-actions github-actions bot added the needs:compliance This means the issue will auto-close after 2 hours. label Apr 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential Related PRs Found:

  1. fix/windows path normalization(#21441) #21852 - "fix/windows path normalization(SortableWorkspace session list empty due to store.path.directory not bootstrapped #21441)"

  2. fix: normalize windows path separators in session queries #20216 - "fix: normalize windows path separators in session queries"

  3. fix: normalize windows path separators in session queries #20215 - "fix: normalize windows path separators in session queries"

  4. fix(windows): keep project paths stable across aliases #18709 - "fix(windows): keep project paths stable across aliases"

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.

@github-actions
Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Apr 12, 2026
@github-actions github-actions bot closed this Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows backslash paths break tool titles and glob patterns

1 participant