Repository navigation
Description
Problem
The model often sends executeTool calls in a shape that the runtime rejects. Each rejection wastes one tool call. In the recurring-slot scheduling eval (#2413), that matters, because the case has a 60s idle limit and a tool-call budget.
Two shapes show up:
- A top-level
intentkey next totool_nameandarguments. - Catalog tool parameters at the top level instead of under
arguments.
Both are rejected by resolveCatalogToolCall() in packages/junior/src/chat/tool-support/catalog-tool-call.ts with executeTool arguments must be nested under arguments, not top-level fields: ....
Evidence
- In about 98 recent live behavioral runs of the Google scheduling cases, 22
executeToolcalls were rejected for their argument shape. The count is from an agent that read the eval transcripts on evals.sentry.dev. It is not re-counted here. - One example: run
e3899820, recurring-slot case. The firstgoogle_findMeetingTimescall failed because the model putintentinside theexecuteToolinput.
Likely cause (inference, not confirmed)
The two dispatcher tools have different input contracts:
callMcpTool(chat/tools/skill/call-mcp-tool.ts) accepts a top-levelintent. Its extra-key check allowstool_name,argumentsandintent.searchMcpToolsalso takes a top-levelintent.executeTool(chat/tools/execute-tool.ts) is.strict()and allows onlytool_nameandarguments.
The model sees both dispatchers in the same turn. It is plausible that it carries intent over from callMcpTool to executeTool. This issue does not prove that; a check of which calls carried intent versus nested parameters would.
Options
- Make the two dispatchers take the same envelope. Either
executeToolaccepts an optionalintent(and passes it where it is useful, such as auth prompts), or neither does. - Keep
executeToolstrict, but make the rejection cheaper: the error could name the corrected call shape.
Do not change eval messages, checks or timeouts to hide this. Fix it in the tool contract.
Done when
- The two dispatchers have one documented argument envelope, or the difference is deliberate and explained beside the code.
- The existing primary test for catalog tool calls covers the chosen behavior.
- A live behavioral run of the scheduling cases shows no rejected
executeToolshapes.
Refs #2413.
via David Cramer.
--
Activity
ref(tools): Check dispatcher input with its zod schema (#3507)