Repository navigation
Conversation
hxaxd
marked this pull request as ready for review
July 16, 2026 14:14
Closed
5 tasks done
Chelebii
approved these changes
Jul 16, 2026
Chelebii
left a comment
Owner
There was a problem hiding this comment.
Reviewed against the maintainer feedback on modelcontextprotocol#3296. Independent validation passed: 52 focused tests, the full filesystem suite (153 tests), and the filesystem TypeScript build. The fallback ordering, error propagation, and temp cleanup behavior look correct.
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.
Description
When
fs.renamefails withEPERM, try an in-placefs.writeFileoverwrite before usingfs.cp({ force: true }). The direct overwrite avoids the destination unlink—and the associated symlink race window—in the common Windows lock case.fs.cpremains the final fallback for locks that allow delete sharing but not write sharing.The filesystem tests now cover both public call paths, verify that the safer direct overwrite avoids
fs.cpwhen it succeeds, and verify the copy fallback when direct overwrite is blocked.Server Details
write_fileandedit_filereplacement behavior and testsMotivation and Context
This applies the fallback ordering requested in the maintainer review on modelcontextprotocol#3296 and follows the contribution request on modelcontextprotocol#3610.
How Has This Been Tested?
The four focused direct-overwrite and fallback tests failed before the implementation change and pass afterward.
Breaking Changes
None.
Types of changes
Checklist
Additional context
The normal atomic rename path is unchanged. The documented non-atomic
fs.cpbehavior is retained only as the last fallback.