feat(models): support Gemini 3.1 Pro Preview and fixes#19676
Conversation
…ing (#125) * feat(core,ui): support Gemini 3.1 Pro Preview and active model filtering * fix(core,ui): use optional chaining for config methods to support mocks * fix(core): clear stale authType in refreshAuth to avoid incorrect model resolution * do not show gemini 3.1 model when users do not have access to gemini 3.1 in stats
* feat(models): add support for Gemini 3.1 and custom tool models * test(routing): fix classifier and numerical classifier strategy tests * test(routing): add Gemini 3.1 tests for classifier strategy * fix(models): correctly filter active Gemini 3.1 models * fix(routing): ensure useCustomToolModel is only true when Gemini 3.1 is enabled * fix(test-utils): prevent double newline in lastFrame() on Windows * fix(test-utils): surgically fix double newline in lastFrame() on Windows * use custom_tools_model string for api key only * fix(ui): correct useCustomToolModel logic and update tests * fix(ui): correct useCustomToolModel logic in StatsDisplay * fix(routing): ensure test models are active and sync useCustomToolModel logic
* only use customtoolmodel for api key users * use displaystring for showing model in about
|
Hi @sehoon38, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this. We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines. Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed. Thank you for your understanding and for being a part of our community! |
Summary of ChangesHello @sehoon38, 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 integrates support for the new Gemini 3.1 Pro Preview model, including its custom tool variant, into the CLI. It enhances the model selection and display mechanisms to intelligently adapt based on the model's launch status and the user's authentication method. Additionally, it improves the clarity of quota-related error messages to provide better user experience and guidance. 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
|
|
Size Change: +5.58 kB (+0.02%) Total Size: 25.2 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request effectively introduces support for Gemini 3.1 Pro Preview models, including a custom tools model variant for API key users. The changes are comprehensive, updating model resolution logic, UI components, and routing strategies throughout the codebase. The addition of an experiment flag for the 3.1 launch and corresponding tests ensures the new functionality is well-controlled and validated.
I've identified one area for improvement in the model resolution logic that could prevent unexpected behavior for users explicitly configuring older preview models. Otherwise, the changes are well-implemented.
| ): string { | ||
| switch (requestedModel) { | ||
| case PREVIEW_GEMINI_MODEL_AUTO: { | ||
| case PREVIEW_GEMINI_MODEL: |
There was a problem hiding this comment.
Explicitly requesting PREVIEW_GEMINI_MODEL ('gemini-3-pro-preview') should not result in an automatic upgrade to a Gemini 3.1 model when the useGemini3_1 flag is true. This can lead to unexpected behavior for users who have explicitly configured the older preview model. By removing this case, PREVIEW_GEMINI_MODEL will fall through to the default case, which correctly returns the requested model as-is, honoring the user's explicit choice.
Summary
Cherry-picked 4 commits from
hotfix/v0.30.0-preview.2/fix-bugto support Gemini 3.1 features and fixes.f669adbfffeat(core,ui): support Gemini 3.1 Pro Preview and active model filtering (Question flag #125)ed8f7f676feat(models): support Gemini 3.1 custom tool model (remove dead code #131)a2d831f1donly use customtoolmodel for api key users (Updating the system prompt to allow for more complex app creation #132)9ddc46c59update isActiveModel to return false for unknown modelsDetails
This PR brings in support for Gemini 3.1 Pro Preview, including active model filtering and custom tool model support for API key users. It also includes a fix for
isActiveModelto return false for unknown models.Related Issues
Fixes #19678
How to Validate
Run the following tests:
Pre-Merge Checklist