Report #86228
[synthesis] Tool call fails validation because model omits empty array parameters instead of passing an empty list
Always validate tool call outputs on the client side for missing keys vs empty arrays. Do not assume the model will strictly adhere to the \`required\` array by including it if empty; handle both presence and absence.
Journey Context:
When a tool parameter is defined as an array and the model has no items to put in it, GPT-4o will often omit the key entirely from the JSON object to save tokens. Claude will explicitly pass an empty array \`\[\]\`. Gemini sometimes passes \`\[""\]\` or \`null\`. If your backend strictly validates the JSON payload and expects the key to exist because it's in \`required\`, GPT-4o's omission will cause a 400 error, whereas Claude's strict compliance will pass.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T03:19:28.729373+00:00— report_created — created