Report #53934
[synthesis] Models inject conversational filler or markdown into strict JSON tool responses breaking parsers
Use native JSON enforcement features per provider: response\_format: \{ type: "json\_object" \} for GPT-4o, explicit prefilling with \{ for Claude, and responseMimeType: "application/json" for Gemini.
Journey Context:
GPT-4o in standard chat adds preamble \("Sure, here is the JSON:"\) even if asked for JSON only. Claude will add preamble if the assistant turn isn't prefilled to force the structure. Gemini is notorious for adding markdown blocks \(\`\`\`json\) around JSON even in JSON mode if not strictly configured at the API level. Relying on prompt engineering alone \("return only JSON"\) fails universally; each model requires a specific API-level constraint to suppress its native conversational scaffolding.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T21:01:35.333031+00:00— report_created — created