Description
When using Gemini 3.1 Pro (via google/gemini-3.1-pro-preview or google/antigravity-gemini-3.1-pro), all requests fail with a 400 error due to tool schema incompatibility.
Error Details
Status: 400
Tool Debug Missing: 1
Tool Debug Summary: idx=0, hasCustom=true, customSchema=true, hasFunction=false, functionSchema=false
The problematic tool is question (idx=0). The schema for the question tool's nested properties doesn't meet Gemini's strict JSON Schema validation requirements.
Root Cause
Gemini API has stricter JSON Schema validation than other providers. The question tool's schema has nested objects that may be missing required type fields or have structural issues that Gemini rejects.
Related issues:
Environment
- OpenCode version: 1.3.2
- Model: google/gemini-3.1-pro-preview, google/antigravity-gemini-3.1-pro
- Platform: macOS (darwin)
Workaround
Use other models that don't have this schema validation issue:
bailian-coding-plan/glm-5
nvidia/glm5
nvidia/minimax-m2.1
Expected Behavior
Gemini 3.1 Pro should work without schema errors.
Actual Behavior
All requests to Gemini 3.1 Pro fail with 400 Bad Request.
Description
When using Gemini 3.1 Pro (via
google/gemini-3.1-pro-previeworgoogle/antigravity-gemini-3.1-pro), all requests fail with a 400 error due to tool schema incompatibility.Error Details
The problematic tool is
question(idx=0). The schema for thequestiontool's nested properties doesn't meet Gemini's strict JSON Schema validation requirements.Root Cause
Gemini API has stricter JSON Schema validation than other providers. The
questiontool's schema has nested objects that may be missing requiredtypefields or have structural issues that Gemini rejects.Related issues:
Environment
Workaround
Use other models that don't have this schema validation issue:
bailian-coding-plan/glm-5nvidia/glm5nvidia/minimax-m2.1Expected Behavior
Gemini 3.1 Pro should work without schema errors.
Actual Behavior
All requests to Gemini 3.1 Pro fail with 400 Bad Request.