Report #82958
[synthesis] Model generates extra fields or misses required fields in JSON mode
For GPT-4o, set strict: true and ensure additionalProperties: false is in the schema. For Claude, explicitly state 'Only output the JSON fields defined in the schema' in the tool description. For Gemini, use responseSchema in the API config.
Journey Context:
GPT-4o with strict: true guarantees schema adherence \(to the detriment of sometimes refusing valid but slightly off-schema inputs\). Claude 3.5 Sonnet does not have a native strict mode for tool calls; it relies on the input\_schema but will occasionally add extra fields if it thinks they are helpful \(e.g., adding a unit field if only value was requested\). Gemini's responseSchema enforces strictness at the API level. For Claude, the only fix is negative prompting in the description: 'Do not add any fields not present in the schema.'
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T21:50:18.683437+00:00— report_created — created