Repository navigation
ref(tools): Check dispatcher input with its zod schema - #3507
Merged
Merged
Conversation
executeTool and callMcpTool each kept a hand-written copy of their envelope rules next to the zod schema. Move the model-facing error text into the schemas and let the dispatchers use the parsed input. Co-Authored-By: Aditya Mathur <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
25 screenshot changes — 25 changed · 0 added · 0 removed Review screenshots in Frameshift Show 12 more changed screenshots7 more changed screenshots in Frameshift. |
Give callMcpTool the same missing tool_name message as executeTool, drop trailing periods so joined zod messages read cleanly, and test the executeTool envelope messages at its prepareArguments edge. Co-Authored-By: Aditya Mathur <[email protected]>
MathurAditya724
approved these changes
Nov 16, 2026
This branch was successfully deployed
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.
executeToolandcallMcpTooleach had a hand-written copy of their input rules next to their zod schema. That's why #3495 had to addintentin two places (see #2455). Now there's one schema per tool and no hand-written copy.The same error messages now live on the zod schemas. Pi already runs the schema before the tool, so
executeTool's friendly errors never reached the model before. Now they do. TheexecuteTooldispatcher still parses again with the same schema, because it gets the raw input.callMcpToolis now strict likeexecuteTooland accepts the same inputs as before. Its errors just get the usualInvalid tool arguments:prefix.via @MathurAditya724.
--
View Session [Sentry]