fix(filesystem): tolerate Windows realpath ENOENT#3948
fix(filesystem): tolerate Windows realpath ENOENT#3948krot4u wants to merge 1 commit intomodelcontextprotocol:mainfrom
Conversation
Made-with: Cursor
|
@claude review |
|
Claude finished @cliffhall's task in 2m 5s —— View job PR Review: fix(filesystem): tolerate Windows realpath ENOENTTasks:
OverviewThis PR addresses a real Windows pain point where Issues1. Security: catch-all in
|
| Fix correctness | ✅ The two-phase fallback (stat absolute → stat parent) in lib.ts is logically sound and covers the real-world scenario. |
| Blocker | roots-utils.ts is a security regression — only ENOENT should be suppressed. |
| Test quality | The dead realpath mocks in lib.test.ts should be cleaned up to reflect actual code paths. |
| Test coverage | A mocked unit test for the SUBST/mapped-drive scenario would strengthen confidence. |
Summary
ealpath() fails with ENOENT to avoid false Parent directory does not exist.
Motivation
Cursor/VS Code clients may provide roots like ile:///d%3A/.... On some Windows setups, s.realpath() can fail with ENOENT for paths that exist, causing filesystem MCP to drop roots and reject valid operations.
Test plan
pm test in src/filesystem