Skip to content

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

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#22006
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

Summary

  • Normalize Windows backslash paths to POSIX format in tool titles and glob patterns
  • Adds a oPosix() helper used across 8 tool files (edit, write, read, glob, ls, multiedit, lsp, plan)
  • Ensures consistent path handling on Windows without affecting other platforms

Test plan

  • Run opencode on Windows — verify file operations use forward slashes in tool titles
  • Run opencode on Linux/macOS — verify no regressions in path handling
  • Verify glob patterns work correctly on both platforms

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

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

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

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
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 github-actions bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Apr 11, 2026
@github-actions
Copy link
Copy Markdown
Contributor

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

Potential Duplicate Found

PR #21852 - "fix/windows path normalization"

Other Related PRs (may be addressing similar but not identical issues):

PR #21852 appears to be the most likely duplicate as it's specifically about Windows path normalization, similar to the current PR #22006 which normalizes backslash paths to POSIX format in tool titles and patterns.

@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 11, 2026
@github-actions github-actions bot closed this Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant