Skip to content
This repository was archived by the owner on Mar 30, 2026. It is now read-only.

feat: align Claude thinking variants with API effort levels, remove gemini-3-pro#503

Open
NoeFabris wants to merge 3 commits intomainfrom
fix/thinking-levels-remove-3pro
Open

feat: align Claude thinking variants with API effort levels, remove gemini-3-pro#503
NoeFabris wants to merge 3 commits intomainfrom
fix/thinking-levels-remove-3pro

Conversation

@NoeFabris
Copy link
Copy Markdown
Owner

Summary

Supersedes #496 — includes all Sonnet 4.6 Thinking model support from that PR plus:

  • Claude thinking variants aligned with API effort levels:
    • Opus 4.6 Thinking: low (8192), medium (16384), high (32768), max (65536)
    • Sonnet 4.6 Thinking: low (8192), medium (16384), high (32768) — no max (not supported by Sonnet)
  • Removed gemini-3-pro from both Antigravity (antigravity-gemini-3-pro) and CLI (gemini-3-pro-preview) model definitions
  • Added max tier support to ThinkingTier type, TIER_REGEX, and THINKING_TIER_BUDGETS
  • Updated all aliases, unit tests (907 passing), documentation, and scripts

Changes

Area What changed
models.ts Removed gemini-3-pro + gemini-3-pro-preview. Updated Opus/Sonnet thinking variants.
model-resolver.ts Added max tier, updated aliases, removed 3-pro paths.
types.ts Added "max" to ThinkingTier union.
Tests (5 files) Removed gemini-3-pro tests, added medium/max tier tests.
Docs (4 files) Removed 3-pro refs, updated thinking variant tables.
Scripts (4 files) Migrated 3-pro → 3.1-pro references.

Closes #496

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 23, 2026

Walkthrough

This pull request updates model support across the codebase by renaming Gemini 3 Pro variants to Gemini 3.1 Pro, adding support for Claude Sonnet 4.6 Thinking with extended thinking budgets (low/medium/high), expanding Claude Opus 4.6 Thinking from a single max budget to include medium, high, and max variants, and introducing a new "max" thinking tier for budget handling. The changes span configuration definitions, model resolution logic, tests, and documentation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the two main changes: aligning Claude thinking variants with API effort levels and removing gemini-3-pro models.
Description check ✅ Passed The description is directly related to the changeset, providing clear context about Claude thinking variants, gemini-3-pro removal, and max tier support.
Linked Issues check ✅ Passed The PR meets all objectives from #496: Sonnet 4.6 Thinking model with variants (low: 8192, medium: 16384, high: 32768), proper integration, and all tests passing.
Out of Scope Changes check ✅ Passed All changes align with the PR objectives: adding Sonnet/Opus thinking variants, removing gemini-3-pro, adding max tier support, and updating related tests/docs/scripts.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Feb 23, 2026

Greptile Summary

This PR aligns Claude thinking model variants with API effort levels and removes the deprecated gemini-3-pro model.

Key changes:

  • Claude thinking tiers now match API effort levels: Opus 4.6 Thinking supports low (8192), medium (16384), high (32768), and max (65536); Sonnet 4.6 Thinking supports low, medium, and high (no max per API limitations)
  • Added Sonnet 4.6 Thinking model (antigravity-claude-sonnet-4-6-thinking) with full variant support
  • Removed gemini-3-pro from both Antigravity and CLI model definitions, migrated all references to gemini-3.1-pro
  • Type system updated: ThinkingTier now includes "max", TIER_REGEX updated to match all tiers, THINKING_TIER_BUDGETS extended for claude family
  • Comprehensive test coverage: All 907 tests passing, with new tests for medium/max tiers and Sonnet 4.6 Thinking variants
  • Documentation fully updated: README, MODEL-VARIANTS, TROUBLESHOOTING, and API spec all reflect the changes
  • Scripts migrated: Test scripts and setup scripts updated to use gemini-3.1-pro

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are well-structured with comprehensive test coverage (907 passing tests), consistent updates across all files, proper type safety, and thorough documentation. The refactoring follows existing patterns and doesn't introduce breaking changes.
  • No files require special attention

Important Files Changed

