Skip to content

[Internal Testing] Promote Gemini 3.1 Flash Lite to GA and support Gemini 3.5 Flash#27704

Closed
sripasg wants to merge 2 commits into
release/v0.42.0-nightly.20260512.gc987b9939from
xcodegcli_release_branch_add_35_flash
Closed

[Internal Testing] Promote Gemini 3.1 Flash Lite to GA and support Gemini 3.5 Flash#27704
sripasg wants to merge 2 commits into
release/v0.42.0-nightly.20260512.gc987b9939from
xcodegcli_release_branch_add_35_flash

Conversation

@sripasg

@sripasg sripasg commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

This commit merges and unifies three separate lines of changes onto the release branch:

  1. Gemini 3.1 Flash Lite GA Promotion (PR 27071): Replaces retired preview models (e.g. gemini-3.1-flash-lite-preview / none) with the stable gemini-3.1-flash-lite GA model and updates the default auto-routing and policy chains to use it as the main lightweight fallback/utility tier.
  2. Gemini 3.5 Flash Experiment Hook (PR 27570): Introduces experimental logic (GEMINI_3_5_FLASH_GA_LAUNCHED) and backend capability switches to transition users over to Gemini 3.5 Flash when experiment flag values are present.
  3. Gemini 3.5 Flash GA Backend Support (PR 27645): Fully wires up dynamic model configuration aliases, default policies, and resolver mapping layers to respect backend definition limits and API-key-specific fallback paths for both Gemini 3.5 Flash and gemini-3-flash-preview.

Details

1. Core Model Configurations & Resolutions (packages/core/src/config/)

  • models.ts
    • Marked PREVIEW_GEMINI_FLASH_LITE_MODEL as deprecated ('none') and promoted DEFAULT_GEMINI_FLASH_LITE_MODEL ('gemini-3.1-flash-lite') to GA.
    • Added DEFAULT_GEMINI_3_5_FLASH_MODEL ('gemini-3.5-flash') and SECONDARY_GEMINI_3_5_FLASH_MODEL ('gemini-3-flash').
    • Updated resolveModel and resolveClassifierModel to dynamically route alias strings (auto, pro, flash) depending on user preview permissions and 3.5 Flash experiment access flags.
  • defaultModelConfigs.ts
    • Structured new dynamic auto resolutions (auto-gemini-3, auto-gemini-2.5, flash) using conditional contexts matching useGemini3_5Flash and hasAccessToPreview.
    • Configured distinct classifier routing lists for flash and pro tiers that resolve cleanly to gemini-3.5-flash or gemini-3-flash-preview based on user flags.
  • config.ts
    • Added hasGemini35FlashGAAccess() to probe runtime experiments and configure default flash models (setFlashModels).
    • Integrated getReleaseChannel() helper mapping back to the standard version channel.

2. Policy Chains & Fallback Mechanics (packages/core/src/availability/)

  • policyHelpers.ts
    • Updated policy-slicing logic (resolvePolicyChain) to dynamically check for useGemini3_5Flash flags.
    • Added family-based auto-routing fallbacks for Gemini 3 chains to wrap around cleanly when primary choices are exhausted.
  • policyCatalog.ts
    • Updated getModelPolicyChain templates to conditionally load proModel overrides based on the 3.5 Flash GA launch settings.

3. Routing Strategies (packages/core/src/routing/strategies/)

  • Updated classifier strategies (approvalModeStrategy, classifierStrategy, gemmaClassifierStrategy, numericalClassifierStrategy, overrideStrategy) to pass the useGemini3_5Flash access context into all model resolution calls, ensuring aligned and predictable routing behavior across the agent workflow.

4. Frontend & Terminal UI (packages/cli/src/ui/components/)

  • ModelDialog.tsx
    • Updated the manual model selection UI to correctly sort and render the new GA models (gemini-3.1-flash-lite, gemini-3.5-flash).
    • Filtered out retired/retired-preview options (like none) from the selectable list.
  • Updated related UI layouts, snapshot tests, and markdown helper guides to reflect the consolidated model list.

How to Validate

Do Sanity testing with Zed / Jetbrains

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@sripasg sripasg self-assigned this Jun 5, 2026
@sripasg sripasg requested review from a team as code owners June 5, 2026 23:52
@github-actions github-actions Bot added the size/xl An extra large PR label Jun 5, 2026
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

📊 PR Size: size/XL

  • Lines changed: 2868
  • Additions: +2207
  • Deletions: -661
  • Files changed: 70

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

🛑 Action Required: Evaluation Approval

Steering changes have been detected in this PR. To prevent regressions, a maintainer must approve the evaluation run before this PR can be merged.

Maintainers:

  1. Go to the Workflow Run Summary.
  2. Click the yellow 'Review deployments' button.
  3. Select the 'eval-gate' environment and click 'Approve'.

Once approved, the evaluation results will be posted here automatically.

@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 unifies model management by promoting Gemini 3.1 Flash Lite to GA and introducing support for Gemini 3.5 Flash. It enhances the routing infrastructure, policy chains, and terminal UI to handle these new models dynamically based on user permissions and experimental flags, ensuring a seamless and configurable experience for users.

Highlights

  • Model Promotion and Addition: Promoted Gemini 3.1 Flash Lite to GA and integrated support for Gemini 3.5 Flash across the backend and routing layers.
  • Routing and Policy Enhancements: Updated model resolution, fallback mechanics, and classifier strategies to dynamically route requests based on user permissions and experimental flags.
  • UI and Configuration Updates: Refreshed the ModelDialog UI to reflect new GA models, filtered out retired preview options, and added new configuration settings for editor and logging preferences.
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.

@sripasg sripasg requested a review from ivanporty June 5, 2026 23:54
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

Size Change: +3.09 kB (+0.01%)

Total Size: 34.1 MB

Filename Size Change
./bundle/chunk-2VN4JRMH.js 0 B -3.43 kB (removed) 🏆
./bundle/chunk-4QV5LXQH.js 0 B -49.2 kB (removed) 🏆
./bundle/chunk-CBFTUCIV.js 0 B -659 kB (removed) 🏆
./bundle/chunk-IU6WVMXH.js 0 B -12.5 kB (removed) 🏆
./bundle/chunk-NJD7UGDD.js 0 B -19.5 kB (removed) 🏆
./bundle/chunk-QEYXXWKI.js 0 B -3.8 kB (removed) 🏆
./bundle/chunk-SAKTCNAD.js 0 B -1.97 MB (removed) 🏆
./bundle/chunk-UR2LFJNW.js 0 B -14.8 MB (removed) 🏆
./bundle/chunk-YKOOP47M.js 0 B -2.78 MB (removed) 🏆
./bundle/core-2T4WPGHV.js 0 B -49.3 kB (removed) 🏆
./bundle/devtoolsService-Y2DPIT6D.js 0 B -28 kB (removed) 🏆
./bundle/gemini-MWAUDT2F.js 0 B -587 kB (removed) 🏆
./bundle/interactiveCli-NRU4PLGC.js 0 B -1.3 MB (removed) 🏆
./bundle/liteRtServerManager-ZS5CPTH4.js 0 B -2.11 kB (removed) 🏆
./bundle/oauth2-provider-EBVC377F.js 0 B -9.16 kB (removed) 🏆
./bundle/chunk-AFD3BSQ6.js 1.98 MB +1.98 MB (new file) 🆕
./bundle/chunk-EV5IWGPQ.js 19.5 kB +19.5 kB (new file) 🆕
./bundle/chunk-FP4JRERB.js 3.8 kB +3.8 kB (new file) 🆕
./bundle/chunk-GDUEMTOX.js 2.78 MB +2.78 MB (new file) 🆕
./bundle/chunk-H5V6QYI2.js 3.43 kB +3.43 kB (new file) 🆕
./bundle/chunk-MC7GYBY4.js 12.5 kB +12.5 kB (new file) 🆕
./bundle/chunk-Q6RLMSV6.js 49.2 kB +49.2 kB (new file) 🆕
./bundle/chunk-QKYBY5BF.js 14.8 MB +14.8 MB (new file) 🆕
./bundle/chunk-Z25MKTS3.js 659 kB +659 kB (new file) 🆕
./bundle/core-67F2JGJY.js 49.5 kB +49.5 kB (new file) 🆕
./bundle/devtoolsService-XTVHZK7G.js 28 kB +28 kB (new file) 🆕
./bundle/gemini-RGCUYI27.js 587 kB +587 kB (new file) 🆕
./bundle/interactiveCli-BK6RZ2CV.js 1.3 MB +1.3 MB (new file) 🆕
./bundle/liteRtServerManager-2ME74YKJ.js 2.11 kB +2.11 kB (new file) 🆕
./bundle/oauth2-provider-IQ5WBYJE.js 9.16 kB +9.16 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-RJTRUG2J.js 39.8 kB 0 B
./bundle/cleanup-XML2LBWT.js 0 B -932 B (removed) 🏆
./bundle/devtools-36NN55EP.js 696 kB 0 B
./bundle/dist-T73EYRDX.js 356 B 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.1 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/memoryDiscovery-QD2WWMTN.js 0 B -980 B (removed) 🏆
./bundle/multipart-parser-KPBZEGQU.js 11.7 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/client/main.js 222 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js 229 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/index.js 13.4 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/types.js 132 B 0 B
./bundle/sandbox-macos-permissive-open.sb 890 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B
./bundle/sandbox-macos-strict-open.sb 4.82 kB 0 B
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB 0 B
./bundle/src-QVCVGIUX.js 47 kB 0 B
./bundle/start-WGLFLTVM.js 0 B -652 B (removed) 🏆
./bundle/tree-sitter-7U6MW5PS.js 274 kB 0 B
./bundle/tree-sitter-bash-34ZGLXVX.js 1.84 MB 0 B
./bundle/cleanup-FQB2FZJT.js 932 B +932 B (new file) 🆕
./bundle/memoryDiscovery-GLOH3I2O.js 980 B +980 B (new file) 🆕
./bundle/start-FBMTFZXF.js 652 B +652 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 introduces support for Gemini 3.5 Flash GA, retires Gemini 3.1 Flash Lite preview models, and updates model configurations, routing strategies, and UI displays accordingly. Two high-severity issues were identified in the review: first, hasGemini35FlashGAAccess mutates global module-level variables, introducing potential race conditions in concurrent environments; second, the DEFAULT_GEMINI_MODEL option in ModelDialog.tsx is missing its value property, which will break duplicate filtering.

