Skip to content

Commit a326ffd

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 a326ffd

22 files changed

Lines changed: 172 additions & 206 deletions

README.md

Lines changed: 11 additions & 18 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,7 @@ 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) |
133+
| `gemini-3-pro-preview` | Gemini 3 Pro Preview |
135134
| `gemini-3.1-pro-preview` | Gemini 3.1 Pro (preview, rollout-dependent) |
136135
| `gemini-3.1-pro-preview-customtools` | Gemini 3.1 Pro Preview Custom Tools (preview, rollout-dependent) |
137136

@@ -161,15 +160,6 @@ Add this to your `~/.config/opencode/opencode.json`:
161160
"provider": {
162161
"google": {
163162
"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-
},
173163
"antigravity-gemini-3.1-pro": {
174164
"name": "Gemini 3.1 Pro (Antigravity)",
175165
"limit": { "context": 1048576, "output": 65535 },
@@ -201,7 +191,8 @@ Add this to your `~/.config/opencode/opencode.json`:
201191
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
202192
"variants": {
203193
"low": { "thinkingConfig": { "thinkingBudget": 8192 } },
204-
"max": { "thinkingConfig": { "thinkingBudget": 32768 } }
194+
"medium": { "thinkingConfig": { "thinkingBudget": 16384 } },
195+
"high": { "thinkingConfig": { "thinkingBudget": 32768 } }
205196
}
206197
},
207198
"antigravity-claude-opus-4-6-thinking": {
@@ -210,7 +201,9 @@ Add this to your `~/.config/opencode/opencode.json`:
210201
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
211202
"variants": {
212203
"low": { "thinkingConfig": { "thinkingBudget": 8192 } },
213-
"max": { "thinkingConfig": { "thinkingBudget": 32768 } }
204+
"medium": { "thinkingConfig": { "thinkingBudget": 16384 } },
205+
"high": { "thinkingConfig": { "thinkingBudget": 32768 } },
206+
"max": { "thinkingConfig": { "thinkingBudget": 65536 } }
214207
}
215208
},
216209
"gemini-2.5-flash": {
@@ -437,7 +430,7 @@ If you encounter errors during a session:
437430
{
438431
"google_auth": false,
439432
"agents": {
440-
"frontend-ui-ux-engineer": { "model": "google/antigravity-gemini-3-pro" },
433+
"frontend-ui-ux-engineer": { "model": "google/antigravity-gemini-3.1-pro" },
441434
"document-writer": { "model": "google/antigravity-gemini-3-flash" }
442435
}
443436
}
@@ -575,7 +568,7 @@ Disable built-in auth and override agent models in `oh-my-opencode.json`:
575568
{
576569
"google_auth": false,
577570
"agents": {
578-
"frontend-ui-ux-engineer": { "model": "google/antigravity-gemini-3-pro" },
571+
"frontend-ui-ux-engineer": { "model": "google/antigravity-gemini-3.1-pro" },
579572
"document-writer": { "model": "google/antigravity-gemini-3-flash" },
580573
"multimodal-looker": { "model": "google/antigravity-gemini-3-flash" }
581574
}

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: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
# Models tested:
66
# 1. google/gemini-2.5-pro
77
# 2. google/gemini-2.5-flash
8-
# 3. google/gemini-3-pro-preview
9-
# 4. google/gemini-3-flash-preview
8+
# 3. google/gemini-3-flash-preview
9+
# 4. google/gemini-3-pro-preview
10+
# 5. google/gemini-3.1-pro-preview
1011

1112
set -euo pipefail
1213

@@ -98,8 +99,12 @@ echo "Test 4: google/gemini-3-pro-preview"
9899
test_model "google/gemini-3-pro-preview" "gemini-3-pro-preview" || true
99100
echo ""
100101

101-
# Test 5: Cross-model session (gemini-cli → antigravity)
102-
echo "Test 5: Cross-model session (gemini-cli → antigravity-gemini)"
102+
echo "Test 5: google/gemini-3.1-pro-preview"
103+
test_model "google/gemini-3.1-pro-preview" "gemini-3.1-pro-preview" || true
104+
echo ""
105+
106+
# Test 6: Cross-model session (gemini-cli → antigravity)
107+
echo "Test 6: Cross-model session (gemini-cli → antigravity-gemini)"
103108
log_info "Step 1: Start with gemini-2.5-flash..."
104109
timeout 60 opencode run -m google/gemini-2.5-flash \
105110
"Say: SESSION_START" \
@@ -110,7 +115,7 @@ sleep 1
110115
SID=$(opencode session list 2>/dev/null | grep -oP 'ses_[a-zA-Z0-9]+' | head -1 || true)
111116

112117
if [ -z "$SID" ]; then
113-
log_fail "Test 5 - No session ID created"
118+
log_fail "Test 6 - No session ID created"
114119
else
115120
log_info "Session: $SID"
116121
log_info "Step 2: Switch to antigravity-gemini-3-flash..."
@@ -119,25 +124,25 @@ else
119124
2>&1 > /tmp/gemini-cli-e2e-cross-s2.log || true
120125

121126
if check_auth_error /tmp/gemini-cli-e2e-cross-s2.log; then
122-
log_fail "Test 5 - Auth error on cross-model switch"
127+
log_fail "Test 6 - Auth error on cross-model switch"
123128
else
124-
log_pass "Test 5 - Cross-model session (gemini-cli → antigravity)"
129+
log_pass "Test 6 - Cross-model session (gemini-cli → antigravity)"
125130
fi
126131
fi
127132
echo ""
128133

129-
# Test 6: Reverse cross-model (antigravity → gemini-cli)
130-
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 \
134+
# Test 7: Reverse cross-model (antigravity → gemini-cli)
135+
echo "Test 7: Cross-model session (antigravity → gemini-cli)"
136+
log_info "Step 1: Start with antigravity-gemini-3.1-pro-low..."
137+
timeout 60 opencode run -m google/antigravity-gemini-3.1-pro-low \
133138
"Say: ANTIGRAVITY_START" \
134139
2>&1 > /tmp/gemini-cli-e2e-reverse-s1.log || true
135140

136141
sleep 1
137142
SID=$(opencode session list 2>/dev/null | grep -oP 'ses_[a-zA-Z0-9]+' | head -1 || true)
138143

139144
if [ -z "$SID" ]; then
140-
log_fail "Test 6 - No session ID created"
145+
log_fail "Test 7 - No session ID created"
141146
else
142147
log_info "Session: $SID"
143148
log_info "Step 2: Switch to gemini-2.5-pro..."
@@ -146,9 +151,9 @@ else
146151
2>&1 > /tmp/gemini-cli-e2e-reverse-s2.log || true
147152

148153
if check_auth_error /tmp/gemini-cli-e2e-reverse-s2.log; then
149-
log_fail "Test 6 - Auth error on reverse cross-model switch"
154+
log_fail "Test 7 - Auth error on reverse cross-model switch"
150155
else
151-
log_pass "Test 6 - Cross-model session (antigravity → gemini-cli)"
156+
log_pass "Test 7 - Cross-model session (antigravity → gemini-cli)"
152157
fi
153158
fi
154159
echo ""

script/test-models.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,24 @@ const MODELS: ModelTest[] = [
1010
// Gemini CLI (direct Google API)
1111
{ model: "google/gemini-3-flash-preview", category: "gemini-cli" },
1212
{ model: "google/gemini-3-pro-preview", category: "gemini-cli" },
13+
{ model: "google/gemini-3.1-pro-preview", category: "gemini-cli" },
1314
{ model: "google/gemini-2.5-pro", category: "gemini-cli" },
1415
{ model: "google/gemini-2.5-flash", category: "gemini-cli" },
1516

1617
// Antigravity Gemini
17-
{ model: "google/antigravity-gemini-3-pro-low", category: "antigravity-gemini" },
18-
{ model: "google/antigravity-gemini-3-pro-high", category: "antigravity-gemini" },
18+
{ model: "google/antigravity-gemini-3.1-pro-low", category: "antigravity-gemini" },
19+
{ model: "google/antigravity-gemini-3.1-pro-high", category: "antigravity-gemini" },
1920
{ model: "google/antigravity-gemini-3-flash", category: "antigravity-gemini" },
2021

2122
// Antigravity Claude
2223
{ model: "google/antigravity-claude-sonnet-4-6", category: "antigravity-claude" },
24+
{ model: "google/antigravity-claude-sonnet-4-6-thinking-low", category: "antigravity-claude" },
25+
{ model: "google/antigravity-claude-sonnet-4-6-thinking-medium", category: "antigravity-claude" },
26+
{ model: "google/antigravity-claude-sonnet-4-6-thinking-high", category: "antigravity-claude" },
2327
{ model: "google/antigravity-claude-opus-4-6-thinking-low", category: "antigravity-claude" },
2428
{ model: "google/antigravity-claude-opus-4-6-thinking-medium", category: "antigravity-claude" },
2529
{ model: "google/antigravity-claude-opus-4-6-thinking-high", category: "antigravity-claude" },
30+
{ model: "google/antigravity-claude-opus-4-6-thinking-max", category: "antigravity-claude" },
2631
];
2732

2833
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/plugin/accounts.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1863,6 +1863,6 @@ describe("resolveQuotaGroup", () => {
18631863
it("model takes precedence over family", () => {
18641864
// Even if family says claude, model determines the quota group
18651865
expect(resolveQuotaGroup("gemini", "gemini-2.5-flash")).toBe("gemini-flash");
1866-
expect(resolveQuotaGroup("gemini", "gemini-3-pro")).toBe("gemini-pro");
1866+
expect(resolveQuotaGroup("gemini", "gemini-3.1-pro")).toBe("gemini-pro");
18671867
});
18681868
});

0 commit comments

Comments
 (0)