Skip to content

ref(tools): Check dispatcher input with its zod schema - #3507

Merged
MathurAditya724 merged 2 commits into
mainfrom
ref/dispatcher-envelope-schemas
Nov 16, 2026
Merged

MathurAditya724 merged 2 commits into
mainfrom
ref/dispatcher-envelope-schemas

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

executeTool and callMcpTool each had a hand-written copy of their input rules next to their zod schema. That's why #3495 had to add intent in 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. The executeTool dispatcher still parses again with the same schema, because it gets the raw input. callMcpTool is now strict like executeTool and accepts the same inputs as before. Its errors just get the usual Invalid tool arguments: prefix.

via @MathurAditya724.

--

View Session [Sentry]

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]>
@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 16, 2026 8:48pm UTC

Request Review

@github-actions github-actions Bot added the risk: high PR risk score: high label Nov 16, 2026
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

25 screenshot changes — 25 changed · 0 added · 0 removed

Review screenshots in Frameshift

Automation Run Details · Desktop
Automation Run Details · Desktop
Changed
Automations Runs Filters · Desktop
Automations Runs Filters · Desktop
Changed
Conversation Attached Linked Work Denied · Desktop
Conversation Attached Linked Work Denied · Desktop
Changed
Conversation Attached Linked Work Denied Light · Desktop
Conversation Attached Linked Work Denied Light · Desktop
Changed
Conversation Attachment Zoom · Desktop
Conversation Attachment Zoom · Desktop
Changed
Conversation Attachment Zoom · Mobile
Conversation Attachment Zoom · Mobile
Changed
Show 12 more changed screenshots
Conversation Child Agents · Desktop
Conversation Child Agents · Desktop
Changed
Conversation Details Watched Linked Work · Desktop
Conversation Details Watched Linked Work · Desktop
Changed
Conversation Long Transcript Touch · Mobile
Conversation Long Transcript Touch · Mobile
Changed
Conversation Memory List Jump · Desktop
Conversation Memory List Jump · Desktop
Changed
Conversation Memory List Jump · Mobile
Conversation Memory List Jump · Mobile
Changed
Conversation Object Links · Desktop
Conversation Object Links · Desktop
Changed
Conversation Pending Attachment · Desktop
Conversation Pending Attachment · Desktop
Changed
Conversation Pending Attachment · Mobile
Conversation Pending Attachment · Mobile
Changed
Conversation Question Picks And Text · Desktop
Conversation Question Picks And Text · Desktop
Changed
Conversation Task Line · Desktop
Conversation Task Line · Desktop
Changed
Settings · Desktop
Settings · Desktop
Changed
Settings Api Tokens · Desktop
Settings Api Tokens · Desktop
Changed

7 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
MathurAditya724 enabled auto-merge (squash) November 16, 2026 20:53
@MathurAditya724
MathurAditya724 merged commit db1d0cc into main Nov 16, 2026
47 checks passed
@MathurAditya724
MathurAditya724 deleted the ref/dispatcher-envelope-schemas branch November 16, 2026 21:01

This branch was successfully deployed

1 active deployment
Preview – junior-docs — de6f3239 Deployed Nov 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant