fix(core): allow any preview model in quota access check - #19867
Conversation
Update refreshUserQuota to use isPreviewModel when checking buckets for access. This ensures that users with access only to Gemini 3.1 Pro Preview are not incorrectly downgraded to Gemini 2.5.
Summary of ChangesHello @bdmorgan, 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 a critical bug that prevented users with access to Gemini 3.1 preview models from being correctly recognized by the CLI, leading to an unintended downgrade to Gemini 2.5. By updating the model access check to dynamically identify any valid preview model, this change ensures that users retain appropriate access to their entitled preview features, improving the overall user experience and model accessibility. Highlights
Changelog
Activity
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 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 counter productive. 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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
The pull request correctly addresses the issue where the quota access check was hardcoded to a specific legacy preview model. By switching to the isPreviewModel helper, the check now covers more models. However, the isPreviewModel helper itself appears to be missing one of the preview model variants defined in the project, which could lead to incorrect downgrades for some users.
|
Size Change: +53 B (0%) Total Size: 25.2 MB ℹ️ View Unchanged
|
sehoon38
left a comment
There was a problem hiding this comment.
add PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL to the list in isPreviewModel
This ensures that users with access only to the Gemini 3.1 Pro Preview with custom tools model are correctly identified as having preview access.
|
/patch |
|
✅ Patch workflow(s) dispatched successfully! 📋 Details:
🔗 Track Progress: |
|
🚀 Patch PR Created! 📋 Patch Details:
📝 Next Steps:
🔗 Track Progress: |
|
🚀 Patch PR Created! 📋 Patch Details:
📝 Next Steps:
🔗 Track Progress: |
|
/patch |
|
✅ Patch workflow(s) dispatched successfully! 📋 Details:
🔗 Track Progress: |
|
ℹ️ Patch branch exists but no PR found! A patch branch 🔍 Issue: This might indicate an incomplete patch process. 📝 Next Steps:
🔗 Links: |
|
🚀 Patch PR Created! 📋 Patch Details:
📝 Next Steps:
🔗 Track Progress: |
|
/patch |
|
✅ Patch workflow(s) dispatched successfully! 📋 Details:
🔗 Track Progress: |
|
🚀 Patch PR Created! 📋 Patch Details:
📝 Next Steps:
🔗 Track Progress: |
|
🚀 Patch PR Created! 📋 Patch Details:
📝 Next Steps:
🔗 Track Progress: |
|
🚀 Patch Release Started! 📋 Release Details:
⏳ Status: The patch release is now running. You'll receive another update when it completes. 🔗 Track Progress: |
|
🚀 Patch Release Started! 📋 Release Details:
⏳ Status: The patch release is now running. You'll receive another update when it completes. 🔗 Track Progress: |
|
✅ Patch Release Complete! 📦 Release Details:
🎉 Status: Your patch has been successfully released and published to npm! 📝 What's Available:
🔗 Links: |
|
✅ Patch Release Complete! 📦 Release Details:
🎉 Status: Your patch has been successfully released and published to npm! 📝 What's Available:
🔗 Links: |
Summary
Fixes a bug where users with access only to Gemini 3.1 preview models are incorrectly downgraded to Gemini 2.5 because the CLI's access check specifically looks for the legacy Gemini 3.0 preview model ID (
gemini-3-pro-preview) instead of any valid preview model.Details
The
refreshUserQuota()method inpackages/core/src/config/config.tswas hardcoded to check forPREVIEW_GEMINI_MODEL('gemini-3-pro-preview'). With the launch of Gemini 3.1, users who have been transitioned to 3.1 may no longer have the 3.0 bucket in their quota.Changes:
refreshUserQuotato use theisPreviewModel()helper, which correctly identifies both 3.0 and 3.1 models.isPreviewModel()inpackages/core/src/config/models.tsto includePREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL('gemini-3.1-pro-preview-customtools'), ensuring full coverage for all 3.1 preview variants.packages/core/src/config/config.test.tsandpackages/core/src/config/models.test.ts.Related Issues
Fixes reported issue where users transitioned to Gemini 3.1 are unable to access Gemini 3 models.
How to Validate
packages/core/src/config/config.test.ts:npm test -w @google/gemini-cli-core -- src/config/config.test.tspackages/core/src/config/models.test.ts:npm test -w @google/gemini-cli-core -- src/config/models.test.tsPre-Merge Checklist