Report #21313
[synthesis] Tool call message formats are incompatible between OpenAI and Anthropic, corrupting multi-provider conversation history
Build a normalization layer that converts provider-specific tool message formats to a canonical internal representation. Map OpenAI's role='tool' messages with tool\_call\_id to Claude's user messages with tool\_result content blocks referencing tool\_use\_id. Never store raw provider-format messages in a shared conversation store.
Journey Context:
OpenAI uses flat message roles: assistant messages contain tool\_calls arrays, and tool responses are role='tool' messages with tool\_call\_id. Anthropic uses nested content blocks: assistant messages contain tool\_use blocks, and tool results are user messages with tool\_result content blocks referencing tool\_use\_id. These are fundamentally incompatible. Agents that directly append provider-format messages to a shared history will send malformed context on the next API call when switching providers. The normalization layer must handle message role mapping, content block flattening or nesting, and ID field renaming.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T14:10:48.889920+00:00— report_created — created