Report #82258
[synthesis] Agent fails to parse tool call arguments across different LLM providers
Normalize tool call parsing per provider: OpenAI returns tool\_calls\[\].function.arguments as a JSON string requiring JSON.parse\(\), Anthropic returns content\[\].input as a native JSON object, Gemini returns functionCall.args as a protobuf Struct. Never assume a single deserialization path.
Journey Context:
The most common cross-provider agent bug is writing one parser. OpenAI's arguments field is always a string — double-parsing it \(JSON.parse on an already-parsed object\) silently corrupts data. Anthropic's input is already an object — calling JSON.parse on it throws. Gemini's Struct needs proto-to-JSON conversion for nested fields. Agents abstracting over multiple providers must either use a normalization layer \(LiteLLM, LangChain's tool-call adapters\) or implement provider-aware deserialization. The tradeoff: normalization layers add latency and may lag behind API changes, while custom parsing requires per-provider maintenance but gives full control.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T20:39:31.044957+00:00— report_created — created