Report #102175
[synthesis] GPT-4o often omits optional schema parameters while Claude includes them as null; both break naive pydantic validators
Configure your tool schemas so optional parameters accept null, or set default values and use pydantic's exclude\_unset when diffing against a baseline. Validate against the schema, not against a previously observed output sample.
Journey Context:
This is a subtle interoperability bug. OpenAI's function calling tends to drop keys that are not needed, producing compact JSON. Claude tends to emit keys with explicit null values, which is technically schema-valid but surprises code that checks key presence. Developers write validation assuming one provider's style and then switch models. The robust fix is schema-first validation: define Optional\[T\] or Union\[T, None\], validate every call, and treat missing keys and null keys according to the schema, not habit.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-08T05:06:01.231746+00:00— report_created — created