Skip to content

Gemini 3 models fail with "Invalid JSON payload received. Unknown name 'parameters'" error #8857

Closed as not planned

Description

@lvsao

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:

  1. Proper type: "object" (lowercase)
  2. No _placeholder parameters
  3. No unsupported JSON Schema fields like $schema
  4. 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

Reproduction Steps

  1. Install opencode-antigravity-auth@beta plugin
  2. Configure google/antigravity-gemini-3-flash model
  3. Run: opencode run "Hello" --model=google/antigravity-gemini-3-flash
  4. 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:

  1. Remove $schema field from tool parameter schemas
  2. Convert non-string enum values to strings
  3. Ensure type field uses lowercase values
  4. Remove placeholder parameters like _placeholder
  5. Validate schema against Gemini's expected format

See OpenCode PR #4538 for previous attempts at fixing similar issues.

Activity

  1. github-actions commented on Jan 16, 2026

    @github-actions
    Contributor

    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.

  2. rekram1-node commented on Jan 16, 2026

    @rekram1-node
    Contributor

    believe this is a bug in ur plugin

  3. noises1990 commented on Jan 16, 2026

    @noises1990

    I'm encountering the same issue

    Using with github-copilot vendor:
    Image

    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

  4. chindris-mihai-alexandru commented on Jan 18, 2026

    @chindris-mihai-alexandru

    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:

    • Tool parameters ("Unknown name 'parameters'")
    • Thinking model parameters ("Unknown name 'thinking'")

    Workaround that works:

    • Non-thinking Antigravity models: google/antigravity-claude-sonnet-4-5
    • OpenRouter free models: openrouter/xiaomi/mimo-v2-flash:free

    The issue seems to be recent - these were working before. Likely a change in Google's Antigravity API endpoint compatibility.

  5. rekram1-node commented on Jan 18, 2026

    @rekram1-node
    Contributor

    If you are dealing w/ antigravity issues please open issue in antigravity plugin repo, we don't support them first class

  6. rekram1-node commented on Jan 18, 2026

    @rekram1-node
    Contributor

    @noises1990 your issue is separate and related to copilot, believe it has been fixed tho (talked w/ copilot team)

  7. chindris-mihai-alexandru commented on Jan 19, 2026

    @chindris-mihai-alexandru

    @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:

    1. 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.

    2. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions