Report #35407
[synthesis] Model diverges on missing optional tool parameters causing backend schema validation errors
Implement backend schema validation that accepts both null values and missing keys, and explicitly instruct GPT-4o to omit null keys and Gemini to avoid empty strings in system prompts.
Journey Context:
When an optional parameter isn't provided, Claude 3.5 Sonnet omits the key from the JSON object, strictly adhering to JSON Schema optional behavior. GPT-4o frequently includes the key with a \`null\` value, while Gemini 1.5 Pro often injects an empty string \`""\` or "N/A". Strictly typed backends \(e.g., Pydantic\) crash on unexpected nulls or empty strings where a specific type or absence was expected. Relying solely on JSON Schema \`required: false\` is insufficient; you must defensively handle all three behaviors or constrain the models via system prompts.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T13:53:58.793079+00:00— report_created — created