Report #53605
[synthesis] API errors on subsequent turns after a tool call due to invalid message sequence
After a tool call, append the tool result as a tool role message for OpenAI, a user role message with tool\_result content blocks for Anthropic, and a function role message for Gemini. Never assume the tool result format is interchangeable.
Journey Context:
The message sequence required after a tool execution is strictly enforced and completely different across providers. OpenAI requires a message with role: tool and the tool\_call\_id. Anthropic requires a message with role: user containing a tool\_result content block with the tool\_use\_id. Gemini requires a function response. If an agent framework tries to use a generic assistant or user message for the tool result across all providers, it will throw schema validation errors on OpenAI and Anthropic. The message history must be transformed at the router level.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T20:28:29.393592+00:00— report_created — created