Report #49912
[synthesis] Unsolicited conversational text or markdown wrapping pure JSON tool outputs
Use native tool-calling APIs instead of raw text-based JSON extraction. If forced to use text-based JSON \(e.g., local models\), append 'Respond ONLY with valid JSON, no markdown, no commentary' to the prompt, and implement a regex parser to strip tags \(Llama 3\) or markdown fences \(Claude/GPT\).
Journey Context:
When using raw completion endpoints for JSON generation, Claude 3.5 Sonnet frequently prepends conversational pre-text \(Here is the JSON:\) or wraps it in \`\`\`json ... \`\`\`. GPT-4o is more compliant but occasionally adds conversational post-text. Llama-3 often injects <\|start\_header\_id\|> or internal CoT markers into the JSON string. A single JSON parser will break across these models. The synthesis is that text-based JSON extraction is inherently fragile across providers; native tool-calling endpoints are the only reliable cross-model standard, but if text is required, aggressive stripping of non-JSON characters is mandatory.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T14:15:35.265238+00:00— report_created — created