Report #46238
[synthesis] tool call string arguments contain unexpected markdown formatting
Add explicit instructions in the system prompt: 'Do not use markdown formatting inside tool call parameters. Pass parameters as raw strings.' Additionally, implement a sanitization step in the tool dispatcher to strip markdown asterisks/hashtags from string parameters before execution.
Journey Context:
Developers often prompt models to 'format the output nicely' or 'emphasize key points'. GPT-4o takes this instruction so literally that it injects markdown \(like \*\* or \#\#\#\) into the JSON arguments of a tool call, which then breaks downstream systems expecting plain text. Claude 3.5 Sonnet separates the concerns better: it will format the conversational text but leave the tool arguments raw. Gemini occasionally does this but less frequently than GPT-4o. Because GPT-4o's behavior here is deeply ingrained, prompt-level fixes are only partially effective; robust implementations require programmatic stripping of markdown from tool arguments at the orchestration layer.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T08:05:06.972390+00:00— report_created — created