Skip to content

fix(tools): resolve MSYS paths in file tools on Windows - #50488

Closed
lEWFkRAD wants to merge 2 commits into
NousResearch:mainfrom
lEWFkRAD:fix/windows-file-tools-msys-paths
Closed

fix(tools): resolve MSYS paths in file tools on Windows#50488
lEWFkRAD wants to merge 2 commits into
NousResearch:mainfrom
lEWFkRAD:fix/windows-file-tools-msys-paths

Conversation

@lEWFkRAD

@lEWFkRAD lEWFkRAD commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

On Windows with Git Bash, the agent passes file paths like /c/Users/OnyxB/project/file.py to read_file, write_file, and search_files.

Python on native Windows cannot resolve these MSYS-style paths — Path("/c/Users/x") resolves as \c\Users\x under the cwd (nonexistent) instead of C:\Users\x. This produces "file not found" errors or edits landing in the wrong directory.

Fix

  • Add _msys_to_windows_path() helper (ported from local.py) to translate /c/Users/project/file.py to C:\Users\project\file.py before Path.resolve().
  • Call it in _resolve_path_for_task() so ALL file tools (read, write, search) benefit.

Technical details

File Lines
tools/file_tools.py 10 import + 25 helper function + 4 MSYS check in _resolve_path_for_task

Session

Windows 11 native, Git Bash shell. The function is conditional (if _IS_WINDOWS) so Linux/macOS are untouched.

@alt-glitch alt-glitch added type/feature New feature or request comp/tui Terminal UI (ui-tui/ + tui_gateway/) P3 Low — cosmetic, nice to have labels Jun 22, 2026
@lEWFkRAD lEWFkRAD changed the title feat(desktop): artifact sidecar — live HTML preview as agent builds fix(tools): resolve MSYS paths in file tools on Windows Jun 22, 2026
@alt-glitch alt-glitch added type/bug Something isn't working comp/tools Tool registry, model_tools, toolsets tool/file File tools (read, write, patch, search) platform/windows Native Windows-specific behavior or breakage sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows and removed type/feature New feature or request comp/tui Terminal UI (ui-tui/ + tui_gateway/) labels Jun 26, 2026
lEWFkRAD added 2 commits July 2, 2026 08:00
…rtifacts

Detect write_file/patch tool calls targeting .html files and automatically
open them in the right rail preview pane with a "building" indicator (pulsing
green dot). When the agent turn completes, the indicator settles to a dim
dot to signal the artifact is done.

Changes:
- store/preview.ts: add artifactStatus and lastEditedAt to FilePreviewTab,
  export ARTIFACT_BUILD_TIMEOUT_MS, add openArtifactTab/touchArtifactTab/
  finishAllBuildingArtifactTabs/decayArtifactStatus helpers
- use-preview-routing.ts: detect artifact tool events (tool.start/complete)
  for .html writes, open in preview mode via openArtifactTab
- right-rail/preview.tsx: render pulsing green dot for building artifacts,
  dim dot for done artifacts, decay timer to auto-settle stale builds
…#40138)

On Windows with Git Bash, the agent passes file paths like
/c/Users/OnyxB/project/file.py to read_file/write_file/search_files.

Python on native Windows cannot resolve these MSYS-style paths -
Path("/c/Users/x") becomes \c\Users\x under the cwd instead of
C:\Users\x, producing "file not found" errors or edits landing in
the wrong directory.

Fix:
- Add _msys_to_windows_path() (ported from local.py) to translate
  /c/Users/x to C:\Users\x before Path() resolution
- Call it in _resolve_path_for_task() so all file tools benefit
- No change on non-Windows or for non-MSYS paths

Closes NousResearch#40138
@OutThisLife

Copy link
Copy Markdown
Collaborator

Superseded by #61915.

That salvage keeps the MSYS→native file-tool fix, rebased onto current main (container-aware _resolve_path_for_task), and:

  • drops the unrelated desktop artifact-sidecar commit that was on this branch
  • reuses local._msys_to_windows_path instead of duplicating it
  • adds regression tests (incl. relative paths against an MSYS cwd)
  • does not close File tools prepend Windows drive letters to Linux paths #40138 (that's the WSL host-prefix bug — different class)

You're credited via Co-authored-by. Thanks for the diagnosis and the port from local.py.

@OutThisLife

Copy link
Copy Markdown
Collaborator

Closing in favor of #61915 (clean salvage on current main).

OutThisLife added a commit that referenced this pull request Jul 10, 2026
Git Bash hands file tools paths like /c/Users/... which Path() on native
Windows treats as relative \\c\\Users\\... under the process cwd. Reuse
local._msys_to_windows_path (extended for /cygdrive and /mnt drive forms)
in _resolve_path_for_task / _resolve_base_dir so read/write/search land on
the real drive. Container/WSL Linux paths are left untouched.

Salvages #50488 (drops unrelated desktop artifact commit); tests adapted
from #46995.

