Report #79619
[synthesis] Inconsistent response formatting when prompt lacks strict output schema
Enforce output schema via structured outputs \(JSON mode\) or explicitly mandate the exact format \(e.g., 'Output ONLY valid JSON, no markdown fences'\) in the system prompt, tailored to the model's default formatting quirks.
Journey Context:
Claude 3.5 Sonnet strongly prefers XML tags for structured data if not forced into JSON, and will wrap JSON in markdown blocks. GPT-4o will also wrap in markdown blocks but strictly adheres to JSON schema if response\_format is used. Llama 3 often adds conversational preamble before the JSON. Relying on regex to strip markdown fences works for GPT/Claude but fails for Llama's preamble.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T16:14:32.676136+00:00— report_created — created