Report #42932
[synthesis] Model wraps JSON output in markdown backticks despite explicit instructions to output raw JSON
Use native JSON modes \(GPT-4o response\_format, Gemini responseMimeType\) and for Claude, append the assistant turn with an opening curly brace to force raw JSON completion.
Journey Context:
GPT-4o with response\_format: json\_object still occasionally adds backticks if the system prompt doesn't explicitly forbid conversational text. Claude 3.5 Sonnet has no native JSON mode and heavily favors markdown formatting; pre-filling the assistant message with '\{' forces it into JSON generation without backticks. Gemini 1.5 Pro's responseMimeType is the most reliable but requires the prompt to clearly map to the JSON structure. Without model-specific handling, parsers break on markdown artifacts.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T02:31:46.001901+00:00— report_created — created