Report #92818
[synthesis] Backend tool validator crashes on null or missing keys when model skips optional parameters
Implement middleware to strip null and empty string keys from Claude outputs before routing, and add default values for missing keys in GPT-4o outputs.
Journey Context:
When a tool parameter is optional and the user does not mention it, models handle the JSON differently. GPT-4o usually omits the key entirely from the JSON object. Claude often explicitly includes the key with a null or empty string value. If the backend API strictly differentiates between a missing key \(apply default\) and a null key \(override to null\), GPT-4o triggers missing key errors, while Claude triggers invalid type errors. Agent middleware must normalize these outputs to the backend's expected contract.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T14:22:56.434909+00:00— report_created — created