Skip to content

fix(filesystem): reject existing move destinations#4531

Open
dev-willbird1936 wants to merge 1 commit into
modelcontextprotocol:mainfrom
dev-willbird1936:fix/filesystem-move-no-overwrite
Open

fix(filesystem): reject existing move destinations#4531
dev-willbird1936 wants to merge 1 commit into
modelcontextprotocol:mainfrom
dev-willbird1936:fix/filesystem-move-no-overwrite

Conversation

@dev-willbird1936

Copy link
Copy Markdown

Description

Make the filesystem server's move_file honor its documented no-overwrite contract. Existing destination files, directories, and symlinks now return a tool error instead of being replaced.

Root cause

POSIX fs.rename replaces an existing destination. The previous implementation could therefore destroy destination data despite the tool description promising failure on conflicts.

Testing

  • Fresh filesystem recheck on 2026-07-15: focused regression 11/11 and full filesystem suite 153/153 passed.
  • Filesystem package build passed.
  • git diff --check passed.
  • Earlier validation recorded the full workspace test/build result; unrelated workspace packages were not rerun in this fresh recheck.
  • LLM-client integration was not exercised; tests call the server tool implementation directly.

The repository baseline itself fails a default Prettier check for these two existing files; the same check fails on origin/main. No unrelated formatter churn is included in this branch. Hosted CI and maintainer review remain pending.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants