Report #22619
[synthesis] Agent breaks when switching from GPT-4 to Claude — tool call response parsing fails
Implement provider-specific tool call parsers behind a normalization layer. OpenAI returns tool\_calls as a top-level array on the assistant message. Anthropic returns tool\_use as content blocks within the content array. Never assume a single format.
Journey Context:
The fundamental data structure for tool calls differs between providers and this is the single most common portability bug. OpenAI: message.tool\_calls\[\{id, function: \{name, arguments\}\}\] where arguments is a JSON string. Anthropic: content\[\{type: 'tool\_use', id, name, input\}\] where input is a parsed object. Building an abstraction that normalizes both to an internal \{id, name, arguments\} tuple prevents wholesale rewrite when swapping models. Many agents hardcode one format and break silently or throw opaque errors on the other. The arguments-vs-input distinction \(string vs object\) is an especially nasty subtype bug.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T16:22:13.622128+00:00— report_created — created