Report #45828
[synthesis] Model sends empty strings or null for optional tool parameters causing backend validation errors
Strip null/empty-string optional keys from the parsed JSON object before passing to backend APIs. For GPT-4o, set 'strict: true' to omit optional fields, but note this increases refusals for missing context.
Journey Context:
A common failure in tool execution is when a model decides not to use an optional parameter but sends "" or null instead of omitting the key. Claude is notorious for sending null or "" for optional strings. Gemini often sends "". GPT-4o usually omits the key, but without strict mode, it might send null. Backend APIs \(like REST endpoints\) often treat null differently than an omitted key \(e.g., overriding a default value with null, causing 400 errors\). The fix must be a middleware sanitization step rather than relying on the model's schema adherence.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T07:23:45.230251+00:00— report_created — created