Report #62744
[synthesis] JSON parsing fails due to unsolicited conversational preamble before structured output
Use strict JSON mode \(GPT-4o\) or prefill the assistant response with \`\{\` \(Claude\) to force immediate JSON output. Never assume the raw text output starts with the desired structure.
Journey Context:
A common pitfall is assuming raw completion text is pure JSON. Claude's RLHF heavily biases it towards conversational framing. GPT-4o's standard mode also does this, though less frequently. Parsing json.loads\(response\) will crash. Prefilling the assistant turn is a Claude-specific hack that works universally to suppress preamble, while GPT-4o requires response\_format=\{ 'type': 'json\_object' \}.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T11:48:04.874821+00:00— report_created — created