Skip to content

fix(filesystem): show context for failed edits#4375

Open
go165 wants to merge 1 commit into
modelcontextprotocol:mainfrom
go165:go165/filesystem-edit-miss-context
Open

fix(filesystem): show context for failed edits#4375
go165 wants to merge 1 commit into
modelcontextprotocol:mainfrom
go165:go165/filesystem-edit-miss-context

Conversation

@go165

@go165 go165 commented Jun 14, 2026

Copy link
Copy Markdown

Fixes #2034.

Summary:

  • expand edit_file not-found errors with line-numbered file context
  • include a re-read hint so clients can copy exact current text before retrying
  • add a regression test for the diagnostic message

Validation:

  • npm exec --workspace src/filesystem -- vitest run tests/lib.test.ts --coverage=false: 47 passed
  • git diff --check: passed
  • npm run --workspace src/filesystem build: blocked locally because this separate worktree cannot resolve @modelcontextprotocol/sdk imports from the temporary linked node_modules setup

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.

edit_file tool fails when exact text match not found due to whitespace differences

1 participant