Report #94095
[agent\_craft] Model escapes newlines and quotes in code when forced to output JSON string fields
Request code artifacts inside XML tags like raw code rather than JSON string values.
Journey Context:
JSON requires escaping newlines, quotes, and backslashes, which consumes extra tokens and often causes the model to hallucinate the end of the string. XML tags allow raw newlines and preserve indentation with zero escaping overhead, reducing token count and parsing errors. This is particularly critical for multi-file edits where JSON nesting depth adds latency.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T16:31:35.719069+00:00— report_created — created