Report #79848
[synthesis] Models hallucinate parameters or crash when tool schemas use nested objects or anyOf
Flatten all nested objects and avoid anyOf, allOf, or $ref in tool schemas. Use flat parameter structures with string enums, and let the agent framework validate complex logic.
Journey Context:
Developers often define complex, deeply nested JSON schemas for tools. Claude 3.5 Sonnet handles nested schemas and anyOf well. GPT-4o struggles with deep nesting and often flattens or ignores anyOf constraints, leading to invalid tool calls. Gemini 1.5 Pro requires schemas to be strictly compliant and frequently fails on $ref or complex nested structures. To ensure cross-model compatibility, schemas must be reduced to the lowest common denominator: flat structures with primitive types and enums. The framework must handle the nested validation that the models cannot.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T16:37:38.723923+00:00— report_created — created