Skip to content

fix(config): don't rewrite explicit gemini-2.5-flash model selection - #29217

Open
TECHIE-TITAN wants to merge 1 commit into
google-gemini:mainfrom
TECHIE-TITAN:fix/issue-29213-flash-model-override
Open

fix(config): don't rewrite explicit gemini-2.5-flash model selection#29217
TECHIE-TITAN wants to merge 1 commit into
google-gemini:mainfrom
TECHIE-TITAN:fix/issue-29213-flash-model-override

Conversation

@TECHIE-TITAN

Copy link
Copy Markdown

Summary

  • isFlashModel() used a broad model.endsWith('flash') match to decide which
    models get auto-upgraded to gemini-3.5-flash once 3.5 Flash GA is active for
    a backend. That also matched the explicitly pinned gemini-2.5-flash, so
    --model gemini-2.5-flash was silently rewritten to gemini-3.5-flash on
    backends (e.g. Vertex AI) where GA is assumed but not actually available,
    causing a ModelNotFoundError.
  • Narrowed isFlashModel() to only match known flash aliases/pointers, not
    arbitrary pinned model IDs, and removed the equivalent auto-upgrade rule for
    gemini-2.5-flash in the experimental dynamic model-config table.

Fixes #29213

Test plan

@TECHIE-TITAN
TECHIE-TITAN requested a review from a team as a code owner September 4, 2026 22:43
@github-actions github-actions Bot added the size/m A medium sized PR label Sep 4, 2026
@google-cla

google-cla Bot commented Sep 4, 2026

Copy link
Copy Markdown

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.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

📊 PR Size: size/M

  • Lines changed: 146
  • Additions: +134
  • Deletions: -12
  • Files changed: 4

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 the Gemini CLI was incorrectly and silently rewriting explicitly requested model IDs (specifically gemini-2.5-flash) to gemini-3.5-flash. This behavior caused failures for users whose environments did not have access to the newer model. The changes ensure that model resolution logic respects user-provided model identifiers while maintaining correct auto-upgrade behavior for generic flash aliases.

Highlights

  • Model Resolution Logic: Updated the isFlashModel helper function to remove the broad endsWith('flash') check, preventing unintended automatic upgrades of explicitly pinned models like gemini-2.5-flash.
  • Configuration Cleanup: Removed the legacy auto-upgrade rule for gemini-2.5-flash from the experimental dynamic model-config table.
  • Regression Testing: Added comprehensive test cases to verify that explicitly requested model IDs are preserved and not silently rewritten during GA rollout scenarios.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses issue #29213 where explicitly requested concrete flash models (such as gemini-2.5-flash) were being unexpectedly resolved/upgraded to gemini-3.5-flash. This was fixed by removing the gemini-2.5-flash mapping from defaultModelConfigs.ts and removing the generic endsWith('flash') check in isFlashModel within models.ts. Unit tests have been added to verify that explicitly requested model IDs remain untouched. I have no feedback to provide as there are no review comments.

@gemini-cli gemini-cli Bot added priority/p1 Important and should be addressed in the near term. area/agent Issues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Quality labels Sep 4, 2026
@gemini-cli gemini-cli Bot added priority/p2 Important but can be addressed in a future release. area/core Issues related to User Interface, OS Support, Core Functionality labels Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/agent Issues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Quality area/core Issues related to User Interface, OS Support, Core Functionality priority/p1 Important and should be addressed in the near term. priority/p2 Important but can be addressed in a future release. size/m A medium sized PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unexpected model resolution: gemini-2.5-flash is mapped to gemini-3.5-flash

1 participant