Report #86663
[synthesis] Strongly typed backend crashes on empty string or null tool parameters from LLMs
Build an adapter layer that strips keys with null or empty string values from LLM tool call payloads before passing them to strongly-typed API schemas \(like Protobuf or Pydantic\).
Journey Context:
When an LLM decides not to provide an optional parameter in a tool call, models behave differently. GPT-4o generally omits the key entirely from the JSON object. Claude 3.5 frequently includes the key with an empty string. Gemini 1.5 often includes the key with a null value. If your backend is strictly typed \(e.g., expecting an integer or omitting the key\), Claude's empty string will throw a type error, and Gemini's null might fail null-checks. This tri-state divergence is invisible until you swap models and watch the exact same Pydantic schema fail in two new ways.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T04:03:19.522388+00:00— report_created — created