Rolling production to 20% using Gemini 3 for Flash and Flash Lite from 2.5#6176
Rolling production to 20% using Gemini 3 for Flash and Flash Lite from 2.5#6176shixiao-coder wants to merge 6 commits intodatacommonsorg:masterfrom
Conversation
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 pull request initiates a phased rollout of the Gemini 3 Flash model in the production environment. By enabling the corresponding feature flag with a 20% traffic allocation, the team aims to monitor performance and stability before considering a wider release. 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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request enables the 'enable_gemini_3_flash' feature flag in production and introduces a 20% rollout percentage. A critical issue was identified regarding the non-deterministic implementation of the rollout logic, which could cause inconsistent state and request failures when the flag is checked multiple times within a single request.
| "owner": "shixiao", | ||
| "description": "Enables Gemini 3 Flash for NL detection." | ||
| "description": "Enables Gemini 3 Flash for NL detection.", | ||
| "rollout_percentage": 20 |
There was a problem hiding this comment.
Adding a rollout_percentage here introduces a significant risk due to the current implementation of is_feature_enabled in server/lib/feature_flags.py. The function uses random.random() on every call, making the result non-deterministic within a single request. In server/lib/nl/detection/llm_api.py, is_feature_enabled is called twice: once to determine the api_version (line 86) and once via detect_model_name() (line 93) to determine the model_name. With a 20% rollout, there is a high probability (approximately 32%) that one call returns True and the other returns False, leading to a mismatch between the API version (v1beta vs v1) and the model name. This will likely cause request failures. The rollout logic should be updated to be deterministic per request (e.g., by caching the result in flask.g) before enabling a partial rollout.
This change enables 20% usage of Gemini 3. Will be merged once staging and autopush looks fine