Skip to content

fix(file-tools): normalize MSYS paths to prevent Windows ghost tree writes - #46887

Closed
CodeForgeNet wants to merge 1 commit into
NousResearch:mainfrom
CodeForgeNet:main
Closed

fix(file-tools): normalize MSYS paths to prevent Windows ghost tree writes#46887
CodeForgeNet wants to merge 1 commit into
NousResearch:mainfrom
CodeForgeNet:main

Conversation

@CodeForgeNet

Copy link
Copy Markdown
Contributor

What does this PR do?

Normalizes MSYS paths passed to file tools (write_file and patch) on Windows. Previously, paths like /c/Users/... were interpreted literally, causing successful writes to land in ghost trees (e.g., C:\c\Users\...) instead of the actual directory. This ensures Windows path resolution matches the terminal backend behavior.

Related Issue

Fixes #46876

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🛡️ Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)

@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint tool/file File tools (read, write, patch, search) P2 Medium — degraded but workaround exists duplicate This issue or pull request already exists labels Jun 15, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #44735 — both PRs fix the same Windows MSYS path-resolution bug (#46876) by adding _normalize_msys_path to tools/file_tools.py, translating /c/Users/... to C:\Users\... so writes don't land in the C:\c\Users\... ghost tree. #44735 (open, filed 3 days earlier) is the canonical version and is more complete — it also handles /cygdrive/ and /mnt/ prefixes and patches the path-resolution warning path.

This PR's extra value (wiring the normalization into _sentinel_free_abs_cwd for TERMINAL_CWD and the broader test coverage) is worth folding into #44735. Related: closed predecessor #44765 (same approach), tracking issue #46876.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint duplicate This issue or pull request already exists P2 Medium — degraded but workaround exists 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.

[Bug]: Windows MSYS path resolution breaks file writes after Hermes upgrade

2 participants