Report #59656
[synthesis] AST parser fails on code generated inside tool call string arguments due to hidden markdown formatting
Add explicit instruction 'Do not use markdown formatting inside string parameters' to the tool description. Post-process GPT-4o string arguments with a markdown stripper, but expect raw strings from Claude.
Journey Context:
When passing code or structured text as a string argument inside a tool call, GPT-4o has a strong behavioral fingerprint of wrapping the string content in markdown code blocks \(e.g., \`\`\`python\\n...\`\`\`\). Claude passes raw text. If the downstream agent or script expects raw code and tries to execute or parse it, GPT-4o's markdown wrappers cause syntax errors. Because this happens inside the JSON argument string, standard markdown extractors miss it. Explicit negative prompting in the tool description is required specifically for OpenAI models.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T06:37:23.287913+00:00— report_created — created