fix(patch): cherry-pick 188e255 to release/v0.55.0-preview.2-pr-28730 to patch version v0.55.0-preview.2 and create version 0.55.0-preview.3 - #28771
Conversation
…uota lookup model mapping (#28730)
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 introduces improvements to error handling and quota management. It specifically addresses capacity-related errors by providing clearer user feedback and enabling automatic retries, while also fixing a discrepancy in how specific model quotas are tracked and reported. 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
|
|
📊 PR Size: size/L
|
There was a problem hiding this comment.
Code Review
This pull request introduces robust handling for model capacity exceeded errors, including detecting capacity exhaustion, displaying specialized high-demand messages, and auto-retrying in low verbosity mode. It also adds reverse-mapping for gemini-3-flash back to gemini-3.5-flash when updating model quotas. The review feedback highlights a critical issue in config.ts where an exhausted quota (with a fraction of 0) may fail to be saved on the first fetch because the default limit of 0 fails the validation check; a code suggestion is provided to default this limit to 100 instead.
| limit = | ||
| bucket.remainingFraction > 0 | ||
| ? Math.round(remaining / bucket.remainingFraction) | ||
| : (this.modelQuotas.get(bucket.modelId)?.limit ?? 0); | ||
| : (this.modelQuotas.get(modelId)?.limit ?? 0); |
There was a problem hiding this comment.
When remainingFraction is 0 (indicating the quota is completely exhausted) and there is no previously stored quota limit for the model, defaulting the limit to 0 causes the limit > 0 validation check on line 2345 to fail. As a result, the exhausted quota (remaining: 0) is never stored in modelQuotas, and subsequent calls to getQuotaRemaining() will return undefined (unknown/unlimited) instead of 0.
To ensure exhausted quotas are correctly registered on the first fetch, we should default the limit to 100 (consistent with the normalized scale used in the else block) when no previous limit exists.
| limit = | |
| bucket.remainingFraction > 0 | |
| ? Math.round(remaining / bucket.remainingFraction) | |
| : (this.modelQuotas.get(bucket.modelId)?.limit ?? 0); | |
| : (this.modelQuotas.get(modelId)?.limit ?? 0); | |
| limit = | |
| bucket.remainingFraction > 0 | |
| ? Math.round(remaining / bucket.remainingFraction) | |
| : (this.modelQuotas.get(modelId)?.limit ?? 100); |
|
Size Change: +1.97 kB (+0.01%) Total Size: 35.2 MB
ℹ️ View Unchanged
|
da3710e
into
release/v0.55.0-preview.2-pr-28730
This PR automatically cherry-picks commit 188e255 to patch version v0.55.0-preview.2 in the preview release to create version 0.55.0-preview.3.