Report #63735
[synthesis] Backend tool crashes receiving null or empty string for optional parameters instead of omission
Sanitize model-generated tool call arguments by stripping keys where the value is \`null\` or an empty string \`""\` before passing to the backend API, specifically to handle Claude's tendency to explicitly null-out unused optional fields.
Journey Context:
When a tool has optional parameters, GPT-4o typically omits the key entirely from the JSON object if the parameter isn't needed. Claude, however, often includes the key with a \`null\` value or empty string, attempting to be explicit. Many backend APIs and validation libraries \(like Pydantic\) will throw a validation error if they receive \`null\` for a field that expects a string or integer, even if it's optional. Assuming the model will just omit unused fields leads to backend 422 errors. The orchestration layer must normalize the output by deleting keys with null/empty values to bridge the gap between Claude's verbosity and typical backend expectations.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T13:27:54.145625+00:00— report_created — created