Repository navigation
fix(core): preserve explicit Gemini 3 Pro preview model IDs - #29420
FanouZeng-TT wants to merge 1 commit into
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses an issue where explicit requests for the 'gemini-3-pro-preview' model were being incorrectly rewritten to Gemini 3.1 versions when the rollout was enabled. By separating the handling of explicit model IDs from automatic aliases, the changes ensure that users who pin a specific model version maintain that selection, while general aliases continue to benefit from the intended rollout upgrades. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
|
📊 PR Size: size/M
|
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request modifies the model resolution logic to ensure that explicit requests for the gemini-3-pro-preview model remain pinned to that specific version instead of automatically upgrading to Gemini 3.1. The Gemini 3.1 rollout is now restricted to model aliases (such as pro and auto). This is implemented by updating resolveModel in models.ts, adjusting the default model configurations in defaultModelConfigs.ts to use the pro alias in preview chains, and updating the policy catalog. Corresponding unit tests have been added to verify the pinning behavior and alias rollouts. I have no further feedback to provide as the implementation is clean and well-tested.
2db5738 to
31b4a98
Compare
An explicit `--model gemini-3-pro-preview` was silently rewritten to `gemini-3.1-pro-preview` while the Gemini 3.1 rollout was enabled, in both the legacy resolver and the dynamic model configuration. Only the `auto` and `pro` aliases should follow the rollout. - Pin the explicit Pro preview model ID in `resolveModel`, keeping the existing preview-access downgrade to `gemini-2.5-pro`. - Stop remapping the explicit model ID in `defaultModelConfigs` and keep the `useGemini3_1` contexts scoped to aliases and classifier tiers. - Select the Pro rollout default in the availability catalog and the model chains from the alias, so internal rollout selection stays separate from a user-pinned version. - Cover the request boundary so `GeminiChat` keeps sending the explicit ID. Fixes google-gemini#29417
31b4a98 to
fbcd441
Compare
|
Gentle follow-up: I've rebased this onto the latest Everything is green on the new head ( |
|
Hi there! Thank you for your interest in contributing to Gemini CLI. To ensure we maintain high code quality and focus on our prioritized roadmap, we only guarantee review and consideration of pull requests for issues that are explicitly labeled as 'help wanted'. This PR will be closed in 7 days if it remains without that designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding. |
|
This pull request is being closed as it has been open for 14 days without a 'help wanted' designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding. |
Summary
An explicit
--model gemini-3-pro-previewis silently rewritten togemini-3.1-pro-previewwhenever the Gemini 3.1 rollout (useGemini3_1) is enabled. Only theauto/proaliases should follow the rollout — a user who pins an explicit version should get that version.Details
The rewrite happened on two independent paths, both fixed here:
resolveModel) groupedPREVIEW_GEMINI_MODELinto the sameswitchcase asPREVIEW_GEMINI_MODEL_AUTO, so the explicit ID fell through into the 3.1 upgrade. It now has its own case that pins the ID; the existinghasAccessToPreview=false→gemini-2.5-prodowngrade is preserved.defaultModelConfigs) remapped the explicitgemini-3-pro-previewkey throughuseGemini3_1contexts. Those contexts are removed from the explicit key, and the classifierprotier gains an explicitrequestedModels: ['gemini-3-pro-preview']anchor so it stays pinned too.Two call sites used the explicit model ID as an internal placeholder for "the current Pro rollout target" — they must keep following the rollout:
getModelPolicyChain(availability catalog) now derives the rollout Pro model inline fromuseGemini31/useCustomToolModelinstead of callingresolveModelwith the explicit ID.preview/auto-previewmodel chains select theproalias (matching the existinglitechain's use of theflash-litealias) rather than a hard-coded versioned ID.Related Issues
Fixes #29417
How to Validate
Targeted regressions (red before the fix, green after):
cd packages/core ../../node_modules/.bin/vitest run \ src/config/models.test.ts \ src/core/geminiChat.test.ts \ src/availability/policyCatalog.test.ts \ src/availability/policyHelpers.test.tsresolveModel/dynamic parity: explicitgemini-3-pro-preview(with and without custom tools) stays pinned whenuseGemini3_1=true; theauto/proaliases still upgrade togemini-3.1-pro-preview[-customtools];hasAccessToPreview=falsestill downgrades togemini-2.5-pro.GeminiChat.sendMessageStreamsendsgemini-3-pro-previewunchanged with the rollout enabled.Pre-Merge Checklist
🤖 Generated with Claude Code