Using Zed Preview 1.24.2 with google/gemini-4-argon through Vercel AI Gateway’s OpenAI-compatible endpoint, routed to Vertex, requests fail with:
Unable to submit request because `read_file` functionDeclaration `parameters.start_line` schema specified other fields alongside any_of. When using any_of, it must be the only field set.Zed generates optional line-number parameters as valid JSON Schema:
{ "type": ["integer", "null"], "description": "Optional starting line", "format": "uint32", "minimum": 0, "default": null}We confirmed that rewriting these nullable type arrays into explicit unions resolves the issue against the same model and Vertex route:
{ "anyOf": [{"type": "integer"}, {"type": "null"}], "description": "Optional starting line", "format": "uint32", "minimum": 0, "default": null}This appears consistent with Vercel’s legacy Google schema converter, which transforms the original type array into:
{ "anyOf": [{"type": "integer"}], "nullable": true, "description": "Optional starting line", "format": "uint32"}Vertex rejects the sibling fields alongside anyOf.
An equivalent minimal request for reproduction is:
curl -i https://ai-gateway.vercel.sh/v1/chat/completions \ -H "Authorization: Bearer $AI_GATEWAY_API_KEY" \ -H 'Content-Type: application/json' \ --data-binary @- <<'JSON'{ "model": "google/gemini-4-argon", "messages": [{"role": "user", "content": "Reply OK."}], "max_completion_tokens": 128, "tool_choice": "none", "tools": [{ "type": "function", "function": { "name": "read_file", "description": "Read a file", "parameters": { "type": "object", "properties": { "path": {"type": "string"}, "start_line": { "type": ["integer", "null"], "description": "Optional starting line", "format": "uint32", "minimum": 0, "default": null } }, "required": ["path"] } } }], "providerOptions": { "gateway": {"only": ["vertex"]} }}JSONThe AI SDK already addressed legacy conversion in PR #20757 by forwarding schemas through parametersJsonSchema.
Could you check whether that fix also applies to the hosted Gateway’s OpenAI-compatible path? Valid nullable type arrays should work without callers having to rewrite their tool schemas.