Comment on lines +3500 to +3510
if (hasAccess) {
// Gemini API key users should have the ability to manually select the
// old preview flash model.
if (authType === AuthType.USE_GEMINI) {
setFlashModels('gemini-3-flash-preview', 'gemini-3.5-flash');
} else {
setFlashModels('gemini-3-flash', 'gemini-3-flash');
}
} else {
setFlashModels('gemini-3-flash-preview', 'gemini-2.5-flash');
}

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.

high

The method hasGemini35FlashGAAccess is a query/checker method, but it has a major side effect of mutating global module-level variables (PREVIEW_GEMINI_FLASH_MODEL and DEFAULT_GEMINI_FLASH_MODEL via setFlashModels). This violates the design principle of keeping query methods side-effect free, and more importantly, introduces a race condition in concurrent environments (such as concurrent test runs or multi-session server environments) where different sessions will overwrite each other's global model definitions.

To resolve this, avoid using module-level global variables for session-specific state. Instead, keep the resolved model mappings instance-scoped (e.g., as properties on the Config class or resolved dynamically using the instance context).

References
  1. Avoid module-level global variables for state to prevent race conditions and memory issues in concurrent environments. Instead, use session-scoped or instance-scoped state.

Comment on lines 223 to 225
title: getDisplayString(DEFAULT_GEMINI_MODEL),
key: DEFAULT_GEMINI_MODEL,
},

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.

high

The option object for DEFAULT_GEMINI_MODEL is missing the value property. Because options.filter (line 304) checks option.value to filter out duplicates, having value as undefined will cause unexpected behavior and potential filtering bugs when multiple options lack a value property.

        value: DEFAULT_GEMINI_MODEL,
        title: getDisplayString(DEFAULT_GEMINI_MODEL),
        key: DEFAULT_GEMINI_MODEL,
      },

@sripasg sripasg closed this Jun 5, 2026
@sripasg sripasg deleted the xcodegcli_release_branch_add_35_flash branch June 5, 2026 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xl An extra large PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants