Skip to content

fix(core): preserve explicit versioned Flash model IDs - #29252

Merged
SandyTao520 merged 1 commit into
mainfrom
st/fix/explicit-flash-model-ids
Sep 8, 2026
Merged

SandyTao520 merged 1 commit into
mainfrom
st/fix/explicit-flash-model-ids

Conversation

@SandyTao520

Copy link
Copy Markdown
Contributor

Summary

Preserve explicit versioned Flash model IDs instead of silently remapping them to the Gemini 3.5 Flash rollout default. This keeps --model pinning accurate and lets the API return an honest error for invalid model IDs.

Details

  • Limit Gemini 3.5 Flash rollout remapping to known aliases and backend model IDs.
  • Pass explicit versioned Flash IDs, such as gemini-3.8-flash, through unchanged.
  • Add regression coverage at both model resolution and the final GeminiChat request boundary.

Related Issues

Fixes #28859

How to Validate

  1. Run the focused core tests:

    npm exec --workspace @google/gemini-cli-core -- vitest run src/config/models.test.ts src/core/geminiChat.test.ts src/core/modelMappingContentGenerator.test.ts --coverage.enabled=false

    Expected: 3 test files and 217 tests pass. The tests verify that known Flash aliases still resolve to the rollout default while explicit versioned IDs reach the request unchanged.

  2. Run the core type check:

    npm run typecheck --workspace @google/gemini-cli-core

    Expected: the type check passes without errors.

The full core suite was also attempted, but unrelated tests cannot complete in a restricted macOS workspace because they require nested Seatbelt sandboxing, filesystem watchers, listening sockets, or writes under ~/.gemini.

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed; existing documentation already specifies that --model takes precedence)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any; none)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@SandyTao520
SandyTao520 requested a review from a team as a code owner September 8, 2026 21:17
@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 explicit versioned Flash model IDs were being silently remapped to the default Gemini 3.5 Flash rollout model. By refining the model resolution logic, the changes ensure that users can pin specific model versions as intended, while maintaining the existing rollout behavior for standard aliases. This improves API reliability and allows for accurate error reporting when invalid model IDs are provided.

Highlights

  • Model ID Preservation: Updated the model resolution logic to preserve explicit versioned Flash model IDs (e.g., gemini-3.8-flash) instead of automatically remapping them to the default Gemini 3.5 Flash rollout model.
  • Logic Refinement: Replaced the broad 'isFlashModel' check with a more specific 'isPromotableFlashModel' function, restricting automatic remapping to known aliases and backend IDs.
  • Regression Testing: Added comprehensive test coverage in both model resolution and the GeminiChat request boundary to ensure explicit model IDs are passed through correctly.
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. ↩

@github-actions github-actions Bot added the size/m A medium sized PR label Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

📊 PR Size: size/M

  • Lines changed: 60
  • Additions: +54
  • Deletions: -6
  • Files changed: 3

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Size Change: +6 B (0%)

Total Size: 35.3 MB

Filename Size Change
./bundle/chunk-2XJ7NUTX.js 0 B -3.43 kB (removed) 🏆
./bundle/chunk-EX6CIJ36.js 0 B -3.77 kB (removed) 🏆
./bundle/chunk-MIGA5LDI.js 0 B -49.2 kB (removed) 🏆
./bundle/chunk-QSKETH2I.js 0 B -662 kB (removed) 🏆
./bundle/chunk-SSHLTZIT.js 0 B -3.66 MB (removed) 🏆
./bundle/chunk-VM243I2X.js 0 B -16.7 MB (removed) 🏆
./bundle/chunk-ZDE5QR4E.js 0 B -13 kB (removed) 🏆
./bundle/chunk-ZWEXG6P5.js 0 B -19.5 kB (removed) 🏆
./bundle/core-E4HV7C5I.js 0 B -51.7 kB (removed) 🏆
./bundle/devtoolsService-HGZFZWFZ.js 0 B -147 kB (removed) 🏆
./bundle/gemini-O4LOYYU5.js 0 B -628 kB (removed) 🏆
./bundle/interactiveCli-MTFV3ZUL.js 0 B -1.31 MB (removed) 🏆
./bundle/liteRtServerManager-2TSYW77P.js 0 B -2.08 kB (removed) 🏆
./bundle/oauth2-provider-WFNGKIF6.js 0 B -9.12 kB (removed) 🏆
./bundle/chunk-3GRFTKPQ.js 16.7 MB +16.7 MB (new file) 🆕
./bundle/chunk-ESC4DLGK.js 3.66 MB +3.66 MB (new file) 🆕
./bundle/chunk-FUCR5BGM.js 19.5 kB +19.5 kB (new file) 🆕
./bundle/chunk-PVH4DIET.js 13 kB +13 kB (new file) 🆕
./bundle/chunk-ROMYSI3N.js 3.77 kB +3.77 kB (new file) 🆕
./bundle/chunk-RONIJYAT.js 49.2 kB +49.2 kB (new file) 🆕
./bundle/chunk-T75FGZYZ.js 3.43 kB +3.43 kB (new file) 🆕
./bundle/chunk-VRVL5A4J.js 662 kB +662 kB (new file) 🆕
./bundle/core-BAUSHVWK.js 51.7 kB +51.7 kB (new file) 🆕
./bundle/devtoolsService-AC62HYOL.js 147 kB +147 kB (new file) 🆕
./bundle/gemini-KSNZMLBG.js 628 kB +628 kB (new file) 🆕
./bundle/interactiveCli-PRQHPNUF.js 1.31 MB +1.31 MB (new file) 🆕
./bundle/liteRtServerManager-VWWHBGIQ.js 2.08 kB +2.08 kB (new file) 🆕
./bundle/oauth2-provider-A4EHVHP7.js 9.12 kB +9.12 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size Change
./bundle/bundled/third_party/index.js 8 MB 0 B
./bundle/chunk-34MYV7JD.js 2.45 kB 0 B
./bundle/chunk-5AUYMPVF.js 858 B 0 B
./bundle/chunk-5PS3AYFU.js 1.18 kB 0 B
./bundle/chunk-664ZODQF.js 124 kB 0 B
./bundle/chunk-DAHVX5MI.js 206 kB 0 B
./bundle/chunk-IUUIT4SU.js 56.5 kB 0 B
./bundle/chunk-L5V3KIDT.js 1.62 kB 0 B
./bundle/chunk-TUDYL3X4.js 40.3 kB 0 B
./bundle/cleanup-6JLGVOC4.js 0 B -902 B (removed) 🏆
./bundle/devtools-TYCPOPV3.js 683 kB 0 B
./bundle/events-XB7DADIJ.js 418 B 0 B
./bundle/examples/hooks/scripts/on-start.js 188 B 0 B
./bundle/examples/mcp-server/example.js 1.43 kB 0 B
./bundle/gemini.js 5.38 kB 0 B
./bundle/getMachineId-bsd-TXG52NKR.js 1.55 kB 0 B
./bundle/getMachineId-darwin-7OE4DDZ6.js 1.55 kB 0 B
./bundle/getMachineId-linux-SHIFKOOX.js 1.34 kB 0 B
./bundle/getMachineId-unsupported-5U5DOEYY.js 1.06 kB 0 B
./bundle/getMachineId-win-6KLLGOI4.js 1.72 kB 0 B
./bundle/https-proxy-agent-AVGR4LHR.js 490 B 0 B
./bundle/multipart-parser-E7RMVJWU.js 11.7 kB 0 B
./bundle/multipart-parser-KPBZEGQU.js 11.7 kB 0 B
./bundle/sandbox-macos-permissive-open.sb 7.17 kB 0 B
./bundle/sandbox-macos-permissive-proxied.sb 7.46 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 5.17 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 5.38 kB 0 B
./bundle/sandbox-macos-strict-open.sb 6.63 kB 0 B
./bundle/sandbox-macos-strict-proxied.sb 6.84 kB 0 B
./bundle/src-65GKNWUJ.js 45.4 kB 0 B
./bundle/src-U45KTUYT.js 45.7 kB 0 B
./bundle/src-XZYPU6PJ.js 352 kB 0 B
./bundle/start-ISO4VDHV.js 0 B -622 B (removed) 🏆
./bundle/tree-sitter-7U6MW5PS.js 274 kB 0 B
./bundle/tree-sitter-bash-34ZGLXVX.js 1.84 MB 0 B
./bundle/worker/worker-entry.js 363 kB 0 B
./bundle/cleanup-FX6L2C2W.js 902 B +902 B (new file) 🆕
./bundle/start-JJBVYEKL.js 622 B +622 B (new file) 🆕

compressed-size-action

@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 refactors the model resolution logic to prevent explicit versioned Gemini Flash models (such as gemini-3.8-flash) from being automatically remapped or promoted when Gemini 3.5 Flash GA is enabled. It replaces isFlashModel with isPromotableFlashModel, restricting the remapping only to known aliases and backend IDs, and adds corresponding unit tests to verify this behavior. There are no review comments, so I have no feedback to provide.

@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 8, 2026
@SandyTao520
SandyTao520 added this pull request to the merge queue Sep 8, 2026
Merged via the queue into main with commit ed2ac40 Sep 8, 2026
34 checks passed
@SandyTao520
SandyTao520 deleted the st/fix/explicit-flash-model-ids branch September 8, 2026 22:54
Blackmanx added a commit to Blackmanx/gemini-cli that referenced this pull request Sep 10, 2026
The flash-lite rollout default still pointed every Flash-Lite request at
gemini-3.1-flash-lite. Mirror the Flash treatment from google-gemini#29252 for Flash-Lite:

- Add DEFAULT_GEMINI_3_5_FLASH_LITE_MODEL and resolve the `flash-lite`
  rollout default (DEFAULT_GEMINI_FLASH_LITE_MODEL) to it.
- Keep the previous GA ID selectable for persisted user settings.
- Recognize any GA Gemini 3.x Flash-Lite ID in availability chains via
  isFlashLiteModel() so pinned versioned IDs keep Flash-Lite handling
  instead of being remapped to the current GA model.
- Register gemini-3.5-flash-lite in the default model config registry.
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 priority/p1 Important and should be addressed in the near term. size/m A medium sized PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v0.55.1: any --model gemini-<X.Y>-flash is silently served by gemini-3.5-flash, including versions that do not exist

2 participants