Repository navigation
Gemini 3 models fail with "Invalid JSON payload received. Unknown name 'parameters'" error #8857
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Description
OpenCode GitHub Issue Report
Issue Title
Gemini 3 models fail with "Invalid JSON payload received. Unknown name 'parameters'" error when using antigravity-auth plugin
Issue Description
When using google/antigravity-gemini-3-flash or google/antigravity-gemini-3-pro models, OpenCode fails with a 400 error due to invalid tool schema format for Gemini API.
Error Message
Invalid JSON payload received. Unknown name "parameters" at 'request.tools[0]': Cannot find field.
Status: 400
Requested Model: antigravity-gemini-3-flash
Effective Model: gemini-3-flash
Endpoint: https://daily-cloudcode-pa.sandbox.googleapis.com/v1internal:streamGenerateContent?alt=sse
Tool Debug Payload (Problematic)
The tool schema being sent to Gemini contains an incorrectly formatted structure:
[{
"functionDeclarations": [...],
"parameters": {
"type": "OBJECT",
"properties": {
"_placeholder": {
"type": "BOOLEAN",
"description": "Placeholder. Always pass true."
}
},
"required": ["_placeholder"]
}
}]Expected Behavior
Tool schemas should be formatted according to Gemini API specifications, with:
- Proper
type: "object"(lowercase) - No
_placeholderparameters - No unsupported JSON Schema fields like
$schema - String-only enum values
Environment
- OpenCode Version: v1.1.23 (latest)
- Plugin: opencode-antigravity-auth@1.2.8
- OS: Windows
- Model: google/antigravity-gemini-3-flash (all variants fail)
- Project: J:\apps\max-Translator\max-ai-omni-translator
Related Issues
- OpenCode AI_APICallError: GenerateContentRequest.tools[0].function_declarations[32].parameters. required[0]: property is not defined with Gemini API #3140: "AI_APICallError: GenerateContentRequest.tools[0].function_declarations[32].parameters. required[0]: property is not defined"
- OpenCode sanitize tools for Gemini 3 compatibility #4512: "sanitize tools for Gemini 3 compatibility" (fixed in PR fix: transform MCP tool schemas for Google/Gemini compatibility #4538 but issue persists)
- OpenCode OpenCode plus Zen Gemini 3 Pro model causes errors #4665: "OpenCode plus Zen Gemini 3 Pro model causes errors"
- Qwen Code feat(provider): add groq support #1186: "API Error 400 with Gemini model: Invalid JSON payload received. Unknown name '$schema'"
Reproduction Steps
- Install opencode-antigravity-auth@beta plugin
- Configure google/antigravity-gemini-3-flash model
- Run:
opencode run "Hello" --model=google/antigravity-gemini-3-flash - Observe 400 error with "Unknown name 'parameters'" message
Workaround
Claude models (antigravity-claude-sonnet-4-5-thinking) work correctly with the same configuration.
Suggested Fix
Implement proper tool schema sanitization for Gemini API:
- Remove
$schemafield from tool parameter schemas - Convert non-string enum values to strings
- Ensure
typefield uses lowercase values - Remove placeholder parameters like
_placeholder - Validate schema against Gemini's expected format
See OpenCode PR #4538 for previous attempts at fixing similar issues.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
github-actions commentedon Jan 16, 2026
This issue might be a duplicate of existing issues. Please check:
These issues all relate to tool schema formatting problems when interfacing with Gemini API. The root cause appears to be improper sanitization of tool schemas before sending to the Gemini API (missing required fields, incorrect enum types, unsupported fields like
$schema, etc.).Feel free to ignore if your specific case differs.
rekram1-node commentedon Jan 16, 2026
believe this is a bug in ur plugin
noises1990 commentedon Jan 16, 2026
I'm encountering the same issue
Using with github-copilot vendor:

Using with google/antigravity
opencode run --model google/antigravity-gemini-3-pro-high "hi"
Error: Invalid JSON payload received. Unknown name "parameters" at 'request.tools[0]': Cannot find field.
[Debug Info]
Requested Model: antigravity-gemini-3-pro-high
Effective Model: gemini-3-pro-high
Project: ***********
Endpoint: https://daily-cloudcode-pa.sandbox.googleapis.com/v1internal:streamGenerateContent?alt=sse
Status: 400
Request ID: N/A
Tool Debug Missing: 1
Tool Debug Summary: idx=0, hasCustom=true, customSchema=true, hasFunction=false, functionSchema=false
chindris-mihai-alexandru commentedon Jan 18, 2026
I'm experiencing the same issue with thinking models. Created a related issue #9302 for the thinking model variant.
This appears to be a broader Antigravity plugin issue where Google's API is rejecting OpenCode's request format for both:
Workaround that works:
google/antigravity-claude-sonnet-4-5openrouter/xiaomi/mimo-v2-flash:freeThe issue seems to be recent - these were working before. Likely a change in Google's Antigravity API endpoint compatibility.
rekram1-node commentedon Jan 18, 2026
If you are dealing w/ antigravity issues please open issue in antigravity plugin repo, we don't support them first class
rekram1-node commentedon Jan 18, 2026
@noises1990 your issue is separate and related to copilot, believe it has been fixed tho (talked w/ copilot team)
chindris-mihai-alexandru commentedon Jan 19, 2026
@noises1990
Copilot-related: Check if you have a custom github-copilot provider in opencode.json. If so, remove it entirely. OpenCode has native Copilot integration now via /connect (https://github.blog/changelog/2026-01-16-github-copilot-now-supports-opencode/) that works out of the box. Also ensure model IDs use periods for versions: github-copilot/claude-opus-4.5 (not claude-opus-4-5).
Antigravity-related: There are two separate bugs:
Tool schema format (Unknown name "parameters") - This issue (Gemini 3 models fail with "Invalid JSON payload received. Unknown name 'parameters'" error #8857) - affects Gemini 3 models. As workaround: use Claude models via Antigravity instead.
Thinking/signature/type format (Unknown name "thinking", "signature", "type") - This affects Claude models (both thinking AND non-thinking). I've opened a separate issue for this on the Antigravity plugin repo: Claude Antigravity requests failing: Unknown name "thinking"/"signature"/"type" NoeFabris/opencode-antigravity-auth#245)
Both are upstream Antigravity plugin bugs.