Skip to content

fix: use paths in delete_files prompt example - #1702

Open
WeAreResilience wants to merge 3 commits into
anthropics:mainfrom
WeAreResilience:fix/1665-delete-files-paths
Open

fix: use paths in delete_files prompt example#1702
WeAreResilience wants to merge 3 commits into
anthropics:mainfrom
WeAreResilience:fix/1665-delete-files-paths

Conversation

@WeAreResilience

Copy link
Copy Markdown
Contributor

Summary

The tag-mode prompt told the model to call mcp__github_file_ops__delete_files with files. The tool schema and handler expect paths, so the first signed-commit delete fails Zod validation.

This changes the prompt example to paths and adds a test so the example cannot drift back to files.

Fixes #1665

Test plan

  • bun test test/create-prompt.test.ts (49 pass)
  • bun run typecheck

From RESILIENCE Agentic Solutions.

WeAreResilience and others added 3 commits August 19, 2026 20:00
The tag-mode prompt told the model to call delete_files with
"files", but the MCP tool schema and handler expect "paths".

Co-authored-by: Cursor <cursoragent@cursor.com>
The old {files} payload is rejected by the same Zod shape the
tool registers; the generated prompt example now parses cleanly.

Co-authored-by: Cursor <cursoragent@cursor.com>
Confirm the old files-only payload still fails, types and required
fields are enforced, and commit_files was not inverted by the fix.

Co-authored-by: Cursor <cursoragent@cursor.com>
@WeAreResilience

Copy link
Copy Markdown
Contributor Author

Verification against the live delete_files Zod schema (the same shape server.tool registers):

Check Result
Old prompt payload { files, message } rejected (paths required)
New prompt payload { paths, message } accepted
Generated tag-mode example parses the live schema pass
paths as a string, not an array rejected
paths present, message omitted rejected
Extra files key beside valid paths accepted (unknown keys stripped)
commit_files example still uses files unchanged
Generated delete_files keys are exactly paths + message pass

These live in test/delete-files-prompt-schema.test.ts (8 tests). Happy to trim the extra coverage if you would rather keep the PR to the one-word prompt change.

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.

Tag-mode prompt documents delete_files with a "files" parameter, but the tool schema declares "paths"

1 participant