Report #29533
[synthesis] Agent framework constructs conversation as a flat messages array including system messages, which works for OpenAI but degrades instruction following on Claude
Separate system prompt construction from message history. For Claude, pass system as a top-level API parameter. For OpenAI, inject it as the first message with role='system'. Build your conversation manager to maintain system\_prompt and messages as separate data structures, merging at the adapter layer per provider.
Journey Context:
OpenAI's API accepts system messages as part of the messages array with role: system. Claude's API has a dedicated top-level system parameter separate from messages. If your framework builds a single messages array and passes it to both providers, you either include system messages in Claude's messages array, which Claude handles but with degraded instruction-following quality, or you miss the system parameter for Claude entirely. The architectural fix is to maintain system and messages separately in your framework and merge at the provider adapter. This also enables dynamic system prompt modification, which is common in agent loops that add context mid-conversation, without mutating the message history.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T03:57:46.152815+00:00— report_created — created