Skip to content

Commit 13acb4b

Browse files
committed
feat: align Claude thinking variants with API effort levels, remove gemini-3-pro
- Add medium/high/max thinking variants for Claude Opus 4.6 (low/medium/high/max) - Add low/medium/high thinking variants for Claude Sonnet 4.6 Thinking - Add 'max' to ThinkingTier type, TIER_REGEX, and THINKING_TIER_BUDGETS - Remove antigravity-gemini-3-pro model definition - Remove gemini-3-pro-preview CLI model definition - Update all aliases, tests, docs, and scripts - Include claude-sonnet-4-6-thinking model support (supersedes PR #496) Supersedes: #496
1 parent 387f6c1 commit 13acb4b

24 files changed

Lines changed: 150 additions & 250 deletions

README.md

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
77
[![X (Twitter)](https://img.shields.io/badge/X-@dopesalmon-000000?style=flat&logo=x)](https://x.com/dopesalmon)
88

9-
Enable Opencode to authenticate against **Antigravity** (Google's IDE) via OAuth so you can use Antigravity rate limits and access models like `gemini-3-pro` and `claude-opus-4-6-thinking` with your Google credentials.
9+
Enable Opencode to authenticate against **Antigravity** (Google's IDE) via OAuth so you can use Antigravity rate limits and access models like `gemini-3.1-pro` and `claude-opus-4-6-thinking` with your Google credentials.
1010

1111
## What You Get
1212

13-
- **Claude Opus 4.6, Sonnet 4.6** and **Gemini 3 Pro/Flash** via Google OAuth
13+
- **Claude Opus 4.6, Sonnet 4.6** and **Gemini 3.1 Pro/Flash** via Google OAuth
1414
- **Multi-account support** — add multiple Google accounts, auto-rotates when rate-limited
1515
- **Dual quota system** — access both Antigravity and Gemini CLI quotas from one plugin
1616
- **Thinking models** — extended thinking for Claude and Gemini 3 with configurable budgets
@@ -117,12 +117,11 @@ opencode run "Hello" --model=google/antigravity-claude-opus-4-6-thinking --varia
117117

118118
| Model | Variants | Notes |
119119
|-------|----------|-------|
120-
| `antigravity-gemini-3-pro` | low, high | Gemini 3 Pro with thinking |
121120
| `antigravity-gemini-3.1-pro` | low, high | Gemini 3.1 Pro with thinking (rollout-dependent) |
122121
| `antigravity-gemini-3-flash` | minimal, low, medium, high | Gemini 3 Flash with thinking |
123122
| `antigravity-claude-sonnet-4-6` || Claude Sonnet 4.6 |
124123
| `antigravity-claude-sonnet-4-6-thinking` | low, medium, high | Claude Sonnet 4.6 with extended thinking |
125-
| `antigravity-claude-opus-4-6-thinking` | low, max | Claude Opus 4.6 with extended thinking |
124+
| `antigravity-claude-opus-4-6-thinking` | low, medium, high, max | Claude Opus 4.6 with extended thinking |
126125

127126
**Gemini CLI quota** (separate from Antigravity; used when `cli_first` is true or as fallback):
128127

@@ -131,7 +130,6 @@ opencode run "Hello" --model=google/antigravity-claude-opus-4-6-thinking --varia
131130
| `gemini-2.5-flash` | Gemini 2.5 Flash |
132131
| `gemini-2.5-pro` | Gemini 2.5 Pro |
133132
| `gemini-3-flash-preview` | Gemini 3 Flash (preview) |
134-
| `gemini-3-pro-preview` | Gemini 3 Pro (preview) |
135133
| `gemini-3.1-pro-preview` | Gemini 3.1 Pro (preview, rollout-dependent) |
136134
| `gemini-3.1-pro-preview-customtools` | Gemini 3.1 Pro Preview Custom Tools (preview, rollout-dependent) |
137135

@@ -161,15 +159,6 @@ Add this to your `~/.config/opencode/opencode.json`:
161159
"provider": {
162160
"google": {
163161
"models": {
164-
"antigravity-gemini-3-pro": {
165-
"name": "Gemini 3 Pro (Antigravity)",
166-
"limit": { "context": 1048576, "output": 65535 },
167-
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
168-
"variants": {
169-
"low": { "thinkingLevel": "low" },
170-
"high": { "thinkingLevel": "high" }
171-
}
172-
},
173162
"antigravity-gemini-3.1-pro": {
174163
"name": "Gemini 3.1 Pro (Antigravity)",
175164
"limit": { "context": 1048576, "output": 65535 },
@@ -201,7 +190,8 @@ Add this to your `~/.config/opencode/opencode.json`:
201190
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
202191
"variants": {
203192
"low": { "thinkingConfig": { "thinkingBudget": 8192 } },
204-
"max": { "thinkingConfig": { "thinkingBudget": 32768 } }
193+
"medium": { "thinkingConfig": { "thinkingBudget": 16384 } },
194+
"high": { "thinkingConfig": { "thinkingBudget": 32768 } }
205195
}
206196
},
207197
"antigravity-claude-opus-4-6-thinking": {
@@ -210,7 +200,9 @@ Add this to your `~/.config/opencode/opencode.json`:
210200
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
211201
"variants": {
212202
"low": { "thinkingConfig": { "thinkingBudget": 8192 } },
213-
"max": { "thinkingConfig": { "thinkingBudget": 32768 } }
203+
"medium": { "thinkingConfig": { "thinkingBudget": 16384 } },
204+
"high": { "thinkingConfig": { "thinkingBudget": 32768 } },
205+
"max": { "thinkingConfig": { "thinkingBudget": 65536 } }
214206
}
215207
},
216208
"gemini-2.5-flash": {
@@ -228,11 +220,6 @@ Add this to your `~/.config/opencode/opencode.json`:
228220
"limit": { "context": 1048576, "output": 65536 },
229221
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
230222
},
231-
"gemini-3-pro-preview": {
232-
"name": "Gemini 3 Pro Preview (Gemini CLI)",
233-
"limit": { "context": 1048576, "output": 65535 },
234-
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
235-
},
236223
"gemini-3.1-pro-preview": {
237224
"name": "Gemini 3.1 Pro Preview (Gemini CLI)",
238225
"limit": { "context": 1048576, "output": 65535 },
@@ -437,7 +424,7 @@ If you encounter errors during a session:
437424
{
438425
"google_auth": false,
439426
"agents": {
440-
"frontend-ui-ux-engineer": { "model": "google/antigravity-gemini-3-pro" },
427+
"frontend-ui-ux-engineer": { "model": "google/antigravity-gemini-3.1-pro" },
441428
"document-writer": { "model": "google/antigravity-gemini-3-flash" }
442429
}
443430
}
@@ -575,7 +562,7 @@ Disable built-in auth and override agent models in `oh-my-opencode.json`:
575562
{
576563
"google_auth": false,
577564
"agents": {
578-
"frontend-ui-ux-engineer": { "model": "google/antigravity-gemini-3-pro" },
565+
"frontend-ui-ux-engineer": { "model": "google/antigravity-gemini-3.1-pro" },
579566
"document-writer": { "model": "google/antigravity-gemini-3-flash" },
580567
"multimodal-looker": { "model": "google/antigravity-gemini-3-flash" }
581568
}

docs/ANTIGRAVITY_API_SPEC.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ Accept: text/event-stream
8181
| Claude Sonnet 4.6 | `claude-sonnet-4-6` | Anthropic | ✅ Verified |
8282
| Claude Sonnet 4.6 Thinking | `claude-sonnet-4-6-thinking` | Anthropic | ⏳ Pending Rollout |
8383
| Claude Opus 4.6 Thinking | `claude-opus-4-6-thinking` | Anthropic | ✅ Verified |
84-
| Gemini 3 Pro High | `gemini-3-pro-high` | Google | ✅ Verified |
85-
| Gemini 3 Pro Low | `gemini-3-pro-low` | Google | ✅ Verified |
8684
| GPT-OSS 120B Medium | `gpt-oss-120b-medium` | Other | ✅ Verified |
8785

8886
---

docs/MODEL-VARIANTS.md

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -50,31 +50,15 @@ The plugin accepts different variant formats depending on the model family:
5050

5151
Gemini 3 models use string-based thinking levels. Available levels differ by model:
5252

53-
| Level | Flash | Pro | Description |
54-
|-------|-------|-----|-------------|
53+
| Level | Flash | Pro (3.1) | Description |
54+
|-------|-------|-------------|-------------|
5555
| `minimal` ||| Minimal thinking, lowest latency |
5656
| `low` ||| Light thinking |
5757
| `medium` ||| Balanced thinking |
5858
| `high` ||| Maximum thinking (default) |
5959

6060
> **Note:** The API rejects invalid levels (e.g., `"minimal"` on Pro). Configure variants accordingly.
6161
62-
### Gemini 3 Pro Example
63-
64-
```json
65-
{
66-
"antigravity-gemini-3-pro": {
67-
"name": "Gemini 3 Pro (Antigravity)",
68-
"limit": { "context": 1048576, "output": 65535 },
69-
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
70-
"variants": {
71-
"low": { "thinkingLevel": "low" },
72-
"high": { "thinkingLevel": "high" }
73-
}
74-
}
75-
}
76-
```
77-
7862
### Gemini 3 Flash Example
7963

8064
```json
@@ -99,10 +83,10 @@ Gemini 3 models use string-based thinking levels. Available levels differ by mod
9983

10084
Claude models use token-based thinking budgets:
10185

102-
| Variant | Budget | Description |
103-
|---------|--------|-------------|
104-
| `low` | 8192 | Light thinking |
105-
| `max` | 32768 | Maximum thinking |
86+
| Model | Variants | Budgets |
87+
|-------|----------|---------|
88+
| `antigravity-claude-opus-4-6-thinking` | `low`, `medium`, `high`, `max` | 8192, 16384, 32768, 65536 |
89+
| `antigravity-claude-sonnet-4-6-thinking` | `low`, `medium`, `high` | 8192, 16384, 32768 |
10690

10791
### Claude Example
10892

@@ -114,7 +98,8 @@ Claude models use token-based thinking budgets:
11498
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
11599
"variants": {
116100
"low": { "thinkingConfig": { "thinkingBudget": 8192 } },
117-
"max": { "thinkingConfig": { "thinkingBudget": 32768 } }
101+
"medium": { "thinkingConfig": { "thinkingBudget": 16384 } },
102+
"high": { "thinkingConfig": { "thinkingBudget": 32768 } }
118103
}
119104
},
120105
"antigravity-claude-opus-4-6-thinking": {
@@ -123,7 +108,9 @@ Claude models use token-based thinking budgets:
123108
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
124109
"variants": {
125110
"low": { "thinkingConfig": { "thinkingBudget": 8192 } },
126-
"max": { "thinkingConfig": { "thinkingBudget": 32768 } }
111+
"medium": { "thinkingConfig": { "thinkingBudget": 16384 } },
112+
"high": { "thinkingConfig": { "thinkingBudget": 32768 } },
113+
"max": { "thinkingConfig": { "thinkingBudget": 65536 } }
127114
}
128115
}
129116
}
@@ -166,9 +153,10 @@ Tier-suffixed model names are still accepted:
166153
- `antigravity-claude-opus-4-6-thinking-low`
167154
- `antigravity-claude-opus-4-6-thinking-medium`
168155
- `antigravity-claude-opus-4-6-thinking-high`
169-
- `antigravity-gemini-3-pro-low`
170-
- `antigravity-gemini-3-pro-high`
171-
- `gemini-3-pro-low`
156+
- `antigravity-claude-opus-4-6-thinking-max`
157+
- `antigravity-claude-sonnet-4-6-thinking-low`
158+
- `antigravity-claude-sonnet-4-6-thinking-medium`
159+
- `antigravity-claude-sonnet-4-6-thinking-high`
172160
- `gemini-3-flash-medium`
173161

174162
However, **we recommend using simplified model names with variants** for:

docs/TROUBLESHOOTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ v1.2.7+ uses explicit `antigravity-` prefix:
431431

432432
| Old Name | New Name |
433433
|----------|----------|
434-
| `gemini-3-pro-low` | `antigravity-gemini-3-pro` |
434+
| `gemini-3.1-pro-low` | `antigravity-gemini-3.1-pro` |
435435
| `claude-sonnet-4-6` | `antigravity-claude-sonnet-4-6` |
436436

437437
Use the `antigravity-` prefixed model names shown above.

script/test-cross-model-e2e.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Tests fix for "Invalid `signature` in `thinking` block" error
44
#
55
# Models tested:
6-
# 1. Gemini (google/antigravity-gemini-3-pro-low, gemini-3-flash)
6+
# 1. Gemini (google/antigravity-gemini-3.1-pro-low, gemini-3-flash)
77
# 2. Claude via Anthropic (anthropic/claude-opus-4-5)
88
# 3. Claude via Google (google/antigravity-claude-*-thinking-*)
99
# 4. OpenAI (openai/gpt-5.2-medium)
@@ -42,7 +42,7 @@ echo ""
4242
# Test 1: Gemini → Anthropic Claude (original bug + direct Anthropic API)
4343
echo "Test 1: Gemini Pro → Anthropic Claude Opus (direct API)"
4444
log_info "Step 1: Gemini with thinking + tool..."
45-
opencode run -m google/antigravity-gemini-3-pro-low \
45+
opencode run -m google/antigravity-gemini-3.1-pro-low \
4646
"Run: echo 'Test1-Gemini'. Think about sequences." \
4747
> /tmp/e2e-t1-s1.log 2>&1 || true
4848

@@ -67,7 +67,7 @@ echo ""
6767
# Test 2: Gemini → Google Claude (Google-hosted Claude)
6868
echo "Test 2: Gemini Pro → Google Claude Opus Thinking"
6969
log_info "Step 1: Gemini with thinking + tool..."
70-
opencode run -m google/antigravity-gemini-3-pro-low \
70+
opencode run -m google/antigravity-gemini-3.1-pro-low \
7171
"Run: echo 'Test2-Gemini'. Think about this." \
7272
> /tmp/e2e-t2-s1.log 2>&1 || true
7373

@@ -92,7 +92,7 @@ echo ""
9292
# Test 3: Gemini → OpenAI
9393
echo "Test 3: Gemini Pro → OpenAI GPT-5.2"
9494
log_info "Step 1: Gemini with thinking + tool..."
95-
opencode run -m google/antigravity-gemini-3-pro-low \
95+
opencode run -m google/antigravity-gemini-3.1-pro-low \
9696
"Run: echo 'Test3-Gemini'. Think about AI models." \
9797
> /tmp/e2e-t3-s1.log 2>&1 || true
9898

@@ -129,7 +129,7 @@ if [ -z "$SID" ]; then
129129
else
130130
log_info "Session: $SID"
131131
log_info "Step 2: Gemini + thinking + tool..."
132-
opencode run -s "$SID" -m google/antigravity-gemini-3-pro-low \
132+
opencode run -s "$SID" -m google/antigravity-gemini-3.1-pro-low \
133133
"Run: echo 'Test4-Gemini'. Think about reversal." \
134134
> /tmp/e2e-t4-s2.log 2>&1 || true
135135

@@ -173,7 +173,7 @@ echo ""
173173
# Test 6: 5-Model Round-Robin (all models in sequence)
174174
echo "Test 6: 5-Model Round-Robin"
175175
log_info "Turn 1: Gemini Pro Low..."
176-
opencode run -m google/antigravity-gemini-3-pro-low \
176+
opencode run -m google/antigravity-gemini-3.1-pro-low \
177177
"Run: echo 'Turn1'. Think about the chain." \
178178
> /tmp/e2e-t6-s1.log 2>&1 || true
179179

script/test-cross-model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function runTests(): void {
5858
let failed = 0;
5959

6060
console.log('Test 1: Model family detection');
61-
const geminiFamily = getModelFamily('gemini-3-pro-low');
61+
const geminiFamily = getModelFamily('gemini-3.1-pro-low');
6262
const claudeFamily = getModelFamily('claude-opus-4-6-thinking-medium');
6363
if (geminiFamily === 'gemini' && claudeFamily === 'claude') {
6464
console.log(' ✅ PASS: Model families detected correctly');

script/test-gemini-cli-e2e.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Models tested:
66
# 1. google/gemini-2.5-pro
77
# 2. google/gemini-2.5-flash
8-
# 3. google/gemini-3-pro-preview
8+
# 3. google/gemini-3.1-pro-preview
99
# 4. google/gemini-3-flash-preview
1010

1111
set -euo pipefail
@@ -94,8 +94,8 @@ echo "Test 3: google/gemini-3-flash-preview"
9494
test_model "google/gemini-3-flash-preview" "gemini-3-flash-preview" || true
9595
echo ""
9696

97-
echo "Test 4: google/gemini-3-pro-preview"
98-
test_model "google/gemini-3-pro-preview" "gemini-3-pro-preview" || true
97+
echo "Test 4: google/gemini-3.1-pro-preview"
98+
test_model "google/gemini-3.1-pro-preview" "gemini-3.1-pro-preview" || true
9999
echo ""
100100

101101
# Test 5: Cross-model session (gemini-cli → antigravity)
@@ -128,8 +128,8 @@ echo ""
128128

129129
# Test 6: Reverse cross-model (antigravity → gemini-cli)
130130
echo "Test 6: Cross-model session (antigravity → gemini-cli)"
131-
log_info "Step 1: Start with antigravity-gemini-3-pro-low..."
132-
timeout 60 opencode run -m google/antigravity-gemini-3-pro-low \
131+
log_info "Step 1: Start with antigravity-gemini-3.1-pro-low..."
132+
timeout 60 opencode run -m google/antigravity-gemini-3.1-pro-low \
133133
"Say: ANTIGRAVITY_START" \
134134
2>&1 > /tmp/gemini-cli-e2e-reverse-s1.log || true
135135

script/test-models.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,24 @@ interface ModelTest {
99
const MODELS: ModelTest[] = [
1010
// Gemini CLI (direct Google API)
1111
{ model: "google/gemini-3-flash-preview", category: "gemini-cli" },
12-
{ model: "google/gemini-3-pro-preview", category: "gemini-cli" },
12+
{ model: "google/gemini-3.1-pro-preview", category: "gemini-cli" },
1313
{ model: "google/gemini-2.5-pro", category: "gemini-cli" },
1414
{ model: "google/gemini-2.5-flash", category: "gemini-cli" },
1515

1616
// Antigravity Gemini
17-
{ model: "google/antigravity-gemini-3-pro-low", category: "antigravity-gemini" },
18-
{ model: "google/antigravity-gemini-3-pro-high", category: "antigravity-gemini" },
17+
{ model: "google/antigravity-gemini-3.1-pro-low", category: "antigravity-gemini" },
18+
{ model: "google/antigravity-gemini-3.1-pro-high", category: "antigravity-gemini" },
1919
{ model: "google/antigravity-gemini-3-flash", category: "antigravity-gemini" },
2020

2121
// Antigravity Claude
2222
{ model: "google/antigravity-claude-sonnet-4-6", category: "antigravity-claude" },
23+
{ model: "google/antigravity-claude-sonnet-4-6-thinking-low", category: "antigravity-claude" },
24+
{ model: "google/antigravity-claude-sonnet-4-6-thinking-medium", category: "antigravity-claude" },
25+
{ model: "google/antigravity-claude-sonnet-4-6-thinking-high", category: "antigravity-claude" },
2326
{ model: "google/antigravity-claude-opus-4-6-thinking-low", category: "antigravity-claude" },
2427
{ model: "google/antigravity-claude-opus-4-6-thinking-medium", category: "antigravity-claude" },
2528
{ model: "google/antigravity-claude-opus-4-6-thinking-high", category: "antigravity-claude" },
29+
{ model: "google/antigravity-claude-opus-4-6-thinking-max", category: "antigravity-claude" },
2630
];
2731

2832
const TEST_PROMPT = "Reply with exactly one word: WORKING";

scripts/setup-opencode-pi.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ if [ ! -f "$CONFIG_FILE" ]; then
3232
"provider": {
3333
"google": {
3434
"models": {
35-
"antigravity-gemini-3-pro": {
36-
"name": "Gemini 3 Pro (Antigravity)",
35+
"antigravity-gemini-3.1-pro": {
36+
"name": "Gemini 3.1 Pro (Antigravity)",
3737
"limit": { "context": 1048576, "output": 65535 },
3838
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
3939
"variants": {

src/constants.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe("getRandomizedHeaders", () => {
2727
})
2828

2929
it("ignores requested model and keeps static User-Agent", () => {
30-
const headers = getRandomizedHeaders("gemini-cli", "gemini-3-pro-preview")
30+
const headers = getRandomizedHeaders("gemini-cli", "gemini-3.1-pro-preview")
3131
expect(headers["User-Agent"]).toBe("google-api-nodejs-client/9.15.1")
3232
})
3333
})

0 commit comments

Comments
 (0)