fix(patch): cherry-pick 601a639 to release/v0.11.0-preview.0-pr-11889 to patch version v0.11.0-preview.0 and create version 0.11.0-preview.1#12188
Conversation
Co-authored-by: matt korwel <matt.korwel@gmail.com>
Summary of ChangesHello @gemini-cli-robot, 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 enhances the configuration system by introducing dynamic control over the model router based on the authentication method. It allows for specific authentication types to automatically disable the model router, while also ensuring that any user-selected model is consistently maintained across authentication refreshes. The primary goal is to provide more flexible and context-aware management of model routing within the application. 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 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
This pull request introduces a mechanism to conditionally disable the model router based on the authentication method. It adds a disableModelRouterForAuth configuration option, which defaults to disabling the router for personal Google accounts. The logic in refreshAuth is updated to handle this, and new tests are added to verify the behavior.
The changes are logical, but I've identified one high-severity issue in config.ts where the user's explicitly configured model can be silently overridden when useModelRouter is enabled. This could lead to unexpected behavior and model usage. My review includes a specific suggestion to correct this by removing the implicit model-switching logic, ensuring the user's configuration is always respected.
| } else if (this.useModelRouter && this.model === DEFAULT_GEMINI_MODEL) { | ||
| this.model = DEFAULT_GEMINI_MODEL_AUTO; | ||
| } |
There was a problem hiding this comment.
This else if block can lead to unexpected behavior by implicitly changing the user's configured model. If a user explicitly sets useModelRouter: true and model: 'gemini-2.5-pro' (which is DEFAULT_GEMINI_MODEL), this logic will silently change their model to 'auto'. This violates the principle of least astonishment.
A user should be required to explicitly set model: 'auto' to opt into the model routing classification strategy. The model router can still provide value for other strategies (like FallbackStrategy) even when a specific model is pinned.
To avoid this surprising side-effect, it's better to remove this automatic model switching.
}|
Size Change: +689 B (0%) Total Size: 20.1 MB ℹ️ View Unchanged
|
a3947a8
into
release/v0.11.0-preview.0-pr-11889
This PR automatically cherry-picks commit 601a639 to patch version v0.11.0-preview.0 in the preview release to create version 0.11.0-preview.1.