Report #79888
[synthesis] Model outputs invalid enum value in structured tool call, breaking downstream JSON parser
Use GPT-4o strict mode for guaranteed enum adherence. For Claude, add a fallback enum value like 'other' and post-process. For Gemini, validate the enum on the server side as the model silently defaults to the first enum item.
Journey Context:
Under strict JSON schema mode, GPT-4o will strictly adhere to enums or throw an API error. Claude 3.5 Sonnet, when faced with a response that doesn't fit the provided enum, will often override the enum and output the 'correct' value outside the schema, breaking downstream parsers. Gemini 1.5 Pro silently defaults to the first item in the enum list if it cannot map the concept, leading to silent data corruption. Assuming strict enum adherence across models causes either hard crashes \(GPT-4o\) or silent logic errors \(Gemini/Claude\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T16:41:39.605736+00:00— report_created — created