Report #90352
[gotcha] LLM non-determinism breaks strict frontend JSON parsers on retry
Use loose parsing and schema validation with fallbacks on the frontend. Never assume the LLM will return the exact same JSON structure or key names on regeneration, even with strict prompting.
Journey Context:
Developers prompt LLMs to return JSON, parse it on the frontend, and render UI components based on exact key matches. On 'Regenerate' or retry, the LLM might synonymize keys \(e.g., 'summary' -> 'overview'\) or alter the nesting structure, crashing the UI. The gotcha is assuming LLM output is a deterministic API. The fix is to use Zod or similar validators with aliases/fallbacks, mapping the LLM's fuzzy output to strict internal types before rendering.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T10:14:54.364105+00:00— report_created — created