fix(core,cli): resolve false model capacity exhaustion and fix core quota lookup model mapping - #28730
Conversation
…uota lookup model mapping
|
📊 PR Size: size/L
|
|
Size Change: +1.97 kB (+0.01%) Total Size: 35.2 MB
ℹ️ View Unchanged
|
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 improves the reliability and clarity of model quota management. It addresses user-facing confusion by providing specific feedback during high-demand periods instead of generic usage limit errors, and it fixes a synchronization bug where model identifiers were mismatched between the server and the client, leading to incorrect quota tracking. 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 introduces customized error messages for capacity-related errors (MODEL_CAPACITY_EXHAUSTED and MODEL_CAPACITY_EXCEEDED) in the CLI UI, displaying a high-demand message instead of a standard usage limit warning. Additionally, it maps the secondary Gemini 3.5 Flash model ID (gemini-3-flash) back to its default ID (gemini-3.5-flash) when parsing user quota buckets in the core configuration, ensuring correct quota tracking. Unit tests have been added to verify both changes. There are no review comments to address.
|
/patch preview |
|
🚀 [Step 1/4] Patch workflow(s) waiting for approval! 📋 Details:
⏳ Status: The patch creation workflow has been triggered and is waiting for deployment approval. Please visit the specific workflow links below and approve the runs. 🔗 Track Progress: |
|
🚀 [Step 2/4] Patch PR Created! 📋 Patch Details:
📝 Next Steps:
🔗 Track Progress: |
|
🚀 [Step 3/4] Patch Release Waiting for Approval! 📋 Release Details:
⏳ Status: The patch release has been triggered and is waiting for deployment approval. Please visit the specific workflow run link below and approve the deployment. You'll receive another update when it completes. 🔗 Track Progress: |
|
✅ [Step 4/4] Patch Release Complete! 📦 Release Details:
🎉 Status: Your patch has been successfully released and published to npm! 📝 What's Available:
🔗 Links: |
|
Does this fix this issue? |
Summary
This pull request resolves false model capacity exhaustion error messaging in the CLI, corrects the client-side model quota lookup mapping in the core package, and ensures that the "Keep trying" option is preserved in the UI during transient capacity surges.
Details
ProQuotaDialog.tsx, we now preserve the "Keep trying" option for capacity-related terminal errors. While automatic background retries remain disabled (to prevent UI hangs during prolonged capacity surges), users now have the visual choice to immediately retry the prompt manually or switch models.isCapacityExceeded?: boolean;to theProQuotaDialogRequestinterface inUIStateContext.tsxand propagated it through the hook inuseQuotaAndFallback.tsandDialogManager.tsx.useQuotaAndFallback.ts, we now display a clear, non-confusing status message ("We are currently experiencing high demand...") instead of a hard "Usage limit reached" warning when encountering capacity errors.config.ts(refreshUserQuota), we reverse-mapSECONDARY_GEMINI_3_5_FLASH_MODEL('gemini-3-flash') back toDEFAULT_GEMINI_3_5_FLASH_MODEL('gemini-3.5-flash') before storing user quotas. This fixes a bug where the model quota is successfully returned by the Code Assist server but tracked under a different identifier than the one active in the client.ProQuotaDialog.test.tsxanduseQuotaAndFallback.test.tsto verify the capacity retry behavior and context state propagation.Related Issues
Resolves usability issues regarding false model capacity exhaustion, incorrect model quota cache lookups, and inability to manually retry prompts during transient capacity surges.
How to Validate
npm test -w @google/gemini-cli -- src/ui/components/ProQuotaDialog.test.tsx src/ui/hooks/useQuotaAndFallback.test.tsnpm test -w @google/gemini-cli-core -- src/config/config.test.tsPre-Merge Checklist