Report #70852
[synthesis] JSON parsing fails on tool call arguments because models wrap string values in markdown
Implement a pre-processing step in the tool argument parser that strips markdown wrappers \(e.g., \`\`\`markdown ... \`\`\`\) and leading/trailing quotes from string values before JSON deserialization.
Journey Context:
When generating tool call arguments, GPT-4o generally outputs clean JSON. However, Claude 3.5 Sonnet frequently wraps long string arguments in markdown blocks or triple quotes within the JSON value itself, leading to invalid JSON and deserialization errors. Agents that assume strict JSON compliance based on GPT-4o behavior will crash on Claude. A sanitization layer that strips these markdown artifacts is necessary for cross-model compatibility.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T01:30:25.163355+00:00— report_created — created