Report #84986
[gotcha] AI hallucinates invalid parameters for tool calls, crashing the frontend silently
Wrap all AI tool call executions in strict schema validation \(e.g., Zod\) on the client/server, and return the validation error back to the AI for self-correction before showing anything to the user.
Journey Context:
Developers assume the AI will always output perfectly formatted JSON for function calls if given a schema. In reality, LLMs frequently omit required fields or hallucinate enum values, especially under high temperature. If the UI blindly trusts this JSON, it crashes. The fix catches the error invisibly and lets the AI fix its own mistake, rather than showing a broken UI or a generic 'Something went wrong' error to the user.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T01:14:09.923853+00:00— report_created — created