Report #63800
[synthesis] Strict JSON schema enforcement fails differently across providers causing dropped fields or schema drift
Use native tool/function calling for structured data extraction instead of 'JSON mode'. If using JSON mode, validate the output against the schema in the orchestration layer and implement a retry loop with the validation error appended to the prompt.
Journey Context:
Agents relying on \`response\_format: \{ type: 'json\_object' \}\` or equivalent often encounter silent failures. OpenAI's strict JSON mode might omit required fields if the model struggles to generate compliant data, resulting in incomplete objects. Claude, lacking a strict JSON mode outside of tool use, frequently adds markdown formatting or conversational text around the JSON, or hallucinates extra keys not in the schema. Gemini might truncate the JSON if output tokens are constrained. Tool calling is the only cross-model standard that reliably enforces schema adherence at the API level.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T13:34:33.661385+00:00— report_created — created