[PR #13671] fix: Windows path support and canonicalization #14767

Open
opened 2026-02-16 18:19:31 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/13671

State: open
Merged: No


What does this PR do?

This is a followup to #13659 when I realized how many existing tests fail on Windows. With the two PRs together, the number of failures drops from 74 to 8.

The important change here is to not use split(":", 2) to remove the initial part of a patch message. Crucially, split(":", 2) discards anything after a second occurrence of ":", meaning that all absolute Windows paths (C:\...) were unsupported. I can't tell you how many times I've seen the message "Patch failed - can't find file named 'C'" and the AI switches to using relative paths as a workaround. This should fix that.

Otherwise just a bunch of \/ normalization.

Fixes #10360. Now I see that #6763 might have done most of my work already. ☹️

How did you verify your code works?

bun run test - number go down

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/13671 **State:** open **Merged:** No --- ### What does this PR do? This is a followup to #13659 when I realized how many existing tests fail on Windows. With the two PRs together, the number of failures drops from 74 to 8. The important change here is to not use `split(":", 2)` to remove the initial part of a patch message. Crucially, `split(":", 2)` discards anything after a second occurrence of ":", meaning that all absolute Windows paths (`C:\...`) were unsupported. I can't tell you how many times I've seen the message "Patch failed - can't find file named 'C'" and the AI switches to using relative paths as a workaround. This should fix that. Otherwise just a bunch of `\` → `/` normalization. Fixes #10360. Now I see that #6763 might have done most of my work already. ☹️ ### How did you verify your code works? `bun run test` - number go down
yindo added the pull-request label 2026-02-16 18:19:31 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14767