fix(kaos): resolve Git Bash POSIX paths for file tools on Windows#2200
Open
wszqkzqk wants to merge 1 commit into
Open
fix(kaos): resolve Git Bash POSIX paths for file tools on Windows#2200wszqkzqk wants to merge 1 commit into
wszqkzqk wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: d10ae9a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a4e5d5d074
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Add a shell path bridge that translates between win32 paths and the MSYS2/Git Bash path dialect. File tools resolve model-supplied paths through it before canonicalization and workspace checks: drive-letter forms translate lexically, root-relative paths resolve via cygpath -w with per-segment caching, and every failure mode falls back to the previous behavior. Fixes MoonshotAI#2199
wszqkzqk
force-pushed
the
fix/windows-git-bash-paths
branch
from
July 26, 2026 07:22
a4e5d5d to
d10ae9a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a shell path bridge that translates between win32 paths and the MSYS2/Git Bash path dialect. File tools resolve model-supplied paths through it before canonicalization and workspace checks: drive-letter forms translate lexically, root-relative paths resolve via cygpath -w with per-segment caching, and every failure mode falls back to the previous behavior.
Fixes #2199
Related Issue
Resolve #2199
Problem
See linked issue. On Windows + Git Bash, file tools resolve root-relative
POSIX paths (
/tmp/...,/home/...) against the current drive rootinstead of the shell's mount table:
Readreports file-not-found forfiles bash just created, and
Write/Editsilently create files atwrong locations such as
C:\tmp\....What changed
environmentProbe.tspattern) and wired it into the file-tool pathguard: drive-letter forms (
/c/x,/cygdrive/c/x) translate lexically,root-relative paths resolve via
cygpath -w(cached per first segment),so file tools interpret paths exactly as the shell does.
translated path — translation cannot widen access.
the same bridge (
toShellPath, identical semantics).to current behavior: no working case can regress. Command text is never
rewritten; WSL is unaffected.
guard integration).
Design notes and verification
/tmp→%TEMP%,/bin→usr/bin, user/etc/fstabentries); lexical rulesor fstab parsing cannot cover these.
most one cygpath spawn per process, then hits the cache.
(TUI, config files) are untouched.
Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.