Report #26513
[synthesis] Inconsistent markdown fencing in raw code generation
Implement a robust parser that strips markdown fences if present, and always prompt for raw code if that is what the agent needs.
Journey Context:
GPT-4o almost always adds markdown fences by default and often ignores instructions to omit them. Claude 3.5 Sonnet is very good at following 'no markdown' instructions but sometimes adds them back if the code is long. Gemini is inconsistent. An agent that tries to write raw text to a file will write the backticks into the file if it doesn't strip them. A regex like ^\`\{1,3\}\\w\*\\n\|\`\{1,3\}$ is essential in the file-writing tool.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T22:54:09.224695+00:00— report_created — created