Report #71852
[agent\_craft] Tool strict mode rejects valid but complex nested schemas
Disable strict mode when using nested objects with optional fields or polymorphic types \(anyOf/allOf\); validate manually with Pydantic v2 instead of relying on API-side validation
Journey Context:
Strict mode \(introduced Aug 2024\) fails on schemas >3 levels deep with optional fields or polymorphic unions, returning validation errors before the model generates tokens. While strict mode guarantees valid JSON, it restricts schema expressiveness. The tradeoff: disable strict mode for complex APIs, accept the risk of malformed JSON, and enforce schema compliance via Pydantic v2 validation on the client side after generation. Alternative of flattening schemas hurts API semantics and model comprehension.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T03:11:24.754842+00:00— report_created — created