Summary
wait_for_previous is scheduler metadata, but the runtime forwards it to external tools unchanged. That breaks the external tool contract for strict MCP servers or discovered-tool commands that validate exact input schemas, because they receive an extra property that was not part of the original tool definition.
Related but distinct from #26643: that issue is about default scheduling behavior and redundant parallel calls. This one is about scheduler-only metadata leaking into the payload sent to external tools.
Why this happens
At commit a00d03efc62de08274619cf7da96569ae51ecbf3:
Reachability
This is reachable in normal operation, not dead code:
Reproduction
- Register an MCP tool or discovered tool command that validates inputs strictly, for example with
additionalProperties: false or equivalent.
- Invoke that tool with
wait_for_previous: true so the scheduler will sequence it.
- Observe that the external tool receives
wait_for_previous in its input payload and can reject the call as an unexpected property.
Expected behavior
wait_for_previous should influence scheduler behavior only. It should not be forwarded to external tool implementations.
Actual behavior
The same args object is used both for scheduling and for the payload sent to discovered tools / MCP servers, so scheduler-only metadata leaks across the tool boundary.
Related history
Possible fix
Strip reserved scheduler fields before tool.build(...), or at least before each external executor forwards params to discovered tools and MCP calls.
Summary
wait_for_previousis scheduler metadata, but the runtime forwards it to external tools unchanged. That breaks the external tool contract for strict MCP servers or discovered-tool commands that validate exact input schemas, because they receive an extra property that was not part of the original tool definition.Related but distinct from #26643: that issue is about default scheduling behavior and redundant parallel calls. This one is about scheduler-only metadata leaking into the payload sent to external tools.
Why this happens
At commit
a00d03efc62de08274619cf7da96569ae51ecbf3:BaseDeclarativeTool.addWaitForPreviousParameter()injectswait_for_previousinto object parameter schemas.request.args['wait_for_previous']to decide whether a tool call should wait.JSON.stringify(this.params)to the subprocess stdin without stripping reserved fields.args: this.params, andMcpClient.callTool()forwards that object as the MCPargumentspayload.Reachability
This is reachable in normal operation, not dead code:
wait_for_previouswhen sequencing dependent tool calls.wait_for_previous: true.Reproduction
additionalProperties: falseor equivalent.wait_for_previous: trueso the scheduler will sequence it.wait_for_previousin its input payload and can reject the call as an unexpected property.Expected behavior
wait_for_previousshould influence scheduler behavior only. It should not be forwarded to external tool implementations.Actual behavior
The same
argsobject is used both for scheduling and for the payload sent to discovered tools / MCP servers, so scheduler-only metadata leaks across the tool boundary.Related history
wait_for_previousbehavior causing redundant parallel calls.$schema, not runtime argument forwarding.Possible fix
Strip reserved scheduler fields before
tool.build(...), or at least before each external executor forwards params to discovered tools and MCP calls.