-
-
Notifications
You must be signed in to change notification settings - Fork 554
fix: allow gemini-3-pro-preview to use gemini-cli quota #408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: allow gemini-3-pro-preview to use gemini-cli quota #408
Conversation
This change removes the hardcoded override that forced all models to use the 'antigravity' header style, allowing models explicitly configured for 'gemini-cli' quota (like gemini-3-pro-preview) to actually use it.
WalkthroughThese changes modify how Gemini CLI quota preference is handled across two files. The first change in Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ 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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/plugin/transform/model-resolver.ts (1)
152-175:⚠️ Potential issue | 🟡 MinorStale doc comment contradicts new behavior.
Line 154 documents
"gemini-3-pro-preview" → { quotaPreference: "antigravity" }, but the code change on line 174 now routes it to"gemini-cli". Update the example to reflect the new behavior.📝 Proposed fix
- * - "gemini-3-pro-preview" → { quotaPreference: "antigravity" } + * - "gemini-3-pro-preview" → { quotaPreference: "gemini-cli" }
📜 Review details
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
📒 Files selected for processing (2)
src/plugin.tssrc/plugin/transform/model-resolver.ts
🧰 Additional context used
🧬 Code graph analysis (1)
src/plugin/transform/model-resolver.ts (2)
src/plugin/transform/index.ts (1)
isClaudeModel(35-35)src/plugin/transform/claude.ts (1)
isClaudeModel(27-29)
🔇 Additional comments (1)
src/plugin.ts (1)
2738-2748: LGTM!The removal of the override that forced
"gemini-cli"back to"antigravity"is the correct fix. The?? "antigravity"fallback is a safe defensive default sincequotaPreferenceis always set inresolveModelWithTier.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
Greptile OverviewGreptile SummaryThis PR updates Gemini quota routing so
Main concern: Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant Plugin as src/plugin.ts
participant Resolver as src/plugin/transform/model-resolver.ts
Client->>Plugin: Request URL /models/{model}...
Plugin->>Plugin: getModelFamilyFromUrl(url)
Plugin->>Plugin: extractModelFromUrlWithSuffix(url)
Plugin->>Resolver: resolveModelWithTier(modelWithSuffix)
Resolver-->>Plugin: {quotaPreference, explicitQuota, ...}
Plugin-->>Client: HeaderStyle = quotaPreference ?? "antigravity"
alt headerStyle == "gemini-cli"
Note over Client,Plugin: Requests routed to Gemini CLI quota pool
else headerStyle == "antigravity"
Note over Client,Plugin: Requests routed to Antigravity quota pool
end
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 files reviewed, 1 comment
Additional Comments (1)
Prompt To Fix With AIThis is a comment left during a code review.
Path: src/plugin/transform/model-resolver.ts
Line: 160:162
Comment:
**Preview model forces CLI**
`preferGeminiCli` is now true whenever `modelWithoutQuota === "gemini-3-pro-preview"`, regardless of `options.cli_first`. That makes `resolveModelWithTier("gemini-3-pro-preview")` return `quotaPreference: "gemini-cli"` even when the user didn’t opt into CLI-first routing, which changes the documented default behavior (“All models default to Antigravity quota unless cli_first is enabled”). If the intent is only to fix the “headerStyle override” bug, this should likely be handled in the URL/header-style resolution path rather than changing the default quota routing for this model.
How can I resolve this? If you propose a fix, please make it concise. |
gemini-3-pro-preview is a CLI-specific model that should always route to gemini-cli quota pool, not antigravity. Based on PR NoeFabris#408 by truongsinh.
|
Hey @truongsinh, that is not a bug, you need to set cli_first: true in antigravity.json if you want to use the cli quota first. |
This PR fixes an issue where selecting the
gemini-3-pro-previewmodel (Gemini CLI) would still consume Antigravity quota because of a hardcoded override ingetHeaderStyleFromUrl.Changes
src/plugin/transform/model-resolver.ts: UpdatedpreferGeminiClilogic to explicitly includegemini-3-pro-preview(when not using theantigravity-prefix).src/plugin.ts: Removed the logic that forcedquotaPreferenceback to "antigravity" even when "gemini-cli" was resolved.Impact
Users can now correctly route
gemini-3-pro-previewrequests to the Gemini CLI quota pool by selecting that model, instead of being forced into the Antigravity pool.