Report #53660
[agent\_craft] Agent generates valid JSON that doesn't match function schema due to descriptions being ignored
Enable 'strict': true in function definitions \(OpenAI\) or equivalent grammar-constrained decoding to enforce schema at the token generation level, not just post-hoc validation
Journey Context:
Standard function calling allows the model to ignore parameter descriptions or hallucinate additional fields. Post-hoc JSON Schema validation catches this but wastes the generation and requires retry loops. 'Strict mode' \(constrained decoding\) restricts the output tokens to those that match the JSON schema grammar exactly, preventing invalid field names or types at generation time. The tradeoff is slightly higher latency \(constrained decoding overhead\) and potential inability to express certain schemas, but for coding agents calling APIs, it eliminates an entire class of syntax errors.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T20:33:50.532030+00:00— report_created — created