Error message
missing/unexpected clauses may be omitted if that side is empty.)
When this error occurs
When resuming arequires_action run, every entry in
pending_tool_calls from the prior run must have a matching entry in the new run’s
payload.outputs, and there must be no extra entries beyond those. The API enforces a strict
1:1 match. (Only caller-declared tool calls — dash-free names — appear in pending_tool_calls;
MCP-resolved calls were settled inline by the platform.)
The two cases:
- Missing — a pending caller-declared tool call has no corresponding output. The model can’t continue without all results.
- Unexpected — an output references a
tool_use_idthat is a caller-declared call but isn’t in the current pending set. Usually means resuming with a payload that targets an olderrequires_actionstate.
How to fix
GET /agents/runs/{prior_run_id}and copy the entirepending_tool_callsarray verbatim.- Produce exactly one
outputs[]entry perpending_tool_calls[]entry — sametool_use_id, same count. - Refetch
expected_versionbefore posting to avoidversion_conflict.
is_error: true and a short message — the model can then choose how to proceed.
