opencode-antigravity-auth 1.2.7-beta.0 → 1.2.7-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +295 -536
- package/dist/src/antigravity/oauth.d.ts.map +1 -1
- package/dist/src/antigravity/oauth.js +3 -1
- package/dist/src/antigravity/oauth.js.map +1 -1
- package/dist/src/constants.d.ts +8 -0
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/constants.js +8 -0
- package/dist/src/constants.js.map +1 -1
- package/dist/src/hooks/auto-update-checker/index.d.ts.map +1 -1
- package/dist/src/hooks/auto-update-checker/index.js +4 -0
- package/dist/src/hooks/auto-update-checker/index.js.map +1 -1
- package/dist/src/plugin/accounts.d.ts +8 -2
- package/dist/src/plugin/accounts.d.ts.map +1 -1
- package/dist/src/plugin/accounts.js +23 -2
- package/dist/src/plugin/accounts.js.map +1 -1
- package/dist/src/plugin/auth.d.ts +6 -0
- package/dist/src/plugin/auth.d.ts.map +1 -1
- package/dist/src/plugin/auth.js +13 -0
- package/dist/src/plugin/auth.js.map +1 -1
- package/dist/src/plugin/config/schema.d.ts +26 -0
- package/dist/src/plugin/config/schema.d.ts.map +1 -1
- package/dist/src/plugin/config/schema.js +27 -0
- package/dist/src/plugin/config/schema.js.map +1 -1
- package/dist/src/plugin/core/streaming/index.d.ts +3 -0
- package/dist/src/plugin/core/streaming/index.d.ts.map +1 -0
- package/dist/src/plugin/core/streaming/index.js +3 -0
- package/dist/src/plugin/core/streaming/index.js.map +1 -0
- package/dist/src/plugin/core/streaming/transformer.d.ts +9 -0
- package/dist/src/plugin/core/streaming/transformer.d.ts.map +1 -0
- package/dist/src/plugin/core/streaming/transformer.js +134 -0
- package/dist/src/plugin/core/streaming/transformer.js.map +1 -0
- package/dist/src/plugin/core/streaming/types.d.ts +26 -0
- package/dist/src/plugin/core/streaming/types.d.ts.map +1 -0
- package/dist/src/plugin/core/streaming/types.js +1 -0
- package/dist/src/plugin/core/streaming/types.js.map +1 -0
- package/dist/src/plugin/logger.d.ts.map +1 -1
- package/dist/src/plugin/logger.js +3 -2
- package/dist/src/plugin/logger.js.map +1 -1
- package/dist/src/plugin/recovery.d.ts.map +1 -1
- package/dist/src/plugin/recovery.js +42 -14
- package/dist/src/plugin/recovery.js.map +1 -1
- package/dist/src/plugin/request-helpers.d.ts +51 -0
- package/dist/src/plugin/request-helpers.d.ts.map +1 -1
- package/dist/src/plugin/request-helpers.js +341 -19
- package/dist/src/plugin/request-helpers.js.map +1 -1
- package/dist/src/plugin/request.d.ts +50 -3
- package/dist/src/plugin/request.d.ts.map +1 -1
- package/dist/src/plugin/request.js +89 -177
- package/dist/src/plugin/request.js.map +1 -1
- package/dist/src/plugin/storage.d.ts +4 -0
- package/dist/src/plugin/storage.d.ts.map +1 -1
- package/dist/src/plugin/storage.js +70 -5
- package/dist/src/plugin/storage.js.map +1 -1
- package/dist/src/plugin/stores/signature-store.d.ts +5 -0
- package/dist/src/plugin/stores/signature-store.d.ts.map +1 -0
- package/dist/src/plugin/stores/signature-store.js +25 -0
- package/dist/src/plugin/stores/signature-store.js.map +1 -0
- package/dist/src/plugin/token.d.ts.map +1 -1
- package/dist/src/plugin/token.js +3 -2
- package/dist/src/plugin/token.js.map +1 -1
- package/dist/src/plugin/transform/claude.d.ts.map +1 -1
- package/dist/src/plugin/transform/claude.js +30 -8
- package/dist/src/plugin/transform/claude.js.map +1 -1
- package/dist/src/plugin/transform/model-resolver.d.ts +11 -4
- package/dist/src/plugin/transform/model-resolver.d.ts.map +1 -1
- package/dist/src/plugin/transform/model-resolver.js +76 -19
- package/dist/src/plugin/transform/model-resolver.js.map +1 -1
- package/dist/src/plugin/transform/types.d.ts +5 -5
- package/dist/src/plugin/transform/types.d.ts.map +1 -1
- package/dist/src/plugin/transform/types.js +0 -5
- package/dist/src/plugin/transform/types.js.map +1 -1
- package/dist/src/plugin.d.ts.map +1 -1
- package/dist/src/plugin.js +230 -59
- package/dist/src/plugin.js.map +1 -1
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -1,702 +1,461 @@
|
|
|
1
|
-
#
|
|
1
|
+
# opencode-antigravity-auth
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/opencode-antigravity-auth)
|
|
4
4
|
[](https://www.npmjs.com/package/opencode-antigravity-auth)
|
|
5
|
+
[](LICENSE)
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
OpenCode plugin for Google Antigravity OAuth authentication.
|
|
7
8
|
|
|
8
|
-
##
|
|
9
|
+
## Features
|
|
9
10
|
|
|
10
|
-
- **
|
|
11
|
-
- **Multi-
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
14
|
-
- **
|
|
15
|
-
- **Automatic endpoint fallback** between Antigravity API endpoints (daily → autopush → prod)
|
|
16
|
-
- **Antigravity API compatibility** for OpenAI-style requests
|
|
17
|
-
- **Debug logging** for requests and responses
|
|
18
|
-
- **Drop-in setup** Opencode auto-installs the plugin from config
|
|
11
|
+
- **Dual Quota System** - Access both Antigravity quota (Claude, Gemini 3) and Gemini CLI quota from a single plugin
|
|
12
|
+
- **Multi-Account Rotation** - Add multiple Google accounts; automatically rotates when one is rate-limited
|
|
13
|
+
- **Plugin Compatible** - Works alongside other OpenCode plugins (opencodesync, etc.)
|
|
14
|
+
- **Extended Thinking** - Native support for Claude thinking budgets and Gemini 3 thinking levels
|
|
15
|
+
- **Auto Recovery** - Automatic session recovery from Claude tool_result_missing errors
|
|
19
16
|
|
|
20
17
|
## Installation
|
|
21
18
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
**Option A: Let an LLM do it for you**
|
|
25
|
-
|
|
26
|
-
Paste this into any LLM agent (Claude Code, OpenCode, Cursor, etc.):
|
|
27
|
-
|
|
28
|
-
```
|
|
29
|
-
Install the opencode-antigravity-auth plugin and add the Antigravity model definitions (see "Available models") to ~/.config/opencode/opencode.json by following: https://raw.githubusercontent.com/NoeFabris/opencode-antigravity-auth/main/README.md
|
|
19
|
+
```bash
|
|
20
|
+
npm install opencode-antigravity-auth
|
|
30
21
|
```
|
|
31
22
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
**Option B: Do it yourself**
|
|
35
|
-
|
|
36
|
-
1. **Add the plugin to your config:**
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
mkdir -p ~/.config/opencode
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
Create or edit `~/.config/opencode/opencode.json`:
|
|
43
|
-
|
|
44
|
-
```json
|
|
45
|
-
{
|
|
46
|
-
"plugin": ["opencode-antigravity-auth@1.2.4"]
|
|
47
|
-
}
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
2. **Authenticate:**
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
opencode auth login
|
|
54
|
-
```
|
|
23
|
+
Add to your OpenCode config (`~/.config/opencode/opencode.json`):
|
|
55
24
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
{
|
|
64
|
-
"plugin": ["opencode-antigravity-auth@1.2.4"],
|
|
65
|
-
"provider": {
|
|
66
|
-
"google": {
|
|
67
|
-
"models": {
|
|
68
|
-
"gemini-3-pro-high": {
|
|
69
|
-
"name": "Gemini 3 Pro High (Antigravity)",
|
|
70
|
-
"limit": { "context": 1048576, "output": 65535 },
|
|
71
|
-
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
72
|
-
},
|
|
73
|
-
"claude-sonnet-4-5": {
|
|
74
|
-
"name": "Claude Sonnet 4.5 (Antigravity)",
|
|
75
|
-
"limit": { "context": 200000, "output": 64000 },
|
|
76
|
-
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
> See [Available models](#available-models) for the full list.
|
|
85
|
-
|
|
86
|
-
4. **Use it:**
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
opencode run "Hello" --model=google/gemini-3-pro-high
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
---
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"plugins": ["opencode-antigravity-auth@latest"],
|
|
28
|
+
"provider": "google",
|
|
29
|
+
"model": "google/antigravity-gemini-3-flash"
|
|
30
|
+
}
|
|
31
|
+
```
|
|
93
32
|
|
|
94
|
-
|
|
33
|
+
On first run, a browser window opens for Google OAuth. Tokens are stored securely and refresh automatically.
|
|
95
34
|
|
|
96
35
|
<details>
|
|
97
|
-
<summary
|
|
36
|
+
<summary>Installation Guide for LLM Agents</summary>
|
|
98
37
|
|
|
99
|
-
|
|
38
|
+
### Step-by-Step Instructions
|
|
100
39
|
|
|
101
|
-
|
|
40
|
+
1. Edit the OpenCode configuration file:
|
|
41
|
+
- Linux/Mac: `~/.config/opencode/opencode.json`
|
|
42
|
+
- Windows: `%APPDATA%\opencode\opencode.json`
|
|
102
43
|
|
|
103
|
-
|
|
104
|
-
command -v opencode && opencode --version || echo "OpenCode not installed - see https://opencode.ai/docs"
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
#### Step 2: Create or update the config
|
|
108
|
-
|
|
109
|
-
```bash
|
|
110
|
-
mkdir -p ~/.config/opencode
|
|
111
|
-
|
|
112
|
-
if [ -f ~/.config/opencode/opencode.json ]; then
|
|
113
|
-
if command -v jq &> /dev/null; then
|
|
114
|
-
jq '.plugin = ((.plugin // []) + ["opencode-antigravity-auth@1.2.4"] | unique)' \
|
|
115
|
-
~/.config/opencode/opencode.json > /tmp/oc.json && \
|
|
116
|
-
mv /tmp/oc.json ~/.config/opencode/opencode.json
|
|
117
|
-
else
|
|
118
|
-
echo "Add \"opencode-antigravity-auth@1.2.4\" to the plugin array manually"
|
|
119
|
-
fi
|
|
120
|
-
else
|
|
121
|
-
echo '{"plugin":["opencode-antigravity-auth@1.2.4"]}' > ~/.config/opencode/opencode.json
|
|
122
|
-
fi
|
|
123
|
-
```
|
|
44
|
+
2. Add the plugin to the `plugins` array
|
|
124
45
|
|
|
125
|
-
|
|
46
|
+
3. Set `provider` to `"google"` and choose a model
|
|
126
47
|
|
|
127
|
-
|
|
48
|
+
### Complete Configuration Example
|
|
128
49
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
50
|
+
Create `~/.config/opencode/antigravity.json`
|
|
51
|
+
```jsonc
|
|
52
|
+
{
|
|
53
|
+
// JSON Schema for IDE autocompletion
|
|
54
|
+
"$schema": "https://raw.githubusercontent.com/anthropics/opencode-antigravity-auth/main/assets/antigravity.schema.json",
|
|
132
55
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
56
|
+
// === General ===
|
|
57
|
+
"quiet_mode": false, // Suppress toast notifications (except recovery)
|
|
58
|
+
"debug": false, // Enable debug logging to file
|
|
59
|
+
"log_dir": "/custom/log/path", // Custom debug log directory (optional)
|
|
60
|
+
"auto_update": true, // Auto-update plugin
|
|
136
61
|
|
|
137
|
-
|
|
62
|
+
// === Thinking Blocks ===
|
|
63
|
+
"keep_thinking": false, // Preserve thinking blocks (may cause signature errors)
|
|
138
64
|
|
|
139
|
-
|
|
65
|
+
// === Session Recovery ===
|
|
66
|
+
"session_recovery": true, // Auto-recover from tool_result_missing errors
|
|
67
|
+
"auto_resume": true, // Auto-send "continue" after recovery
|
|
68
|
+
"resume_text": "continue", // Custom resume prompt text
|
|
140
69
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
70
|
+
// === Empty Response Handling ===
|
|
71
|
+
"empty_response_max_attempts": 4, // Max retries for empty responses
|
|
72
|
+
"empty_response_retry_delay_ms": 2000, // Delay between retries (ms)
|
|
144
73
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
3. **Project ID prompt** → Tell user: "Press Enter to skip (most users don't need this)"
|
|
149
|
-
4. Browser opens for Google sign-in
|
|
150
|
-
5. If multi-account: repeat for additional accounts, or press Enter to finish
|
|
74
|
+
// === Tool Handling ===
|
|
75
|
+
"tool_id_recovery": true, // Fix mismatched tool IDs from context compaction
|
|
76
|
+
"claude_tool_hardening": true, // Prevent Claude tool hallucinations
|
|
151
77
|
|
|
152
|
-
|
|
78
|
+
// === Token Refresh ===
|
|
79
|
+
"proactive_token_refresh": true, // Background token refresh
|
|
80
|
+
"proactive_refresh_buffer_seconds": 1800, // Refresh 30min before expiry
|
|
81
|
+
"proactive_refresh_check_interval_seconds": 300, // Check every 5min
|
|
153
82
|
|
|
154
|
-
|
|
83
|
+
// === Rate Limiting ===
|
|
84
|
+
"max_rate_limit_wait_seconds": 300, // Max wait time when rate limited (0=unlimited)
|
|
85
|
+
"quota_fallback": false, // Try alternate quota when rate limited
|
|
155
86
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
"claude-sonnet-4-5-thinking-low": {"name": "Claude Sonnet 4.5 Thinking Low (Antigravity)", "limit": {"context": 200000, "output": 64000}, "modalities": {"input": ["text", "image", "pdf"], "output": ["text"]}},
|
|
165
|
-
"claude-sonnet-4-5-thinking-medium": {"name": "Claude Sonnet 4.5 Thinking Medium (Antigravity)", "limit": {"context": 200000, "output": 64000}, "modalities": {"input": ["text", "image", "pdf"], "output": ["text"]}},
|
|
166
|
-
"claude-sonnet-4-5-thinking-high": {"name": "Claude Sonnet 4.5 Thinking High (Antigravity)", "limit": {"context": 200000, "output": 64000}, "modalities": {"input": ["text", "image", "pdf"], "output": ["text"]}},
|
|
167
|
-
"claude-opus-4-5-thinking-low": {"name": "Claude Opus 4.5 Thinking Low (Antigravity)", "limit": {"context": 200000, "output": 64000}, "modalities": {"input": ["text", "image", "pdf"], "output": ["text"]}},
|
|
168
|
-
"claude-opus-4-5-thinking-medium": {"name": "Claude Opus 4.5 Thinking Medium (Antigravity)", "limit": {"context": 200000, "output": 64000}, "modalities": {"input": ["text", "image", "pdf"], "output": ["text"]}},
|
|
169
|
-
"claude-opus-4-5-thinking-high": {"name": "Claude Opus 4.5 Thinking High (Antigravity)", "limit": {"context": 200000, "output": 64000}, "modalities": {"input": ["text", "image", "pdf"], "output": ["text"]}},
|
|
170
|
-
"gpt-oss-120b-medium": {"name": "GPT-OSS 120B Medium (Antigravity)", "limit": {"context": 131072, "output": 32768}, "modalities": {"input": ["text", "image", "pdf"], "output": ["text"]}}
|
|
171
|
-
} + (.provider.google.models // {})' ~/.config/opencode/opencode.json > /tmp/oc.json && mv /tmp/oc.json ~/.config/opencode/opencode.json
|
|
172
|
-
fi
|
|
87
|
+
// === Signature Cache (for keep_thinking=true) ===
|
|
88
|
+
"signature_cache": {
|
|
89
|
+
"enabled": true,
|
|
90
|
+
"memory_ttl_seconds": 3600, // 1 hour in-memory
|
|
91
|
+
"disk_ttl_seconds": 172800, // 48 hours on disk
|
|
92
|
+
"write_interval_seconds": 60 // Background write interval
|
|
93
|
+
}
|
|
94
|
+
}
|
|
173
95
|
```
|
|
174
96
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
opencode
|
|
97
|
+
Create `~/.config/opencode/opencode.json`
|
|
98
|
+
```jsonc
|
|
99
|
+
{
|
|
100
|
+
"$schema": "https://opencode.ai/config.json",
|
|
101
|
+
"plugin": [
|
|
102
|
+
"opencode-antigravity-auth@latest"
|
|
103
|
+
],
|
|
104
|
+
"provider": {
|
|
105
|
+
"google": {
|
|
106
|
+
"models": {
|
|
107
|
+
"antigravity-gemini-3-pro-low": {
|
|
108
|
+
"name": "Gemini 3 Pro Low (Antigravity)",
|
|
109
|
+
"limit": { "context": 1048576, "output": 65535 },
|
|
110
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
111
|
+
},
|
|
112
|
+
"antigravity-gemini-3-pro-high": {
|
|
113
|
+
"name": "Gemini 3 Pro High (Antigravity)",
|
|
114
|
+
"limit": { "context": 1048576, "output": 65535 },
|
|
115
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
116
|
+
},
|
|
117
|
+
"antigravity-gemini-3-flash": {
|
|
118
|
+
"name": "Gemini 3 Flash (Antigravity)",
|
|
119
|
+
"limit": { "context": 1048576, "output": 65536 },
|
|
120
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
121
|
+
},
|
|
122
|
+
"antigravity-claude-sonnet-4-5": {
|
|
123
|
+
"name": "Claude Sonnet 4.5 (Antigravity)",
|
|
124
|
+
"limit": { "context": 200000, "output": 64000 },
|
|
125
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
126
|
+
},
|
|
127
|
+
"antigravity-claude-sonnet-4-5-thinking-low": {
|
|
128
|
+
"name": "Claude Sonnet 4.5 Think Low (Antigravity)",
|
|
129
|
+
"limit": { "context": 200000, "output": 64000 },
|
|
130
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
131
|
+
},
|
|
132
|
+
"antigravity-claude-sonnet-4-5-thinking-medium": {
|
|
133
|
+
"name": "Claude Sonnet 4.5 Think Medium (Antigravity)",
|
|
134
|
+
"limit": { "context": 200000, "output": 64000 },
|
|
135
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
136
|
+
},
|
|
137
|
+
"antigravity-claude-sonnet-4-5-thinking-high": {
|
|
138
|
+
"name": "Claude Sonnet 4.5 Think High (Antigravity)",
|
|
139
|
+
"limit": { "context": 200000, "output": 64000 },
|
|
140
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
141
|
+
},
|
|
142
|
+
"antigravity-claude-opus-4-5-thinking-low": {
|
|
143
|
+
"name": "Claude Opus 4.5 Think Low (Antigravity)",
|
|
144
|
+
"limit": { "context": 200000, "output": 64000 },
|
|
145
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
146
|
+
},
|
|
147
|
+
"antigravity-claude-opus-4-5-thinking-medium": {
|
|
148
|
+
"name": "Claude Opus 4.5 Think Medium (Antigravity)",
|
|
149
|
+
"limit": { "context": 200000, "output": 64000 },
|
|
150
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
151
|
+
},
|
|
152
|
+
"antigravity-claude-opus-4-5-thinking-high": {
|
|
153
|
+
"name": "Claude Opus 4.5 Think High (Antigravity)",
|
|
154
|
+
"limit": { "context": 200000, "output": 64000 },
|
|
155
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
181
161
|
```
|
|
182
162
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
</details>
|
|
186
|
-
|
|
187
|
-
---
|
|
188
|
-
|
|
189
|
-
## Migration Guide
|
|
190
|
-
|
|
191
|
-
### Upgrading to v1.2.5
|
|
192
|
-
|
|
193
|
-
Version 1.2.5 introduces significant reliability improvements for Claude models. No breaking changes—existing configurations continue to work.
|
|
194
|
-
|
|
195
|
-
#### What's New
|
|
196
|
-
|
|
197
|
-
| Feature | Description |
|
|
198
|
-
|---------|-------------|
|
|
199
|
-
| **Session Recovery** | Auto-recovers from `tool_result_missing` errors |
|
|
200
|
-
| **Defense-in-Depth Tool Pairing** | Multi-layer fix for "Could not process tool results" errors |
|
|
201
|
-
| **Proactive Token Refresh** | Refreshes tokens 30min before expiry to prevent mid-session failures |
|
|
202
|
-
| **Signature Caching** | Persistent disk cache for thinking block signatures |
|
|
163
|
+
### Beta Versions
|
|
203
164
|
|
|
204
|
-
|
|
165
|
+
For the latest development features, check the [dev branch README](https://github.com/anthropics/opencode-antigravity-auth/tree/dev) for beta installation instructions.
|
|
205
166
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
```json
|
|
209
|
-
{
|
|
210
|
-
"plugin": ["opencode-antigravity-auth@1.2.5"]
|
|
211
|
-
}
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
2. **Update model names to new thinking budget format** (REQUIRED for thinking models):
|
|
215
|
-
|
|
216
|
-
The old generic `-thinking` suffix is now replaced with explicit budget tiers:
|
|
217
|
-
|
|
218
|
-
| Old Model ID (deprecated) | New Model ID | Thinking Budget |
|
|
219
|
-
|---------------------------|--------------|-----------------|
|
|
220
|
-
| `claude-sonnet-4-5-thinking` | `claude-sonnet-4-5-thinking-low` | 8,192 tokens |
|
|
221
|
-
| `claude-sonnet-4-5-thinking` | `claude-sonnet-4-5-thinking-medium` | 16,384 tokens |
|
|
222
|
-
| `claude-sonnet-4-5-thinking` | `claude-sonnet-4-5-thinking-high` | 32,768 tokens |
|
|
223
|
-
| `claude-opus-4-5-thinking` | `claude-opus-4-5-thinking-low` | 8,192 tokens |
|
|
224
|
-
| `claude-opus-4-5-thinking` | `claude-opus-4-5-thinking-medium` | 16,384 tokens |
|
|
225
|
-
| `claude-opus-4-5-thinking` | `claude-opus-4-5-thinking-high` | 32,768 tokens |
|
|
226
|
-
|
|
227
|
-
Update your `~/.config/opencode/opencode.json`:
|
|
228
|
-
|
|
229
|
-
```diff
|
|
230
|
-
{
|
|
231
|
-
"provider": {
|
|
232
|
-
"google": {
|
|
233
|
-
"models": {
|
|
234
|
-
- "claude-sonnet-4-5-thinking": {
|
|
235
|
-
- "name": "Claude Sonnet 4.5 Thinking (Antigravity)",
|
|
236
|
-
+ "claude-sonnet-4-5-thinking-medium": {
|
|
237
|
-
+ "name": "Claude Sonnet 4.5 Thinking Medium (Antigravity)",
|
|
238
|
-
"limit": { "context": 200000, "output": 64000 },
|
|
239
|
-
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
> **Tip:** Use `-medium` as a balanced default. Use `-high` for complex reasoning tasks, `-low` for faster responses.
|
|
248
|
-
|
|
249
|
-
3. **Restart OpenCode** to load the new version:
|
|
250
|
-
|
|
251
|
-
```bash
|
|
252
|
-
# If OpenCode is running, exit and restart
|
|
253
|
-
opencode
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
4. **(Optional) Review new config options** in `~/.config/opencode/antigravity.json`:
|
|
257
|
-
|
|
258
|
-
```json
|
|
259
|
-
{
|
|
260
|
-
"session_recovery": true,
|
|
261
|
-
"auto_resume": true,
|
|
262
|
-
"resume_text": "continue",
|
|
263
|
-
"tool_id_recovery": true,
|
|
264
|
-
"claude_tool_hardening": true,
|
|
265
|
-
"proactive_token_refresh": true,
|
|
266
|
-
"signature_cache": {
|
|
267
|
-
"enabled": true,
|
|
268
|
-
"memory_ttl_seconds": 3600,
|
|
269
|
-
"disk_ttl_seconds": 172800
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
All new options are **enabled by default**—no action required for most users.
|
|
275
|
-
|
|
276
|
-
#### Breaking Changes
|
|
277
|
-
|
|
278
|
-
**None.** v1.2.5 is fully backward compatible.
|
|
279
|
-
|
|
280
|
-
#### Troubleshooting
|
|
167
|
+
</details>
|
|
281
168
|
|
|
282
|
-
|
|
283
|
-
|-------|----------|
|
|
284
|
-
| Signature errors after upgrade | Delete `~/.config/opencode/antigravity-signature-cache.json` and restart |
|
|
285
|
-
| Recovery not triggering | Ensure `session_recovery: true` in config (default) |
|
|
286
|
-
| Old version still loading | Clear npm cache: `npm cache clean --force` and restart OpenCode |
|
|
169
|
+
## Available Models
|
|
287
170
|
|
|
288
|
-
|
|
171
|
+
### Antigravity Quota
|
|
289
172
|
|
|
290
|
-
|
|
173
|
+
Models with `antigravity-` prefix use Antigravity quota:
|
|
291
174
|
|
|
292
|
-
|
|
175
|
+
| Model | Description |
|
|
176
|
+
|-------|-------------|
|
|
177
|
+
| `google/antigravity-gemini-3-flash` | Gemini 3 Flash (minimal thinking) |
|
|
178
|
+
| `google/antigravity-gemini-3-pro-low` | Gemini 3 Pro with low thinking |
|
|
179
|
+
| `google/antigravity-gemini-3-pro-high` | Gemini 3 Pro with high thinking |
|
|
180
|
+
| `google/antigravity-claude-sonnet-4-5` | Claude Sonnet 4.5 (no thinking) |
|
|
181
|
+
| `google/antigravity-claude-sonnet-4-5-thinking-low` | Sonnet with 8K thinking budget |
|
|
182
|
+
| `google/antigravity-claude-sonnet-4-5-thinking-medium` | Sonnet with 16K thinking budget |
|
|
183
|
+
| `google/antigravity-claude-sonnet-4-5-thinking-high` | Sonnet with 32K thinking budget |
|
|
184
|
+
| `google/antigravity-claude-opus-4-5-thinking-low` | Opus with 8K thinking budget |
|
|
185
|
+
| `google/antigravity-claude-opus-4-5-thinking-medium` | Opus with 16K thinking budget |
|
|
186
|
+
| `google/antigravity-claude-opus-4-5-thinking-high` | Opus with 32K thinking budget |
|
|
293
187
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
### Gemini Models
|
|
297
|
-
|
|
298
|
-
| Model ID | Description | Thinking |
|
|
299
|
-
|----------|-------------|----------|
|
|
300
|
-
| `gemini-3-pro-low` | Gemini 3 Pro (low thinking) | thinkingLevel: "low" |
|
|
301
|
-
| `gemini-3-pro-high` | Gemini 3 Pro (high thinking) | thinkingLevel: "high" |
|
|
302
|
-
| `gemini-3-flash` | Gemini 3 Flash | Default |
|
|
188
|
+
### Gemini CLI Quota
|
|
303
189
|
|
|
304
|
-
|
|
190
|
+
Models without `antigravity-` prefix use Gemini CLI quota:
|
|
305
191
|
|
|
306
|
-
| Model
|
|
307
|
-
|
|
308
|
-
| `
|
|
309
|
-
| `
|
|
310
|
-
| `
|
|
311
|
-
| `
|
|
312
|
-
| `
|
|
313
|
-
| `claude-opus-4-5-thinking-medium` | Claude Opus 4.5 Thinking | 16,384 tokens |
|
|
314
|
-
| `claude-opus-4-5-thinking-high` | Claude Opus 4.5 Thinking | 32,768 tokens |
|
|
315
|
-
|
|
316
|
-
### Other Models
|
|
317
|
-
|
|
318
|
-
| Model ID | Description |
|
|
319
|
-
|----------|-------------|
|
|
320
|
-
| `gpt-oss-120b-medium` | GPT-OSS 120B Medium |
|
|
321
|
-
|
|
322
|
-
> **Tier suffixes:** Use `-low`, `-medium`, or `-high` to control thinking budget. Higher tiers = more reasoning tokens.
|
|
192
|
+
| Model | Description |
|
|
193
|
+
|-------|-------------|
|
|
194
|
+
| `google/gemini-2.5-flash` | Gemini 2.5 Flash |
|
|
195
|
+
| `google/gemini-2.5-pro` | Gemini 2.5 Pro |
|
|
196
|
+
| `google/gemini-3-flash` | Gemini 3 Flash |
|
|
197
|
+
| `google/gemini-3-pro-low` | Gemini 3 Pro with low thinking |
|
|
198
|
+
| `google/gemini-3-pro-high` | Gemini 3 Pro with high thinking |
|
|
323
199
|
|
|
324
200
|
<details>
|
|
325
|
-
<summary
|
|
201
|
+
<summary>Full models configuration</summary>
|
|
326
202
|
|
|
327
|
-
```
|
|
203
|
+
```jsonc
|
|
328
204
|
{
|
|
205
|
+
"$schema": "https://opencode.ai/config.json",
|
|
206
|
+
"plugin": [
|
|
207
|
+
"opencode-antigravity-auth@latest"
|
|
208
|
+
],
|
|
329
209
|
"provider": {
|
|
330
210
|
"google": {
|
|
331
211
|
"models": {
|
|
332
|
-
"gemini-3-pro-low": {
|
|
212
|
+
"antigravity-gemini-3-pro-low": {
|
|
333
213
|
"name": "Gemini 3 Pro Low (Antigravity)",
|
|
334
214
|
"limit": { "context": 1048576, "output": 65535 },
|
|
335
215
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
336
216
|
},
|
|
337
|
-
"gemini-3-pro-high": {
|
|
217
|
+
"antigravity-gemini-3-pro-high": {
|
|
338
218
|
"name": "Gemini 3 Pro High (Antigravity)",
|
|
339
219
|
"limit": { "context": 1048576, "output": 65535 },
|
|
340
220
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
341
221
|
},
|
|
342
|
-
"gemini-3-flash": {
|
|
222
|
+
"antigravity-gemini-3-flash": {
|
|
343
223
|
"name": "Gemini 3 Flash (Antigravity)",
|
|
344
224
|
"limit": { "context": 1048576, "output": 65536 },
|
|
345
225
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
346
226
|
},
|
|
347
|
-
"claude-sonnet-4-5": {
|
|
227
|
+
"antigravity-claude-sonnet-4-5": {
|
|
348
228
|
"name": "Claude Sonnet 4.5 (Antigravity)",
|
|
349
229
|
"limit": { "context": 200000, "output": 64000 },
|
|
350
230
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
351
231
|
},
|
|
352
|
-
"claude-sonnet-4-5-thinking-low": {
|
|
353
|
-
"name": "Claude Sonnet 4.5
|
|
232
|
+
"antigravity-claude-sonnet-4-5-thinking-low": {
|
|
233
|
+
"name": "Claude Sonnet 4.5 Think Low (Antigravity)",
|
|
354
234
|
"limit": { "context": 200000, "output": 64000 },
|
|
355
235
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
356
236
|
},
|
|
357
|
-
"claude-sonnet-4-5-thinking-medium": {
|
|
358
|
-
"name": "Claude Sonnet 4.5
|
|
237
|
+
"antigravity-claude-sonnet-4-5-thinking-medium": {
|
|
238
|
+
"name": "Claude Sonnet 4.5 Think Medium (Antigravity)",
|
|
359
239
|
"limit": { "context": 200000, "output": 64000 },
|
|
360
240
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
361
241
|
},
|
|
362
|
-
"claude-sonnet-4-5-thinking-high": {
|
|
363
|
-
"name": "Claude Sonnet 4.5
|
|
242
|
+
"antigravity-claude-sonnet-4-5-thinking-high": {
|
|
243
|
+
"name": "Claude Sonnet 4.5 Think High (Antigravity)",
|
|
364
244
|
"limit": { "context": 200000, "output": 64000 },
|
|
365
245
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
366
246
|
},
|
|
367
|
-
"claude-opus-4-5-thinking-low": {
|
|
368
|
-
"name": "Claude Opus 4.5
|
|
247
|
+
"antigravity-claude-opus-4-5-thinking-low": {
|
|
248
|
+
"name": "Claude Opus 4.5 Think Low (Antigravity)",
|
|
369
249
|
"limit": { "context": 200000, "output": 64000 },
|
|
370
250
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
371
251
|
},
|
|
372
|
-
"claude-opus-4-5-thinking-medium": {
|
|
373
|
-
"name": "Claude Opus 4.5
|
|
252
|
+
"antigravity-claude-opus-4-5-thinking-medium": {
|
|
253
|
+
"name": "Claude Opus 4.5 Think Medium (Antigravity)",
|
|
374
254
|
"limit": { "context": 200000, "output": 64000 },
|
|
375
255
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
376
256
|
},
|
|
377
|
-
"claude-opus-4-5-thinking-high": {
|
|
378
|
-
"name": "Claude Opus 4.5
|
|
257
|
+
"antigravity-claude-opus-4-5-thinking-high": {
|
|
258
|
+
"name": "Claude Opus 4.5 Think High (Antigravity)",
|
|
379
259
|
"limit": { "context": 200000, "output": 64000 },
|
|
380
260
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
381
|
-
},
|
|
382
|
-
"gpt-oss-120b-medium": {
|
|
383
|
-
"name": "GPT-OSS 120B Medium (Antigravity)",
|
|
384
|
-
"limit": { "context": 131072, "output": 32768 },
|
|
385
|
-
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
386
261
|
}
|
|
387
262
|
}
|
|
388
263
|
}
|
|
389
264
|
}
|
|
390
265
|
}
|
|
391
266
|
```
|
|
392
|
-
|
|
393
267
|
</details>
|
|
394
268
|
|
|
395
|
-
##
|
|
396
|
-
|
|
397
|
-
The plugin supports multiple Google accounts to maximize rate limits and provide automatic failover.
|
|
398
|
-
|
|
399
|
-
### How it works
|
|
400
|
-
|
|
401
|
-
- **Sticky account selection:** The plugin sticks to the same account for all requests until it hits a rate limit. This preserves Anthropic's prompt cache, which is organization-scoped.
|
|
402
|
-
- **Per-model-family rate limits:** Rate limits are tracked separately for Claude and Gemini models. If an account is rate-limited for Claude, it can still be used for Gemini requests.
|
|
403
|
-
- **Dual quota pools for Gemini:** Gemini models have access to two separate quota pools (Antigravity and Gemini CLI). When one pool is exhausted, the plugin automatically switches to the other before trying a different account.
|
|
404
|
-
- **Smart retry threshold:** Short rate limits (≤5s) are retried on the same account to avoid unnecessary switching.
|
|
405
|
-
- **Exponential backoff:** Consecutive rate limits trigger exponential backoff with increasing delays.
|
|
406
|
-
- **Quota-aware messages:** Rate limit toasts show quota reset times when available from the API.
|
|
407
|
-
- **Automatic failover:** On HTTP `429` (rate limit), the plugin automatically switches to the next available account for that model family.
|
|
408
|
-
- **Smart cooldown:** Rate-limited accounts are temporarily cooled down and automatically become available again after the cooldown expires.
|
|
409
|
-
- **Single-account retry:** If you only have one account, the plugin waits for the rate limit to reset and retries automatically.
|
|
410
|
-
- **Debounced notifications:** Toast notifications are debounced to avoid spam during streaming responses.
|
|
411
|
-
|
|
412
|
-
### Dual quota pools (Gemini only)
|
|
413
|
-
|
|
414
|
-
For Gemini models, the plugin can access **two independent quota pools** using the same Google account:
|
|
415
|
-
|
|
416
|
-
| Quota Pool | Headers Used | When Used |
|
|
417
|
-
|------------|--------------|-----------|
|
|
418
|
-
| **Antigravity** | Antigravity headers | Primary (tried first) |
|
|
419
|
-
| **Gemini CLI** | Gemini CLI headers | Fallback when Antigravity is rate-limited |
|
|
420
|
-
|
|
421
|
-
This effectively **doubles your Gemini quota** per account.
|
|
422
|
-
|
|
423
|
-
**How it works:**
|
|
424
|
-
1. Plugin tries Antigravity quota first
|
|
425
|
-
2. If rate-limited (429), it automatically retries using Gemini CLI headers
|
|
426
|
-
3. Only if **both** pools are exhausted does it switch to the next account
|
|
427
|
-
4. This happens seamlessly — conversation context is preserved when switching between quota pools.
|
|
428
|
-
|
|
429
|
-
> **Note:** Claude models only work with Antigravity headers, so this dual-pool fallback only applies to Gemini models.
|
|
269
|
+
## Configuration
|
|
430
270
|
|
|
431
|
-
### Quiet mode
|
|
432
271
|
|
|
433
|
-
|
|
272
|
+
### Environment Overrides
|
|
434
273
|
|
|
435
274
|
```bash
|
|
436
|
-
|
|
275
|
+
OPENCODE_ANTIGRAVITY_QUIET=1 # quiet_mode
|
|
276
|
+
OPENCODE_ANTIGRAVITY_DEBUG=1 # debug
|
|
277
|
+
OPENCODE_ANTIGRAVITY_LOG_DIR=/path # log_dir
|
|
278
|
+
OPENCODE_ANTIGRAVITY_KEEP_THINKING=1 # keep_thinking
|
|
437
279
|
```
|
|
438
280
|
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
**CLI flow (`opencode auth login`):**
|
|
442
|
-
|
|
443
|
-
When you run `opencode auth login` and already have accounts saved, you'll be prompted:
|
|
444
|
-
|
|
445
|
-
```
|
|
446
|
-
2 account(s) saved:
|
|
447
|
-
1. user1@gmail.com
|
|
448
|
-
2. user2@gmail.com
|
|
449
|
-
|
|
450
|
-
(a)dd new account(s) or (f)resh start? [a/f]:
|
|
451
|
-
```
|
|
452
|
-
|
|
453
|
-
- Press `a` to add more accounts to your existing pool
|
|
454
|
-
- Press `f` to clear all existing accounts and start fresh
|
|
455
|
-
|
|
456
|
-
**TUI flow (`/connect`):**
|
|
281
|
+
<details>
|
|
282
|
+
<summary>Create `~/.config/opencode/antigravity.json` (or `.opencode/antigravity.json` in project root):</summary>
|
|
457
283
|
|
|
458
|
-
|
|
284
|
+
```jsonc
|
|
285
|
+
{
|
|
286
|
+
// JSON Schema for IDE autocompletion
|
|
287
|
+
"$schema": "https://raw.githubusercontent.com/anthropics/opencode-antigravity-auth/main/assets/antigravity.schema.json",
|
|
459
288
|
|
|
460
|
-
|
|
289
|
+
// === General ===
|
|
290
|
+
"quiet_mode": false, // Suppress toast notifications (except recovery)
|
|
291
|
+
"debug": false, // Enable debug logging to file
|
|
292
|
+
"log_dir": "/custom/log/path", // Custom debug log directory (optional)
|
|
293
|
+
"auto_update": true, // Auto-update plugin
|
|
461
294
|
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
- The plugin automatically syncs with OpenCode's auth state — if you log out via OpenCode, stale account storage is cleared automatically
|
|
295
|
+
// === Thinking Blocks ===
|
|
296
|
+
"keep_thinking": false, // Preserve thinking blocks (may cause signature errors)
|
|
465
297
|
|
|
466
|
-
|
|
298
|
+
// === Session Recovery ===
|
|
299
|
+
"session_recovery": true, // Auto-recover from tool_result_missing errors
|
|
300
|
+
"auto_resume": true, // Auto-send "continue" after recovery
|
|
301
|
+
"resume_text": "continue", // Custom resume prompt text
|
|
467
302
|
|
|
468
|
-
|
|
469
|
-
|
|
303
|
+
// === Empty Response Handling ===
|
|
304
|
+
"empty_response_max_attempts": 4, // Max retries for empty responses
|
|
305
|
+
"empty_response_retry_delay_ms": 2000, // Delay between retries (ms)
|
|
470
306
|
|
|
471
|
-
|
|
307
|
+
// === Tool Handling ===
|
|
308
|
+
"tool_id_recovery": true, // Fix mismatched tool IDs from context compaction
|
|
309
|
+
"claude_tool_hardening": true, // Prevent Claude tool hallucinations
|
|
472
310
|
|
|
473
|
-
|
|
311
|
+
// === Token Refresh ===
|
|
312
|
+
"proactive_token_refresh": true, // Background token refresh
|
|
313
|
+
"proactive_refresh_buffer_seconds": 1800, // Refresh 30min before expiry
|
|
314
|
+
"proactive_refresh_check_interval_seconds": 300, // Check every 5min
|
|
474
315
|
|
|
475
|
-
|
|
316
|
+
// === Rate Limiting ===
|
|
317
|
+
"max_rate_limit_wait_seconds": 300, // Max wait time when rate limited (0=unlimited)
|
|
318
|
+
"quota_fallback": false, // Try alternate quota when rate limited
|
|
476
319
|
|
|
477
|
-
|
|
478
|
-
{
|
|
479
|
-
"$schema": "https://raw.githubusercontent.com/NoeFabris/opencode-antigravity-auth/main/assets/antigravity.schema.json",
|
|
480
|
-
"quiet_mode": false,
|
|
481
|
-
"debug": false,
|
|
482
|
-
"log_dir": null,
|
|
483
|
-
"keep_thinking": false,
|
|
484
|
-
"session_recovery": true,
|
|
485
|
-
"auto_resume": true,
|
|
486
|
-
"resume_text": "continue",
|
|
487
|
-
"empty_response_max_attempts": 4,
|
|
488
|
-
"empty_response_retry_delay_ms": 2000,
|
|
489
|
-
"tool_id_recovery": true,
|
|
490
|
-
"claude_tool_hardening": true,
|
|
491
|
-
"proactive_token_refresh": true,
|
|
492
|
-
"proactive_refresh_buffer_seconds": 1800,
|
|
493
|
-
"proactive_refresh_check_interval_seconds": 300,
|
|
494
|
-
"auto_update": true,
|
|
320
|
+
// === Signature Cache (for keep_thinking=true) ===
|
|
495
321
|
"signature_cache": {
|
|
496
322
|
"enabled": true,
|
|
497
|
-
"memory_ttl_seconds": 3600,
|
|
498
|
-
"disk_ttl_seconds": 172800,
|
|
499
|
-
"write_interval_seconds": 60
|
|
323
|
+
"memory_ttl_seconds": 3600, // 1 hour in-memory
|
|
324
|
+
"disk_ttl_seconds": 172800, // 48 hours on disk
|
|
325
|
+
"write_interval_seconds": 60 // Background write interval
|
|
500
326
|
}
|
|
501
327
|
}
|
|
502
328
|
```
|
|
503
329
|
|
|
504
|
-
|
|
330
|
+
</details>
|
|
505
331
|
|
|
506
|
-
|
|
507
|
-
|--------|---------|-------------|
|
|
508
|
-
| `quiet_mode` | `false` | Suppress toast notifications (except recovery) |
|
|
509
|
-
| `debug` | `false` | Enable debug logging to file |
|
|
510
|
-
| `log_dir` | OS default | Custom directory for debug logs |
|
|
511
|
-
| `auto_update` | `true` | Enable automatic plugin updates |
|
|
332
|
+
## Multi-Account Setup
|
|
512
333
|
|
|
513
|
-
|
|
334
|
+
Add multiple Google accounts for higher combined quotas. The plugin automatically rotates between accounts when one is rate-limited.
|
|
514
335
|
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
| `resume_text` | `"continue"` | Text to send when auto-resuming |
|
|
336
|
+
```bash
|
|
337
|
+
# Add accounts
|
|
338
|
+
opencode auth login
|
|
339
|
+
```
|
|
520
340
|
|
|
521
|
-
|
|
341
|
+
## Compatible Plugins
|
|
522
342
|
|
|
523
|
-
|
|
524
|
-
|--------|---------|-------------|
|
|
525
|
-
| `keep_thinking` | `false` | Preserve thinking blocks (may cause signature errors) |
|
|
526
|
-
| `signature_cache.enabled` | `true` | Cache signatures to disk |
|
|
527
|
-
| `signature_cache.memory_ttl_seconds` | `3600` | In-memory cache TTL |
|
|
528
|
-
| `signature_cache.disk_ttl_seconds` | `172800` | Disk cache TTL (48h) |
|
|
343
|
+
This plugin works alongside other OpenCode plugins. Some important notes:
|
|
529
344
|
|
|
530
|
-
|
|
345
|
+
### Plugin Ordering
|
|
531
346
|
|
|
532
|
-
|
|
533
|
-
|--------|---------|-------------|
|
|
534
|
-
| `empty_response_max_attempts` | `4` | Retries for empty API responses |
|
|
535
|
-
| `empty_response_retry_delay_ms` | `2000` | Delay between retries |
|
|
536
|
-
| `tool_id_recovery` | `true` | Fix mismatched tool IDs from context compaction |
|
|
537
|
-
| `claude_tool_hardening` | `true` | Prevent tool parameter hallucination |
|
|
347
|
+
If using `@tarquinen/opencode-dcp` (Dynamic Context Protocol), **our plugin must be listed first**:
|
|
538
348
|
|
|
539
|
-
|
|
349
|
+
```json
|
|
350
|
+
{
|
|
351
|
+
"plugins": [
|
|
352
|
+
"opencode-antigravity-auth@latest",
|
|
353
|
+
"@tarquinen/opencode-dcp@1.1.2"
|
|
354
|
+
]
|
|
355
|
+
}
|
|
356
|
+
```
|
|
540
357
|
|
|
541
|
-
|
|
542
|
-
|--------|---------|-------------|
|
|
543
|
-
| `proactive_token_refresh` | `true` | Refresh tokens before expiry |
|
|
544
|
-
| `proactive_refresh_buffer_seconds` | `1800` | Refresh 30min before expiry |
|
|
545
|
-
| `proactive_refresh_check_interval_seconds` | `300` | Check interval (5min) |
|
|
358
|
+
### Plugins You Don't Need
|
|
546
359
|
|
|
547
|
-
|
|
360
|
+
- **gemini-auth plugins** - Not needed. This plugin handles all Google OAuth authentication.
|
|
548
361
|
|
|
549
|
-
|
|
362
|
+
### Rate Limit Considerations
|
|
550
363
|
|
|
551
|
-
|
|
552
|
-
|----------|--------|-------------|
|
|
553
|
-
| `OPENCODE_ANTIGRAVITY_QUIET` | `1` | Suppress toast notifications |
|
|
554
|
-
| `OPENCODE_ANTIGRAVITY_DEBUG` | `1`, `2` | Debug logging level (2 = verbose) |
|
|
555
|
-
| `OPENCODE_ANTIGRAVITY_LOG_DIR` | path | Custom log directory |
|
|
556
|
-
| `OPENCODE_ANTIGRAVITY_KEEP_THINKING` | `1` | Preserve thinking blocks |
|
|
557
|
-
| `OPENCODE_ANTIGRAVITY_SESSION_RECOVERY` | `0`/`1` | Enable/disable session recovery |
|
|
558
|
-
| `OPENCODE_ANTIGRAVITY_AUTO_RESUME` | `0`/`1` | Enable/disable auto-resume |
|
|
559
|
-
| `OPENCODE_ANTIGRAVITY_RESUME_TEXT` | string | Custom resume text |
|
|
560
|
-
| `OPENCODE_ANTIGRAVITY_AUTO_UPDATE` | `0`/`1` | Enable/disable auto-updates |
|
|
364
|
+
- **oh-my-opencode** - This plugin may make background API calls that consume your quota. If you're hitting rate limits unexpectedly, check if oh-my-opencode is making requests.
|
|
561
365
|
|
|
562
|
-
##
|
|
366
|
+
## Migration Guide (v1.2.7+)
|
|
563
367
|
|
|
564
|
-
|
|
368
|
+
<details>
|
|
369
|
+
<summary>If upgrading from v1.2.6 or earlier, follow these steps:</summary>
|
|
565
370
|
|
|
566
|
-
|
|
371
|
+
### Step 1: Clear Old Tokens
|
|
567
372
|
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
Expected 'thinking' or 'redacted_thinking', but found 'text'
|
|
373
|
+
```bash
|
|
374
|
+
rm -rf ~/.config/opencode/antigravity-tokens/
|
|
571
375
|
```
|
|
572
376
|
|
|
573
|
-
|
|
377
|
+
### Step 2: Update opencode.json
|
|
574
378
|
|
|
575
|
-
|
|
576
|
-
|-------|--------|
|
|
577
|
-
| DCP → antigravity | Works - we fix DCP's synthetic messages |
|
|
578
|
-
| antigravity → DCP | Broken - DCP creates messages after our fix runs |
|
|
379
|
+
Replace your old config with:
|
|
579
380
|
|
|
580
|
-
**Correct:**
|
|
581
381
|
```json
|
|
582
382
|
{
|
|
583
|
-
"
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
]
|
|
383
|
+
"plugins": ["opencode-antigravity-auth@latest"],
|
|
384
|
+
"provider": "google",
|
|
385
|
+
"model": "google/antigravity-gemini-3-flash"
|
|
587
386
|
}
|
|
588
387
|
```
|
|
589
388
|
|
|
590
|
-
|
|
389
|
+
### Step 3: Create antigravity.json (Optional)
|
|
390
|
+
|
|
391
|
+
If you had custom settings, migrate them to `~/.config/opencode/antigravity.json`:
|
|
392
|
+
|
|
591
393
|
```json
|
|
592
394
|
{
|
|
593
|
-
"
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
]
|
|
395
|
+
"$schema": "https://raw.githubusercontent.com/anthropics/opencode-antigravity-auth/main/assets/antigravity.schema.json",
|
|
396
|
+
"quiet_mode": false,
|
|
397
|
+
"debug": false
|
|
597
398
|
}
|
|
598
399
|
```
|
|
599
400
|
|
|
600
|
-
###
|
|
401
|
+
### Step 4: Re-authenticate
|
|
601
402
|
|
|
602
|
-
|
|
403
|
+
Run OpenCode once. A browser window will open for Google OAuth:
|
|
603
404
|
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
429 Too Many Requests
|
|
405
|
+
```bash
|
|
406
|
+
opencode
|
|
607
407
|
```
|
|
608
408
|
|
|
609
|
-
|
|
610
|
-
- Increase your account pool (add more OAuth accounts via `opencode auth login`)
|
|
611
|
-
- Reduce parallel subagent count in your configuration
|
|
612
|
-
|
|
613
|
-
**Status:** A file-based reservation system to coordinate account selection across processes is planned but not yet implemented.
|
|
409
|
+
### Breaking Changes
|
|
614
410
|
|
|
615
|
-
|
|
411
|
+
| Old (v1.2.6) | New (v1.2.7+) |
|
|
412
|
+
|--------------|---------------|
|
|
413
|
+
| `OPENCODE_ANTIGRAVITY_*` env vars | `~/.config/opencode/antigravity.json` |
|
|
414
|
+
| `gemini-3-pro` | `google/antigravity-gemini-3-pro-low` |
|
|
415
|
+
| `claude-sonnet-4-5` | `google/antigravity-claude-sonnet-4-5` |
|
|
616
416
|
|
|
617
|
-
|
|
417
|
+
</details>
|
|
618
418
|
|
|
619
|
-
|
|
620
|
-
- **[Antigravity API Spec](docs/ANTIGRAVITY_API_SPEC.md)** - API reference and schema support matrix
|
|
419
|
+
## E2E Testing
|
|
621
420
|
|
|
622
|
-
|
|
421
|
+
The plugin includes regression tests for stability verification. Tests consume API quota.
|
|
623
422
|
|
|
624
|
-
|
|
423
|
+
```bash
|
|
424
|
+
# Sanity tests (7 tests, ~5 min)
|
|
425
|
+
npx tsx script/test-regression.ts --sanity
|
|
625
426
|
|
|
626
|
-
|
|
427
|
+
# Heavy tests (4 tests, ~30 min) - stress testing with 8-50 turn conversations
|
|
428
|
+
npx tsx script/test-regression.ts --heavy
|
|
627
429
|
|
|
628
|
-
|
|
430
|
+
# Concurrent tests (3 tests) - rate limit handling with 5-10 parallel requests
|
|
431
|
+
npx tsx script/test-regression.ts --category concurrency
|
|
629
432
|
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
- **Multi-turn Stability:** Thinking signatures are cached and restored using a stable `sessionId`, preventing "invalid signature" errors in long conversations.
|
|
633
|
-
- **Thinking Budget Safety:** If a thinking budget is enabled, the plugin ensures output token limits are high enough to avoid budget-related errors.
|
|
634
|
-
- **Tool Use:** Tool calls and responses are assigned proper IDs, and tool calling is set to validated mode for better Claude compatibility.
|
|
433
|
+
# Run specific test
|
|
434
|
+
npx tsx script/test-regression.ts --test thinking-tool-use
|
|
635
435
|
|
|
636
|
-
|
|
436
|
+
# List tests without running
|
|
437
|
+
npx tsx script/test-regression.ts --dry-run
|
|
438
|
+
```
|
|
637
439
|
|
|
638
440
|
## Debugging
|
|
639
441
|
|
|
640
|
-
Enable debug logging
|
|
442
|
+
Enable debug logging:
|
|
641
443
|
|
|
642
444
|
```bash
|
|
643
|
-
|
|
644
|
-
|
|
445
|
+
# Via environment
|
|
446
|
+
OPENCODE_ANTIGRAVITY_DEBUG=1 opencode
|
|
645
447
|
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
- **TUI Reasoning View:** Debug logs are injected into the model's "thinking/reasoning" blocks in the Opencode TUI (requires thinking-capable models).
|
|
649
|
-
- **Log Files:** Logs are written to `~/.config/opencode/antigravity-logs/antigravity-debug-<timestamp>.log`. Override with `OPENCODE_ANTIGRAVITY_LOG_DIR`.
|
|
650
|
-
- **Auto-Stripping:** Injected debug blocks are automatically stripped from outgoing requests to prevent leaking into conversation history.
|
|
651
|
-
|
|
652
|
-
## Development
|
|
653
|
-
|
|
654
|
-
```bash
|
|
655
|
-
npm install
|
|
448
|
+
# Via config
|
|
449
|
+
echo '{"debug": true}' > ~/.config/opencode/antigravity.json
|
|
656
450
|
```
|
|
657
451
|
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
### Intended use
|
|
661
|
-
|
|
662
|
-
- Personal / internal development only
|
|
663
|
-
- Respect internal quotas and data handling policies
|
|
664
|
-
- Not for production services or bypassing intended limits
|
|
665
|
-
|
|
666
|
-
### Not suitable for
|
|
667
|
-
|
|
668
|
-
- Production application traffic
|
|
669
|
-
- High-volume automated extraction
|
|
670
|
-
- Any use that violates Acceptable Use Policies
|
|
671
|
-
|
|
672
|
-
### ⚠️ Warning (assumption of risk)
|
|
673
|
-
|
|
674
|
-
By using this plugin, you acknowledge and accept the following:
|
|
675
|
-
|
|
676
|
-
- **Terms of Service risk:** This approach may violate the Terms of Service of AI model providers (Anthropic, OpenAI, etc.). You are solely responsible for ensuring compliance with all applicable terms and policies.
|
|
677
|
-
- **Account risk:** Providers may detect this usage pattern and take punitive action, including suspension, permanent ban, or loss of access to paid subscriptions.
|
|
678
|
-
- **No guarantees:** Providers may change APIs, authentication, or policies at any time, which can break this method without notice.
|
|
679
|
-
- **Assumption of risk:** You assume all legal, financial, and technical risks. The authors and contributors of this project bear no responsibility for any consequences arising from your use.
|
|
680
|
-
|
|
681
|
-
Use at your own risk. Proceed only if you understand and accept these risks.
|
|
682
|
-
|
|
683
|
-
## Legal
|
|
684
|
-
|
|
685
|
-
- Not affiliated with Google. This is an independent open-source project and is not endorsed by, sponsored by, or affiliated with Google LLC.
|
|
686
|
-
- "Antigravity", "Gemini", "Google Cloud", and "Google" are trademarks of Google LLC.
|
|
687
|
-
- Software is provided "as is", without warranty. You are responsible for complying with Google's Terms of Service and Acceptable Use Policy.
|
|
688
|
-
|
|
689
|
-
## Credits
|
|
690
|
-
|
|
691
|
-
Built with help and inspiration from:
|
|
692
|
-
|
|
693
|
-
- [opencode-gemini-auth](https://github.com/jenslys/opencode-gemini-auth) — Gemini OAuth groundwork by [@jenslys](https://github.com/jenslys)
|
|
694
|
-
- [CLIProxyAPI](https://github.com/router-for-me/CLIProxyAPI) — Helpful reference for Antigravity API
|
|
695
|
-
|
|
696
|
-
## Support
|
|
452
|
+
Logs are written to `~/.config/opencode/antigravity-logs/` (or `log_dir` if configured).
|
|
697
453
|
|
|
698
|
-
|
|
454
|
+
## Documentation
|
|
699
455
|
|
|
700
|
-
[
|
|
456
|
+
- [Architecture](docs/ARCHITECTURE.md) - Plugin internals and request flow
|
|
457
|
+
- [API Spec](docs/ANTIGRAVITY_API_SPEC.md) - Antigravity API reference
|
|
701
458
|
|
|
459
|
+
## License
|
|
702
460
|
|
|
461
|
+
MIT
|