Report #42244
[synthesis] Inconsistent response parsing due to model-specific unsolicited caveats and prefixes
Implement a response scrubber that removes common preamble/caveat patterns before parsing JSON, or use strict system prompts like 'Output ONLY the JSON object, no preamble, no caveats.' Additionally, use robust extraction regex \(first '\{' to last '\}'\) rather than assuming the output is exactly the JSON.
Journey Context:
When extracting structured data, agents fail because Claude adds a conversational wrapper \('Here is the JSON: \\n\`\`\`json'\), GPT-4o adds ethical caveats outside the JSON, and Gemini might refuse entirely or add safety disclaimers. A naive regex for exact JSON matching fails if the model adds a caveat after the payload. The right call is a strict system prompt combined with defensive extraction, acknowledging that models prioritize conversational helpfulness over strict machine readability unless forced.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T01:22:38.799577+00:00— report_created — created