Model Not Found and 400 Error Troubleshooting
Your Problem
When using Antigravity models, you may encounter the following errors:
| Error Message | Typical Symptoms |
|---|---|
Model not found | Indicates model doesn't exist, cannot make requests |
Invalid JSON payload received. Unknown name "parameters" | 400 error, tool calls fail |
| MCP server call errors | Specific MCP tools unavailable |
These issues are usually related to configuration, MCP server compatibility, or plugin version.
Quick Diagnosis
Before diving deep, confirm the following:
macOS/Linux:
# Check plugin version
grep "opencode-antigravity-auth" ~/.config/opencode/opencode.json
# Check configuration file
cat ~/.config/opencode/antigravity.json | grep -E "(google|npm)"Windows:
# Check plugin version
Get-Content "$env:USERPROFILE\.config\opencode\opencode.json" | Select-String "opencode-antigravity-auth"
# Check configuration file
Get-Content "$env:USERPROFILE\.config\opencode\antigravity.json" | Select-String "google|npm"Problem 1: Model not found
Error symptom:
Model not found: antigravity-claude-sonnet-4-5Cause: OpenCode's Google provider configuration is missing the npm field.
Solution:
In your ~/.config/opencode/opencode.json, add the npm field to the google provider:
{
"provider": {
"google": {
"npm": "@ai-sdk/google",
"models": { ... }
}
}
}Verification steps:
- Edit
~/.config/opencode/opencode.json - Save the file
- Retry calling the model in OpenCode
- Check if "Model not found" error still occurs
Tip
If you're unsure about the configuration file location, run:
opencode config pathProblem 2: 400 Error - Unknown name 'parameters'
Error symptom:
Invalid JSON payload received. Unknown name "parameters" at 'request.tools[0]'What's this problem?
Gemini 3 models use strict protobuf validation, while Antigravity API requires tool definitions in a specific format:
// ❌ Incorrect format (will be rejected)
{
"tools": [
{
"name": "my_tool",
"parameters": { ... } // ← This field is not accepted
}
]
}
// ✅ Correct format
{
"tools": [
{
"functionDeclarations": [
{
"name": "my_tool",
"description": "...",
"parameters": { ... } // ← Inside functionDeclarations
}
]
}
]
}The plugin automatically converts the format, but some MCP servers return Schemas containing incompatible fields (like const, $ref, $defs), causing cleanup failures.
Solution 1: Update to latest beta version
The latest beta version includes Schema cleanup fixes:
{
"plugin": ["opencode-antigravity-auth@beta"]
}macOS/Linux:
npm install -g opencode-antigravity-auth@betaWindows:
npm install -g opencode-antigravity-auth@betaSolution 2: Disable MCP servers one by one to diagnose
Some MCP servers return Schema formats that don't meet Antigravity requirements.
Steps:
- Open
~/.config/opencode/opencode.json - Find
mcpServersconfiguration - Disable all MCP servers (comment out or delete)
- Retry calling the model
- If successful, enable MCP servers one by one, testing after each
- Once the problematic MCP server is identified, disable it or report the issue to that project's maintainer
Example configuration:
{
"mcpServers": {
// "filesystem": { ... }, ← Temporarily disabled
// "github": { ... }, ← Temporarily disabled
"brave-search": { ... } ← Test this one first
}
}Solution 3: Add npm override
If the above methods don't work, force the use of @ai-sdk/google in the google provider configuration:
{
"provider": {
"google": {
"npm": "@ai-sdk/google"
}
}
}Problem 3: MCP servers causing tool call failures
Error symptoms:
- Specific tools unavailable (e.g., WebFetch, file operations)
- Error hints at Schema-related issues
- Other tools work normally
Cause: JSON Schema returned by MCP server contains fields not supported by Antigravity API.
Incompatible Schema Characteristics
The plugin automatically cleans the following incompatible features (source src/plugin/request-helpers.ts:24-37):
| Feature | Conversion Method | Example |
|---|---|---|
const | Convert to enum | { const: "text" } → { enum: ["text"] } |
$ref | Convert to description hint | { $ref: "#/$defs/Foo" } → { type: "object", description: "See: Foo" } |
$defs / definitions | Expand into schema | References no longer used |
minLength / maxLength / pattern | Move to description | Add to description hint |
additionalProperties | Move to description | Add to description hint |
However, if Schema structure is too complex (like multi-level nested anyOf/oneOf), cleanup may fail.
Diagnosis Process
# Enable debug logs
export OPENCODE_ANTIGRAVITY_DEBUG=1 # macOS/Linux
$env:OPENCODE_ANTIGRAVITY_DEBUG=1 # Windows PowerShell
# Restart OpenCode
# View Schema conversion errors in logs
tail -f ~/.config/opencode/antigravity-logs/*.logKeywords to look for in logs:
cleanJSONSchemaForAntigravityFailed to clean schemaUnsupported keywordanyOf/oneOf flattening failed
Reporting Issues
If you've identified a specific MCP server causing the problem, please submit a GitHub issue, including:
- MCP server name and version
- Complete error logs (from
~/.config/opencode/antigravity-logs/) - Example of tool triggering the problem
- Plugin version (run
opencode --version)
Common Pitfalls
Plugin Loading Order
If you're using both opencode-antigravity-auth and @tarquinen/opencode-dcp, place the Antigravity Auth plugin first:
{
"plugin": [
"opencode-antigravity-auth@latest", ← Must come before DCP
"@tarquinen/opencode-dcp@latest"
]
}DCP creates synthetic assistant messages lacking thought blocks, which may cause signature verification errors.
Configuration Key Name Error
Make sure to use plugin (singular), not plugins (plural):
// ❌ Incorrect
{
"plugins": ["opencode-antigravity-auth@beta"]
}
// ✅ Correct
{
"plugin": ["opencode-antigravity-auth@beta"]
}When to Seek Help
If the problem persists after trying all the above methods:
Check log files:
cat ~/.config/opencode/antigravity-logs/latest.logReset account (clear all state):
rm ~/.config/opencode/antigravity-accounts.json
opencode auth loginSubmit GitHub issue, including:
- Complete error message
- Plugin version (
opencode --version) ~/.config/opencode/antigravity.jsonconfiguration (remove sensitive info like refreshToken)- Debug logs (
~/.config/opencode/antigravity-logs/latest.log)
Related Courses
- Quick Installation Guide - Basic configuration
- Plugin Compatibility - Troubleshooting other plugin conflicts
- Debug Logging - Enable verbose logging
Appendix: Source Code Reference
Click to view source code locations
Last updated: 2026-01-23
| Feature | File Path | Lines |
|---|---|---|
| JSON Schema cleanup main function | src/plugin/request-helpers.ts | 658-685 |
| Convert const to enum | src/plugin/request-helpers.ts | 86-104 |
| Convert $ref to hints | src/plugin/request-helpers.ts | 55-80 |
| Flatten anyOf/oneOf | src/plugin/request-helpers.ts | 368-453 |
| Gemini tool format conversion | src/plugin/transform/gemini.ts | 425-517 |
Key Constants:
UNSUPPORTED_KEYWORDS: Schema keywords removed (request-helpers.ts:33-37)UNSUPPORTED_CONSTRAINTS: Constraints moved to description (request-helpers.ts:24-28)
Key Functions:
cleanJSONSchemaForAntigravity(schema): Cleans incompatible JSON SchemaconvertConstToEnum(schema): ConvertsconsttoenumconvertRefsToHints(schema): Converts$refto description hintsflattenAnyOfOneOf(schema): FlattensanyOf/oneOfstructures