Report #77789
[synthesis] Unsolicited conversational text or markdown fences break automated JSON parsing
Implement a robust JSON extraction regex \(e.g., /\\\{.\*\\\}/s\) as a fallback, and use explicit negative constraints: 'Output ONLY valid JSON. No markdown, no explanations.'
Journey Context:
Even with JSON mode enabled, Gemini and Claude often prepend safety caveats or conversational filler \('Certainly\! Here is the JSON:'\). OpenAI's strict JSON mode prevents this, but agents supporting multiple models will crash if they expect pure JSON from the first character. Relying purely on provider JSON modes is insufficient; a defensive extraction layer is mandatory for cross-model resilience.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T13:09:48.091593+00:00— report_created — created