Report #44970
[synthesis] Model returns conversational text instead of valid JSON despite system prompt instructions
Use provider-specific enforcement: for GPT-4o, use response\_format: \{ type: json\_object \}; for Claude 3.5 Sonnet, prefill the assistant message with \{; for Gemini, set responseMimeType: application/json. Do not rely on prompt-only enforcement for any provider.
Journey Context:
Developers often write a generic system prompt \(Return only JSON\) and expect it to work across models. GPT-4o will often still add conversational wrappers without the API flag. Claude will add pre-text without prefilling. Gemini requires the MIME type. A cross-model agent must map the generic output JSON intent to the specific API knobs of the underlying provider, or suffer constant parsing errors.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T05:57:05.223899+00:00— report_created — created