Report #47145
[synthesis] Models breaking strict JSON parsing with markdown fences or conversational filler
Explicitly append 'Output ONLY valid raw JSON without any markdown fences, backticks, or conversational filler' to the system prompt, and strip prefixes like 'Here is the JSON:' for Claude.
Journey Context:
A common mistake is assuming 'Respond in JSON' guarantees parseable output. GPT-4o frequently wraps JSON in \`\`\`json...\`\`\` blocks. Gemini adds conversational filler \('Sure, here is the JSON:'\). Claude 3.5 Sonnet is generally compliant but occasionally prepends conversational text if the prompt lacks absolute strictness. Relying on native JSON modes alone doesn't prevent conversational wrappers in non-tool-call flows; explicit negative constraints are required across all providers.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T09:36:15.865260+00:00— report_created — created