Filename Overview
src/plugin/config/models.ts Removed gemini-3-pro, added Sonnet 4.6 Thinking variants, aligned Opus thinking tiers with API effort levels (low/medium/high/max)
src/plugin/transform/model-resolver.ts Added max tier support, updated TIER_REGEX and THINKING_TIER_BUDGETS, removed gemini-3-pro aliases, added Sonnet thinking aliases
src/plugin/transform/types.ts Added "max" to ThinkingTier union type
src/plugin/config/models.test.ts Updated tests to reflect removed gemini-3-pro and added Sonnet 4.6 Thinking variants with all tiers
src/plugin/transform/model-resolver.test.ts Comprehensive test updates: removed gemini-3-pro tests, added max tier and Sonnet 4.6 Thinking tests across all effort levels
README.md Updated model tables, removed gemini-3-pro references, added Sonnet 4.6 Thinking with low/medium/high, updated Opus variants to include all four tiers
docs/MODEL-VARIANTS.md Removed gemini-3-pro examples, updated Claude thinking variant tables with complete tier specifications for Opus and Sonnet

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Model Request] --> B{Has Tier Suffix?}
    B -->|Yes| C[Extract Tier from Name]
    B -->|No| D[Use Default Tier]
    
    C --> E{Model Family?}
    D --> E
    
    E -->|Claude Opus 4.6| F[Opus Thinking Budgets]
    E -->|Claude Sonnet 4.6| G[Sonnet Thinking Budgets]
    E -->|Gemini 3 Pro| H[Gemini 3.1 Pro Levels]
    E -->|Gemini 3 Flash| I[Gemini 3 Flash Levels]
    
    F --> F1[low: 8192<br/>medium: 16384<br/>high: 32768<br/>max: 65536]
    G --> G1[low: 8192<br/>medium: 16384<br/>high: 32768]
    H --> H1[low, high]
    I --> I1[minimal, low,<br/>medium, high]
    
    F1 --> J[Resolved Model Config]
    G1 --> J
    H1 --> J
    I1 --> J
    
    J --> K{Quota Preference}
    K -->|Antigravity| L[Route to Antigravity API]
    K -->|Gemini CLI| M[Route to Gemini CLI API]
Loading

Last reviewed commit: a326ffd