Co-authored-by: Jeff Watts <186512915+lEWFkRAD@users.noreply.github.com>
Co-authored-by: LeonSGP43 <cine.dreamer.one@gmail.com>
OutThisLife added a commit that referenced this pull request Jul 10, 2026
fix(tools): resolve MSYS paths in file tools on Windows (supersedes #50488)
santhreal pushed a commit to santhreal/hermes-agent that referenced this pull request Jul 13, 2026
Git Bash hands file tools paths like /c/Users/... which Path() on native
Windows treats as relative \\c\\Users\\... under the process cwd. Reuse
local._msys_to_windows_path (extended for /cygdrive and /mnt drive forms)
in _resolve_path_for_task / _resolve_base_dir so read/write/search land on
the real drive. Container/WSL Linux paths are left untouched.

Salvages NousResearch#50488 (drops unrelated desktop artifact commit); tests adapted
from NousResearch#46995.

Co-authored-by: Jeff Watts <186512915+lEWFkRAD@users.noreply.github.com>
Co-authored-by: LeonSGP43 <cine.dreamer.one@gmail.com>
santhreal pushed a commit to santhreal/hermes-agent that referenced this pull request Jul 13, 2026
…488-msys-paths

fix(tools): resolve MSYS paths in file tools on Windows (supersedes NousResearch#50488)
justemu pushed a commit to justemu/hermes-agent that referenced this pull request Jul 18, 2026
Git Bash hands file tools paths like /c/Users/... which Path() on native
Windows treats as relative \\c\\Users\\... under the process cwd. Reuse
local._msys_to_windows_path (extended for /cygdrive and /mnt drive forms)
in _resolve_path_for_task / _resolve_base_dir so read/write/search land on
the real drive. Container/WSL Linux paths are left untouched.

Salvages NousResearch#50488 (drops unrelated desktop artifact commit); tests adapted
from NousResearch#46995.

Co-authored-by: Jeff Watts <186512915+lEWFkRAD@users.noreply.github.com>
Co-authored-by: LeonSGP43 <cine.dreamer.one@gmail.com>
Gravezzz pushed a commit to Gravezzz/hermes-agent that referenced this pull request Jul 21, 2026
Git Bash hands file tools paths like /c/Users/... which Path() on native
Windows treats as relative \\c\\Users\\... under the process cwd. Reuse
local._msys_to_windows_path (extended for /cygdrive and /mnt drive forms)
in _resolve_path_for_task / _resolve_base_dir so read/write/search land on
the real drive. Container/WSL Linux paths are left untouched.

Salvages NousResearch#50488 (drops unrelated desktop artifact commit); tests adapted
from NousResearch#46995.

Co-authored-by: Jeff Watts <186512915+lEWFkRAD@users.noreply.github.com>
Co-authored-by: LeonSGP43 <cine.dreamer.one@gmail.com>
Gravezzz pushed a commit to Gravezzz/hermes-agent that referenced this pull request Jul 21, 2026
…488-msys-paths

fix(tools): resolve MSYS paths in file tools on Windows (supersedes NousResearch#50488)
leewenjie pushed a commit to leewenjie/hermes-agent that referenced this pull request Aug 7, 2026
Git Bash hands file tools paths like /c/Users/... which Path() on native
Windows treats as relative \\c\\Users\\... under the process cwd. Reuse
local._msys_to_windows_path (extended for /cygdrive and /mnt drive forms)
in _resolve_path_for_task / _resolve_base_dir so read/write/search land on
the real drive. Container/WSL Linux paths are left untouched.

Salvages NousResearch#50488 (drops unrelated desktop artifact commit); tests adapted
from NousResearch#46995.

Co-authored-by: Jeff Watts <186512915+lEWFkRAD@users.noreply.github.com>
Co-authored-by: LeonSGP43 <cine.dreamer.one@gmail.com>
leewenjie pushed a commit to leewenjie/hermes-agent that referenced this pull request Aug 7, 2026
…488-msys-paths

fix(tools): resolve MSYS paths in file tools on Windows (supersedes NousResearch#50488)
randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
Git Bash hands file tools paths like /c/Users/... which Path() on native
Windows treats as relative \\c\\Users\\... under the process cwd. Reuse
local._msys_to_windows_path (extended for /cygdrive and /mnt drive forms)
in _resolve_path_for_task / _resolve_base_dir so read/write/search land on
the real drive. Container/WSL Linux paths are left untouched.

Salvages NousResearch#50488 (drops unrelated desktop artifact commit); tests adapted
from NousResearch#46995.

Co-authored-by: Jeff Watts <186512915+lEWFkRAD@users.noreply.github.com>
Co-authored-by: LeonSGP43 <cine.dreamer.one@gmail.com>
randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
…488-msys-paths

fix(tools): resolve MSYS paths in file tools on Windows (supersedes NousResearch#50488)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tools Tool registry, model_tools, toolsets P3 Low — cosmetic, nice to have platform/windows Native Windows-specific behavior or breakage sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows tool/file File tools (read, write, patch, search) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants