fix(core): ensure stable fallback for restricted preview models#26999
Conversation
Corrects model selection failures for GCP/Google Auth users by: 1. Verifying preview access via quota instead of assuming true for GCP. 2. Preserving original model intent in policyHelpers to ensure correct downgrade to the Gemini 2.5 stable chain.
Summary of ChangesHello, 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 PR addresses issues where users with restricted preview access encountered errors when attempting to use tools requiring Gemini 3. By decoupling preview access from Vertex AI authentication and preserving the original model intent during policy resolution, the system now correctly falls back to the stable Gemini 2.5 chain. 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 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 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
|
There was a problem hiding this comment.
Code Review
This pull request refactors the model policy resolution logic in policyHelpers.ts to capture and use the original Gemini 3 model intent before any normalization or downgrades occur. It also updates the configuration logic in config.ts to restrict preview model access specifically to the USE_GEMINI authentication type, removing the previous inclusion of USE_VERTEX_AI. I have no feedback to provide as there were no review comments.
|
Size Change: +91 B (0%) Total Size: 34.1 MB
ℹ️ View Unchanged
|
Summary
This PR fixes the "Preview Release Channel" error that occurred when users (specifically those on GCP/Vertex AI) attempted to use tools or utilities hard-wired to Gemini 3 while having restricted preview access. It ensures that the system correctly identifies restricted access and transparently falls back to the Gemini 2.5 stable chain.
Details
Related Issues
Related to the issue of tool calls failing for restricted users.
How to Validate
```bash
npm test -- packages/core/src/availability/policyHelpers.test.ts
```
Pre-Merge Checklist