@@ -254,7 +256,7 @@ export function resolveModelWithTier(requestedModel: string, options: ModelResol

const budgetFamily = getBudgetFamily(resolvedModel);
const budgets = THINKING_TIER_BUDGETS[budgetFamily];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Potential undefined value - The type assertion (budgets as Record<string, number>)[tier] can return undefined if tier is "max" and the model is not a Claude model. Only the claude family in THINKING_TIER_BUDGETS includes max: 65536. Using "max" tier with Gemini 2.5 or other models would result in undefined thinkingBudget at runtime.

* - Gemini 3 Pro variants: gemini-3-pro-{low,medium,high}
* - Gemini 3 Pro variants: gemini-3.1-pro-{low,medium,high}
* - Claude thinking variants: claude-{model}-thinking-{low,medium,high}
* - Claude non-thinking: claude-{model} (no -thinking suffix)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: Outdated comment - The documentation says {low,medium,high} but Claude thinking models now also support max tier (e.g., antigravity-claude-opus-4-6-thinking-max with budget 65536). Consider updating to {low,medium,high,max}.

@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot bot commented Feb 23, 2026

Code Review Summary

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
src/plugin/transform/model-resolver.ts 258 Potential undefined value - The type assertion can return undefined if "max" tier is used with non-Claude models. Only Claude family includes max in budgets.

SUGGESTION

File Line Issue
src/plugin/transform/model-resolver.ts 38 Outdated comment - Documentation says {low,medium,high} but should include max for Claude thinking models.
Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

File Line Issue
src/plugin/transform/model-resolver.ts 59 Comment references gemini-3-pro-image model which was removed from model definitions. May need cleanup.
Files Reviewed (24 files)
  • README.md
  • docs/ANTIGRAVITY_API_SPEC.md
  • docs/MODEL-VARIANTS.md
  • docs/TROUBLESHOOTING.md
  • script/test-cross-model-e2e.sh
  • script/test-cross-model.ts
  • script/test-gemini-cli-e2e.sh
  • script/test-models.ts
  • scripts/setup-opencode-pi.sh
  • src/constants.test.ts
  • src/plugin/accounts.test.ts
  • src/plugin/antigravity-first-fallback.test.ts
  • src/plugin/config/models.test.ts
  • src/plugin/config/models.ts
  • src/plugin/config/updater.test.ts
  • src/plugin/cross-model-integration.test.ts
  • src/plugin/request-helpers.test.ts
  • src/plugin/request.test.ts
  • src/plugin/transform/claude.test.ts
  • src/plugin/transform/cross-model-sanitizer.test.ts
  • src/plugin/transform/gemini.test.ts
  • src/plugin/transform/model-resolver.test.ts
  • src/plugin/transform/model-resolver.ts
  • src/plugin/transform/types.ts

Summary: This PR updates model references from gemini-3-pro to gemini-3.1-pro, adds new Claude thinking variants (medium, high, max), and introduces support for antigravity-claude-sonnet-4-6-thinking. The changes are generally well-structured, but there are two issues to address:

  1. A potential runtime issue where using "max" tier with non-Claude models would result in undefined thinkingBudget
  2. An outdated comment that should mention the new "max" tier support

The PR also removes deprecated models (gemini-3-pro, gemini-3-pro-preview) and updates tests accordingly.

Fix these issues in Kilo Cloud

…emini-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
@NoeFabris NoeFabris force-pushed the fix/thinking-levels-remove-3pro branch from 13acb4b to a326ffd Compare February 23, 2026 21:03
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/MODEL-VARIANTS.md (1)

21-33: ⚠️ Potential issue | 🟡 Minor

Introductory example shows stale max budget (32768) that contradicts the table below.

The "Variant Configuration" example block still has "max": { "thinkingConfig": { "thinkingBudget": 32768 } }. The updated table at line 88 and the full example at lines 105–116 both show the correct Opus max = 65536. A reader who copies this example block will get the old budget.

📝 Proposed fix
     "variants": {
       "low": { "thinkingConfig": { "thinkingBudget": 8192 } },
-      "max": { "thinkingConfig": { "thinkingBudget": 32768 } }
+      "medium": { "thinkingConfig": { "thinkingBudget": 16384 } },
+      "high": { "thinkingConfig": { "thinkingBudget": 32768 } },
+      "max": { "thinkingConfig": { "thinkingBudget": 65536 } }
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/MODEL-VARIANTS.md` around lines 21 - 33, Update the introductory JSON
example for the model "antigravity-claude-opus-4-6-thinking" so the "max"
variant's thinkingConfig.thinkingBudget matches the table and later example:
change the "max": { "thinkingConfig": { "thinkingBudget": 32768 } } entry to use
65536 instead of 32768; ensure you only modify the "thinkingBudget" value for
the "max" variant in that example.
♻️ Duplicate comments (1)
src/plugin/transform/model-resolver.ts (1)

19-20: ⚠️ Potential issue | 🟠 Major

Guard “max” tier to Claude to avoid invalid Gemini tiers / undefined budgets.

With max now parsed, a -max suffix on Gemini 3 models will emit thinkingLevel: "max", and on Gemini 2.5 models will yield an undefined budget. Consider restricting max to Claude thinking models (or normalizing it) before applying tier logic.

🔧 Possible guard in tier extraction
 function extractThinkingTierFromModel(model: string): ThinkingTier | undefined {
   // Only extract tier for models that support thinking tiers
   if (!supportsThinkingTiers(model)) {
     return undefined;
   }
   const tierMatch = model.match(TIER_REGEX);
-  return tierMatch?.[1] as ThinkingTier | undefined;
+  const tier = tierMatch?.[1] as ThinkingTier | undefined;
+  if (tier === "max" && !model.toLowerCase().includes("claude")) {
+    return undefined;
+  }
+  return tier;
 }
Does the Gemini 3 API accept a thinkingLevel of "max"? What are the supported thinkingLevel values for Gemini 3 Pro/Flash, and do Gemini 2.5 models define a "max" tier?

Also applies to: 64-64, 249-255, 261-264

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/plugin/transform/model-resolver.ts` around lines 19 - 20, The mapping
currently includes a "max" tier that gets applied globally (e.g., claude: { ...,
max: 65536 } while gemini entries lack it), which causes Gemini models to
receive thinkingLevel:"max" or undefined budgets; restrict or normalize "max" to
Claude-only by removing/omitting "max" entries from Gemini mappings (e.g., only
keep max on the claude mapping) and/or map any incoming "max" thinkingLevel to a
safe Gemini tier (e.g., "high") in your thinking-level extraction logic so
functions that use the claude and "gemini-2.5-pro" mappings never encounter
undefined budgets. Ensure the change is made where the tier-size mapping and
thinkingLevel parsing are defined so downstream code receives valid budgets for
both claude and gemini models.
🧹 Nitpick comments (2)
docs/ANTIGRAVITY_API_SPEC.md (1)

630-633: Changelog not updated for this PR.

The changelog at the bottom of the spec doesn't include an entry for the two changes made in this PR: adding the claude-sonnet-4-6-thinking model row and removing the Gemini 3 Pro rows.

📝 Suggested changelog entry
+- **2025-XX-XX**: Added Claude Sonnet 4.6 Thinking model; removed Gemini 3 Pro High/Low model rows
 - **2025-12-14**: Added function calling quirks, JSON Schema support matrix, tool name rules
 - **2025-12-13**: Initial specification based on direct API testing
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/ANTIGRAVITY_API_SPEC.md` around lines 630 - 633, Update the "Changelog"
section to include a new entry for this PR: add a dated bullet that notes adding
the "claude-sonnet-4-6-thinking" model row and removing the "Gemini 3 Pro" rows
(mention both actions explicitly), using the same date format as existing
entries and a concise description; locate the changelog under the "## Changelog"
header in docs/ANTIGRAVITY_API_SPEC.md and append the new bullet (or insert it
as the newest date) so the spec reflects these two changes.
docs/MODEL-VARIANTS.md (1)

162-163: "7 models instead of 12+" is now stale.

The model definitions currently have 11 entries (as reflected in src/plugin/config/models.test.ts). The benefit claim should be updated to match reality.

📝 Suggested update
-- **Cleaner model picker** — 7 models instead of 12+
+- **Cleaner model picker** — fewer base models with variants instead of a flat list of tier-suffixed entries
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/MODEL-VARIANTS.md` around lines 162 - 163, Update the stale claim "7
models instead of 12+" in docs/MODEL-VARIANTS.md to reflect the current model
count (11 as defined in src/plugin/config/models.test.ts); either change the
number to "11 models" or rephrase to a non-numeric benefit (e.g., "fewer
models") so the documentation matches the actual entries in the models list used
by ModelVariants.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@script/test-gemini-cli-e2e.sh`:
- Around line 136-139: The stderr/stdout redirection order is wrong for the
timeout opencode run invocation (e.g., the line with timeout 60 opencode run -m
google/antigravity-gemini-3.1-pro-low "Say: ANTIGRAVITY_START" 2>&1 >
/tmp/gemini-cli-e2e-reverse-s1.log || true); change the redirect to send both
stdout and stderr into the log file by using >
/tmp/gemini-cli-e2e-reverse-s1.log 2>&1 instead of 2>&1 > ..., and apply the
same fix consistently to the other opencode run invocations that use the same
pattern so helpers like check_auth_error / check_quota_error / check_model_error
can see stderr output.

In `@src/plugin/transform/gemini.test.ts`:
- Around line 65-67: The test for isGemini3Model that reads 'returns true for
gemini-3.1-pro' is a duplicate of the other existing test asserting the same
input; remove the redundant test case (the it(...) block whose title is "returns
true for gemini-3.1-pro" and which calls
expect(isGemini3Model("gemini-3.1-pro")).toBe(true)) or alternatively change one
of the two to assert a distinct input (e.g., "gemini-3.1-pro-low" or
"gemini-3.1-pro-medium") so each test covers a unique scenario.

In `@src/plugin/transform/model-resolver.ts`:
- Line 36: Update the inline comment that lists Gemini 3 Pro variants to match
the actual supported tiers: replace "Gemini 3 Pro variants:
gemini-3.1-pro-{low,medium,high}" with "Gemini 3 Pro variants:
gemini-3.1-pro-{low,high}" (the comment near the model resolver block in
model-resolver.ts where Gemini model variants are documented).

---

Outside diff comments:
In `@docs/MODEL-VARIANTS.md`:
- Around line 21-33: Update the introductory JSON example for the model
"antigravity-claude-opus-4-6-thinking" so the "max" variant's
thinkingConfig.thinkingBudget matches the table and later example: change the
"max": { "thinkingConfig": { "thinkingBudget": 32768 } } entry to use 65536
instead of 32768; ensure you only modify the "thinkingBudget" value for the
"max" variant in that example.

---

Duplicate comments:
In `@src/plugin/transform/model-resolver.ts`:
- Around line 19-20: The mapping currently includes a "max" tier that gets
applied globally (e.g., claude: { ..., max: 65536 } while gemini entries lack
it), which causes Gemini models to receive thinkingLevel:"max" or undefined
budgets; restrict or normalize "max" to Claude-only by removing/omitting "max"
entries from Gemini mappings (e.g., only keep max on the claude mapping) and/or
map any incoming "max" thinkingLevel to a safe Gemini tier (e.g., "high") in
your thinking-level extraction logic so functions that use the claude and
"gemini-2.5-pro" mappings never encounter undefined budgets. Ensure the change
is made where the tier-size mapping and thinkingLevel parsing are defined so
downstream code receives valid budgets for both claude and gemini models.

---

Nitpick comments:
In `@docs/ANTIGRAVITY_API_SPEC.md`:
- Around line 630-633: Update the "Changelog" section to include a new entry for
this PR: add a dated bullet that notes adding the "claude-sonnet-4-6-thinking"
model row and removing the "Gemini 3 Pro" rows (mention both actions
explicitly), using the same date format as existing entries and a concise
description; locate the changelog under the "## Changelog" header in
docs/ANTIGRAVITY_API_SPEC.md and append the new bullet (or insert it as the
newest date) so the spec reflects these two changes.

In `@docs/MODEL-VARIANTS.md`:
- Around line 162-163: Update the stale claim "7 models instead of 12+" in
docs/MODEL-VARIANTS.md to reflect the current model count (11 as defined in
src/plugin/config/models.test.ts); either change the number to "11 models" or
rephrase to a non-numeric benefit (e.g., "fewer models") so the documentation
matches the actual entries in the models list used by ModelVariants.

ℹ️ Review info

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between f0ee206 and a326ffd.

📒 Files selected for processing (22)
  • README.md
  • docs/ANTIGRAVITY_API_SPEC.md
  • docs/MODEL-VARIANTS.md
  • docs/TROUBLESHOOTING.md
  • script/test-cross-model-e2e.sh
  • script/test-cross-model.ts
  • script/test-gemini-cli-e2e.sh
  • script/test-models.ts
  • scripts/setup-opencode-pi.sh
  • src/plugin/accounts.test.ts
  • src/plugin/antigravity-first-fallback.test.ts
  • src/plugin/config/models.test.ts
  • src/plugin/config/models.ts
  • src/plugin/config/updater.test.ts
  • src/plugin/cross-model-integration.test.ts
  • src/plugin/request-helpers.test.ts
  • src/plugin/transform/claude.test.ts
  • src/plugin/transform/cross-model-sanitizer.test.ts
  • src/plugin/transform/gemini.test.ts
  • src/plugin/transform/model-resolver.test.ts
  • src/plugin/transform/model-resolver.ts
  • src/plugin/transform/types.ts
💤 Files with no reviewable changes (1)
  • src/plugin/config/updater.test.ts
📜 Review details
🧰 Additional context used
🧬 Code graph analysis (11)
src/plugin/transform/gemini.test.ts (1)
src/plugin/transform/gemini.ts (5)
  • isGeminiModel (129-132)
  • isGemini3Model (137-139)
  • isGemini25Model (144-146)
  • isImageGenerationModel (152-158)
  • applyGeminiTransforms (372-432)
src/plugin/transform/claude.test.ts (2)
src/plugin/transform/index.ts (2)
  • isClaudeModel (34-34)
  • isClaudeThinkingModel (35-35)
src/plugin/transform/claude.ts (2)
  • isClaudeModel (27-29)
  • isClaudeThinkingModel (34-37)
src/plugin/cross-model-integration.test.ts (3)
src/plugin/transform/model-resolver.ts (1)
  • getModelFamily (278-287)
src/plugin/transform/index.ts (2)
  • getModelFamily (25-25)
  • getModelFamily (65-65)
src/plugin/transform/cross-model-sanitizer.ts (1)
  • getModelFamily (30-34)
src/plugin/transform/model-resolver.test.ts (2)
src/plugin/transform/model-resolver.ts (1)
  • resolveModelWithTier (162-273)
src/plugin/transform/index.ts (1)
  • resolveModelWithTier (22-22)
src/plugin/request-helpers.test.ts (1)
src/plugin/request-helpers.ts (1)
  • isThinkingCapableModel (737-742)
src/plugin/accounts.test.ts (1)
src/plugin/accounts.ts (1)
  • resolveQuotaGroup (239-244)
script/test-cross-model.ts (3)
src/plugin/transform/model-resolver.ts (1)
  • getModelFamily (278-287)
src/plugin/transform/index.ts (2)
  • getModelFamily (25-25)
  • getModelFamily (65-65)
src/plugin/transform/cross-model-sanitizer.ts (1)
  • getModelFamily (30-34)
script/test-gemini-cli-e2e.sh (1)
script/test-cross-model-e2e.sh (3)
  • log_fail (24-24)
  • log_pass (23-23)
  • log_info (26-26)
src/plugin/transform/types.ts (1)
src/plugin/transform/index.ts (1)
  • ThinkingTier (10-10)
src/plugin/transform/cross-model-sanitizer.test.ts (3)
src/plugin/transform/model-resolver.ts (1)
  • getModelFamily (278-287)
src/plugin/transform/index.ts (2)
  • getModelFamily (25-25)
  • getModelFamily (65-65)
src/plugin/transform/cross-model-sanitizer.ts (1)
  • getModelFamily (30-34)
src/plugin/transform/model-resolver.ts (2)
src/plugin/transform/index.ts (1)
  • isClaudeModel (34-34)
src/plugin/transform/claude.ts (1)
  • isClaudeModel (27-29)
🪛 Shellcheck (0.11.0)
script/test-gemini-cli-e2e.sh

[warning] 139-139: To redirect stdout+stderr, 2>&1 must be last (or use '{ cmd > file; } 2>&1' to clarify).

(SC2069)

🔇 Additional comments (29)
src/plugin/transform/cross-model-sanitizer.test.ts (3)

13-17: Looks good—Sonnet 4.6 Thinking is covered.
Test expectation aligns with new Claude thinking variant naming.


20-23: LGTM—Gemini 3.1 naming update reflected.


331-333: Good update to target model in sanitizer test.

src/plugin/antigravity-first-fallback.test.ts (1)

141-148: Consistent Gemini 3.1 Pro naming in model-specific rate-limit test.
The updated model identifier matches the renamed variant and keeps the test intent intact.

src/plugin/transform/types.ts (1)

5-5: ThinkingTier updated to include max tier.
This aligns the type with the new tier support.

src/plugin/accounts.test.ts (1)

1864-1867: Quota group expectation updated for Gemini 3.1 Pro.
Matches the model renaming and keeps the test aligned with resolver behavior.

script/test-cross-model-e2e.sh (1)

6-6: Gemini 3.1 Pro low variant referenced consistently across E2E steps.
The rename is applied uniformly in comments and commands.

Also applies to: 45-46, 70-71, 95-96, 132-133, 176-177

src/plugin/cross-model-integration.test.ts (2)

244-246: Target model updated to Gemini 3.1 Pro low.
Keeps the sanitization test aligned with renamed variants.


355-359: Model family detection expectations updated for Gemini 3.1 Pro variants.
Matches the new naming scheme without altering behavior.

docs/TROUBLESHOOTING.md (1)

434-434: Migration table updated to Gemini 3.1 naming.
Documentation now matches the renamed model prefix.

src/plugin/transform/claude.test.ts (3)

35-37: Non-Claude model negative test updated to Gemini 3.1 Pro.
Keeps coverage current with renamed Gemini variants.


61-64: Added coverage for prefixed Sonnet 4.6 thinking model.
This strengthens the thinking-model detection test suite.


73-75: Non-Claude thinking negative test updated to Gemini 3.1 Pro thinking.
Matches new naming conventions.

src/plugin/request-helpers.test.ts (1)

173-175: Thinking-capable model test updated for Gemini 3.1 Pro.
Keeps the expectation in sync with model renames.

script/test-cross-model.ts (1)

61-68: LGTM.

The rename from gemini-3-pro-lowgemini-3.1-pro-low is consistent with the broader model-rename in this PR. isGeminiModel detects the "gemini" substring so the assertion still holds.

scripts/setup-opencode-pi.sh (1)

35-42: LGTM.

Clean rename — model key and display name both updated consistently; the limit/modalities/variants block is correctly preserved as-is.

src/plugin/transform/gemini.test.ts (1)

607-618: LGTM.

The new isImageGenerationModel negative test for claude-sonnet-4-6-thinking (line 617) is a good addition, and the rename of gemini-3-progemini-3.1-pro on line 608 is consistent with the rest of the file.

script/test-models.ts (1)

9-31: LGTM.

Test matrix correctly reflects all PR changes: 3.1-pro rename, new Sonnet 4.6 thinking variants (low/medium/high, no max), and Opus max tier addition. Absence of antigravity-claude-sonnet-4-6-thinking-max aligns with the stated constraint that Sonnet does not support the max tier.

src/plugin/config/models.test.ts (1)

14-58: LGTM.

Model name list and variant/budget expectations accurately reflect the new additions (Sonnet 4.6 thinking, Opus max tier) and the removal of antigravity-gemini-3-pro. Sonnet correctly has no max variant.

src/plugin/config/models.ts (2)

66-75: Sonnet 4.6 thinking variants look consistent with the intended budgets.


81-85: Opus 4.6 thinking tier expansion looks good.

src/plugin/transform/model-resolver.ts (4)

4-4: Comment updates align with the 3.1 naming and examples.

Also applies to: 154-156, 186-187


53-57: Alias additions for Claude Sonnet/Opus thinking variants look good.


171-178: Gemini CLI‑only routing rule looks consistent with the preview handling.


334-335: Tier suffix handling now consistently accounts for “max.”

Also applies to: 349-350, 399-400

src/plugin/transform/model-resolver.test.ts (3)

30-36: Preview quota behavior test looks correct.


102-148: Great coverage for the new Claude thinking tiers and budgets.


178-184: Image model explicit‑quota assertion looks good.

README.md (1)

9-13: Doc updates align well with the new model names and thinking tiers.

Also applies to: 123-125, 133-134, 188-207, 433-434, 571-572

Comment on lines +136 to 139
log_info "Step 1: Start with antigravity-gemini-3.1-pro-low..."
timeout 60 opencode run -m google/antigravity-gemini-3.1-pro-low \
"Say: ANTIGRAVITY_START" \
2>&1 > /tmp/gemini-cli-e2e-reverse-s1.log || true
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Stderr redirect order is wrong — error logs may be lost to terminal instead of captured in file.

2>&1 > file redirects stderr to stdout's current destination (the terminal) and then redirects stdout to the file, so only stdout lands in the log file. The check_auth_error / check_quota_error / check_model_error helpers would miss any errors written to stderr.

This same pattern exists in the pre-existing code at lines 53, 111, 124, and 151; fixing it here makes the new test consistent with the correct behaviour rather than the existing incorrect pattern.

🐛 Proposed fix
-timeout 60 opencode run -m google/antigravity-gemini-3.1-pro-low \
-  "Say: ANTIGRAVITY_START" \
-  2>&1 > /tmp/gemini-cli-e2e-reverse-s1.log || true
+timeout 60 opencode run -m google/antigravity-gemini-3.1-pro-low \
+  "Say: ANTIGRAVITY_START" \
+  > /tmp/gemini-cli-e2e-reverse-s1.log 2>&1 || true

The same fix (> file 2>&1) should be applied consistently to lines 53, 111, 124, and 151 as well.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
log_info "Step 1: Start with antigravity-gemini-3.1-pro-low..."
timeout 60 opencode run -m google/antigravity-gemini-3.1-pro-low \
"Say: ANTIGRAVITY_START" \
2>&1 > /tmp/gemini-cli-e2e-reverse-s1.log || true
log_info "Step 1: Start with antigravity-gemini-3.1-pro-low..."
timeout 60 opencode run -m google/antigravity-gemini-3.1-pro-low \
"Say: ANTIGRAVITY_START" \
> /tmp/gemini-cli-e2e-reverse-s1.log 2>&1 || true
🧰 Tools
🪛 Shellcheck (0.11.0)

[warning] 139-139: To redirect stdout+stderr, 2>&1 must be last (or use '{ cmd > file; } 2>&1' to clarify).

(SC2069)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@script/test-gemini-cli-e2e.sh` around lines 136 - 139, The stderr/stdout
redirection order is wrong for the timeout opencode run invocation (e.g., the
line with timeout 60 opencode run -m google/antigravity-gemini-3.1-pro-low "Say:
ANTIGRAVITY_START" 2>&1 > /tmp/gemini-cli-e2e-reverse-s1.log || true); change
the redirect to send both stdout and stderr into the log file by using >
/tmp/gemini-cli-e2e-reverse-s1.log 2>&1 instead of 2>&1 > ..., and apply the
same fix consistently to the other opencode run invocations that use the same
pattern so helpers like check_auth_error / check_quota_error / check_model_error
can see stderr output.

Comment on lines +65 to 67
it("returns true for gemini-3.1-pro", () => {
expect(isGemini3Model("gemini-3.1-pro")).toBe(true);
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Duplicate test case introduced by rename.

After renaming line 66 from "gemini-3-pro" to "gemini-3.1-pro", this test is now identical (both description and assertion) to the already-existing test at lines 77–79. One of the two should be removed or the description on the original at line 77 should be updated to cover a distinct input (e.g., "gemini-3.1-pro-low" or "gemini-3.1-pro-medium").

🛠️ Proposed fix — remove the duplicate
-    it("returns true for gemini-3.1-pro", () => {
-      expect(isGemini3Model("gemini-3.1-pro")).toBe(true);
-    });
-
     it("returns true for gemini-3.1-pro-high", () => {
       expect(isGemini3Model("gemini-3.1-pro-high")).toBe(true);
     });
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
it("returns true for gemini-3.1-pro", () => {
expect(isGemini3Model("gemini-3.1-pro")).toBe(true);
});
it("returns true for gemini-3.1-pro-high", () => {
expect(isGemini3Model("gemini-3.1-pro-high")).toBe(true);
});
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/plugin/transform/gemini.test.ts` around lines 65 - 67, The test for
isGemini3Model that reads 'returns true for gemini-3.1-pro' is a duplicate of
the other existing test asserting the same input; remove the redundant test case
(the it(...) block whose title is "returns true for gemini-3.1-pro" and which
calls expect(isGemini3Model("gemini-3.1-pro")).toBe(true)) or alternatively
change one of the two to assert a distinct input (e.g., "gemini-3.1-pro-low" or
"gemini-3.1-pro-medium") so each test covers a unique scenario.

*
* Format:
* - Gemini 3 Pro variants: gemini-3-pro-{low,medium,high}
* - Gemini 3 Pro variants: gemini-3.1-pro-{low,medium,high}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Comment lists an unsupported medium tier for Gemini 3.1 Pro.

The code and model definitions only expose low/high for Gemini 3.1 Pro; the comment should match that.

📝 Suggested fix
- * - Gemini 3 Pro variants: gemini-3.1-pro-{low,medium,high}
+ * - Gemini 3 Pro variants: gemini-3.1-pro-{low,high}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* - Gemini 3 Pro variants: gemini-3.1-pro-{low,medium,high}
* - Gemini 3 Pro variants: gemini-3.1-pro-{low,high}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/plugin/transform/model-resolver.ts` at line 36, Update the inline comment
that lists Gemini 3 Pro variants to match the actual supported tiers: replace
"Gemini 3 Pro variants: gemini-3.1-pro-{low,medium,high}" with "Gemini 3 Pro
variants: gemini-3.1-pro-{low,high}" (the comment near the model resolver block
in model-resolver.ts where Gemini model variants are documented).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant