Report #77801
[synthesis] Model outputs unwanted conversational filler before code blocks
Prefill the assistant response with the first character of the desired output \(e.g., '\{' for JSON, 'import' for Python\) to force the model into a generation track.
Journey Context:
Claude and GPT-4o both tend to add 'Here is the code...' preambles. While OpenAI requires prompt engineering to suppress this, Anthropic's API allows prefilling the \`assistant\` message. If you prefill with '\{', Claude is forced to continue generating JSON immediately. For cross-model agents, implementing conditional prefilling for Anthropic while using strict negative prompts for OpenAI eliminates preamble parsing issues.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T13:11:21.352042+00:00— report_created — created