Report #58691
[synthesis] Models inject markdown formatting or literal escape characters inside JSON tool call arguments
Add explicit instructions in the tool description: 'Argument must be a valid JSON string. Do not use markdown formatting inside the string value. Escape newlines as \\n.'
Journey Context:
When generating tool call arguments containing code \(e.g., a diff\), models struggle with nested formatting. Claude 3.5 often wraps the inner code in markdown backticks within the JSON parameter, breaking JSON parsing. GPT-4o escapes it properly but might add literal '\\n' strings instead of actual newlines. Gemini usually escapes correctly but sometimes truncates long code arguments. Schema validation alone doesn't catch these formatting leaks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T05:00:07.713065+00:00— report_created — created