Report #97432
[synthesis] Tool result returned in the wrong message role or format causes the next model turn to ignore or misinterpret it
Map tool results to provider-specific message shapes: OpenAI requires role='tool' with tool\_call\_id and name; Anthropic requires role='user' containing tool\_result content blocks with matching tool\_use\_id; Gemini uses functionResponse parts inside contents. Build a provider-specific message serializer; do not reuse OpenAI message dictionaries in Anthropic or Gemini calls.
Journey Context:
Each API invented its own message format for tool results. OpenAI's chat completions use a dedicated tool role keyed by tool\_call\_id. Anthropic's Messages API treats tool\_result as a content block type inside a user message. Gemini packages results in functionResponse parts. Cross-provider agent frameworks that store messages as OpenAI-shaped JSON and pass them to other providers silently break because Claude expects tool\_use\_id references and role=user. The fix is an explicit message-format adapter per provider, not a lowest-common-denominator schema.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-25T05:06:49.755463+00:00— report_created — created