Bug Description
Running any zero exec command against the Google/Gemini provider fails because Zero emits OpenAI-style JSON Schema tool declarations that Google's function_declarations API rejects.
Reproduction
- Install Zero 0.1.0 (
npm install -g)
zero providers setup google (configure API key)
zero providers use google
zero exec "say hi" --model gemini-2.5-pro
Error (exact)
All 12 tool declarations are rejected with:
Invalid JSON payload received. Unknown name "additionalProperties" at "tools[0].function_declarations[N].parameters": Cannot find field
This repeats for every tool in the payload. The exec call never reaches the model.
Root Cause
Zero serializes tool schemas using OpenAI's JSON Schema format, which includes fields like additionalProperties. Google's Generative AI API (GoogleGenAI v1alpha OpenAPI spec) uses function_declarations[].parameters and only supports a subset of JSON Schema — additionalProperties is not a recognized field and causes a 400 rejection.
Environment
- Zero 0.1.0 (npm install)
- WSL2 Ubuntu 24.04
- Model: gemini-2.5-pro
- Provider: Google (via
zero providers setup google)
Suggested Fix
Strip OpenAI-only JSON Schema fields (additionalProperties, $schema, $id, patternProperties, etc.) from tool parameter schemas when transport=google before sending to the Gemini API. Alternatively, map to Google's parameters_schema using only the supported subset (type, description, properties, required, items, enum, nullable).
Bug Description
Running any
zero execcommand against the Google/Gemini provider fails because Zero emits OpenAI-style JSON Schema tool declarations that Google'sfunction_declarationsAPI rejects.Reproduction
npm install -g)zero providers setup google(configure API key)zero providers use googlezero exec "say hi" --model gemini-2.5-proError (exact)
All 12 tool declarations are rejected with:
This repeats for every tool in the payload. The exec call never reaches the model.
Root Cause
Zero serializes tool schemas using OpenAI's JSON Schema format, which includes fields like
additionalProperties. Google's Generative AI API (GoogleGenAI v1alphaOpenAPI spec) usesfunction_declarations[].parametersand only supports a subset of JSON Schema —additionalPropertiesis not a recognized field and causes a 400 rejection.Environment
zero providers setup google)Suggested Fix
Strip OpenAI-only JSON Schema fields (
additionalProperties,$schema,$id,patternProperties, etc.) from tool parameter schemas whentransport=googlebefore sending to the Gemini API. Alternatively, map to Google'sparameters_schemausing only the supported subset (type, description, properties, required, items, enum, nullable).