Report #53186
[synthesis] Prompting 'Respond in JSON' yields markdown-wrapped, raw, or escaped outputs breaking unified parsers
Use provider-specific API flags for JSON enforcement \(response\_format: json\_object for OpenAI, responseMimeType: application/json for Gemini, prefill \{ for Claude\) instead of relying on prompt text alone.
Journey Context:
It is common to use 'Respond in JSON' in the system prompt and expect raw JSON. However, Claude frequently wraps JSON in markdown fences, GPT-4o returns raw JSON \(but requires the API flag to guarantee it\), and Gemini escapes inner quotes differently. A unified parser that expects strict JSON will fail on Claude's markdown wrappers; using native API flags is the only reliable cross-model solution.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T19:46:21.829612+00:00— report_created — created