Skip to content

Comments

fix: Windows path support and canonicalization#13671

Merged
Hona merged 3 commits intoanomalyco:devfrom
edemaine:windows-paths
Feb 23, 2026
Merged

fix: Windows path support and canonicalization#13671
Hona merged 3 commits intoanomalyco:devfrom
edemaine:windows-paths

Conversation

@edemaine
Copy link
Contributor

@edemaine edemaine commented Feb 15, 2026

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

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

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

No duplicate PRs found

The PR #13671 is a followup to #13659 as explicitly mentioned in the description, but PR #13659 (fix(desktop): change detection on Windows, especially Cygwin) is the related predecessor, not a duplicate. No other open PRs are addressing the same Windows path support and canonicalization issues.

@Hona
Copy link
Member

Hona commented Feb 22, 2026

#6763 was architecture astronauting... when these more surgical fixes were the goal.
your PRs are fantastic - thank you! :)

Hona added 2 commits February 23, 2026 09:44
- Added missing `.replaceAll("\\", "/")` for 'add' operations in apply_patch summary
- Changed string interpolation to `path.join(...).replaceAll("\\", "/")` in snapshot tracking to avoid mixed slashes
- Fortified apply_patch tests with strict formatting assertions to prevent regressions
- Removed .replaceAll('\', '/') in skill loader, as pathToFileURL handles backslashes natively
- Removed redundant path.normalize() translation in skill tool
- Fixed brittle hardcoded slashes in skill.test.ts that caused false CI failures on Windows
@Hona Hona merged commit 0042a07 into anomalyco:dev Feb 23, 2026
8 of 11 checks passed
@Hona
Copy link
Member

Hona commented Feb 23, 2026

thanks for this - great work.

feel free to submit any more PRs, please @ me in them :)

@pschiel
Copy link
Contributor

pschiel commented Feb 23, 2026

#6763 was architecture astronauting... when these more surgical fixes were the goal. your PRs are fantastic - thank you! :)

6373 most of all fixed bugs since december, manually tested, while you're stilll struggling to get any of it fixed, months later.

@Hona
Copy link
Member

Hona commented Feb 23, 2026

ah I meant my PR, not yours, sorry mate! :)

@edemaine
Copy link
Contributor Author

@Hona Thanks for the positive feedback! And for your cleanups. These should greatly improve the Windows experience!

I'll try looking at more of #6763 to see whether there are more changes to include in smaller PRs.

@Hona
Copy link
Member

Hona commented Feb 23, 2026

btw here's the PR I said was crazy architecture wise... it was an attempt to see how far a ralph loop could go - and alas it went a bit crazy #11897

presumably these further fixes are for your actual use cases? I'm happy to look at any further PRs

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 apply_patch fails

3 participants