Skip to content

fix(core,cli): resolve false model capacity exhaustion and fix core quota lookup model mapping - #28730

Merged
DavidAPierce merged 6 commits into
mainfrom
fix/quota-exhaustion-mapping
Aug 11, 2026
Merged

fix(core,cli): resolve false model capacity exhaustion and fix core quota lookup model mapping#28730
DavidAPierce merged 6 commits into
mainfrom
fix/quota-exhaustion-mapping

Conversation

@DavidAPierce

@DavidAPierce DavidAPierce commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

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

  1. CLI Quota Dialog Options: In 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.
  2. Hook and Context State Propagation: Added isCapacityExceeded?: boolean; to the ProQuotaDialogRequest interface in UIStateContext.tsx and propagated it through the hook in useQuotaAndFallback.ts and DialogManager.tsx.
  3. Dedicated Capacity Messaging: In 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.
  4. Core Quota Model Identifier Mapping: In config.ts (refreshUserQuota), we reverse-map SECONDARY_GEMINI_3_5_FLASH_MODEL ('gemini-3-flash') back to DEFAULT_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.
  5. Testing: Added and updated unit tests in ProQuotaDialog.test.tsx and useQuotaAndFallback.test.ts to 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

  1. Run CLI tests:
    npm test -w @google/gemini-cli -- src/ui/components/ProQuotaDialog.test.tsx src/ui/hooks/useQuotaAndFallback.test.ts
  2. Run Core tests:
    npm test -w @google/gemini-cli-core -- src/config/config.test.ts
  3. Run full preflight verification:
    npm run preflight

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

@DavidAPierce
DavidAPierce requested a review from a team as a code owner August 7, 2026 20:47
@github-actions github-actions Bot added the size/m A medium sized PR label Aug 7, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

📊 PR Size: size/L

  • Lines changed: 281
  • Additions: +262
  • Deletions: -19
  • Files changed: 8

@gemini-cli gemini-cli Bot added the status/need-issue Pull requests that need to have an associated issue. label Aug 7, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Size Change: +1.97 kB (+0.01%)

Total Size: 35.2 MB

Filename Size Change
./bundle/chunk-ASXWZEC3.js 0 B -49.2 kB (removed) 🏆
./bundle/chunk-KQUB25CY.js 0 B -13 kB (removed) 🏆
./bundle/chunk-KVJO2LGE.js 0 B -3.43 kB (removed) 🏆
./bundle/chunk-LARYG42B.js 0 B -661 kB (removed) 🏆
./bundle/chunk-MF67USLF.js 0 B -3.65 MB (removed) 🏆
./bundle/chunk-TUFZDEHN.js 0 B -3.77 kB (removed) 🏆
./bundle/chunk-UUGFM6F5.js 0 B -19.5 kB (removed) 🏆
./bundle/chunk-ZTRGX6RY.js 0 B -16.6 MB (removed) 🏆
./bundle/core-6JCEHBVC.js 0 B -50.6 kB (removed) 🏆
./bundle/devtoolsService-HPTKPPSD.js 0 B -147 kB (removed) 🏆
./bundle/gemini-DXAW5XN3.js 0 B -614 kB (removed) 🏆
./bundle/interactiveCli-SSHMXB7Q.js 0 B -1.31 MB (removed) 🏆
./bundle/liteRtServerManager-NOGS3SPL.js 0 B -2.08 kB (removed) 🏆
./bundle/oauth2-provider-NVMEI3UR.js 0 B -9.12 kB (removed) 🏆
./bundle/chunk-DTI5ACON.js 16.6 MB +16.6 MB (new file) 🆕
./bundle/chunk-KUULM3WX.js 3.65 MB +3.65 MB (new file) 🆕
./bundle/chunk-MQ5AVQKQ.js 661 kB +661 kB (new file) 🆕
./bundle/chunk-POI4HFLK.js 13 kB +13 kB (new file) 🆕
./bundle/chunk-RMAQGBRJ.js 3.77 kB +3.77 kB (new file) 🆕
./bundle/chunk-XWYQLZQ6.js 49.2 kB +49.2 kB (new file) 🆕
./bundle/chunk-YML7T3VP.js 3.43 kB +3.43 kB (new file) 🆕
./bundle/chunk-YYVHSPK7.js 19.5 kB +19.5 kB (new file) 🆕
./bundle/core-CLUH6JIT.js 50.6 kB +50.6 kB (new file) 🆕
./bundle/devtoolsService-76VYHAJA.js 147 kB +147 kB (new file) 🆕
./bundle/gemini-BRWXY3NY.js 614 kB +614 kB (new file) 🆕
./bundle/interactiveCli-M3BKRATT.js 1.31 MB +1.31 MB (new file) 🆕
./bundle/liteRtServerManager-PERZWKEU.js 2.08 kB +2.08 kB (new file) 🆕
./bundle/oauth2-provider-SX3KMKWI.js 9.12 kB +9.12 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-L5V3KIDT.js 1.62 kB 0 B
./bundle/chunk-TUDYL3X4.js 40.3 kB 0 B
./bundle/cleanup-YPUCSON3.js 0 B -902 B (removed) 🏆
./bundle/devtools-TYCPOPV3.js 683 kB 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.38 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/https-proxy-agent-AVGR4LHR.js 490 B 0 B
./bundle/multipart-parser-E7RMVJWU.js 11.7 kB 0 B
./bundle/multipart-parser-KPBZEGQU.js 11.7 kB 0 B
./bundle/sandbox-macos-permissive-open.sb 5.29 kB 0 B
./bundle/sandbox-macos-permissive-proxied.sb 5.58 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.3 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.5 kB 0 B
./bundle/sandbox-macos-strict-open.sb 4.75 kB 0 B
./bundle/sandbox-macos-strict-proxied.sb 4.96 kB 0 B
./bundle/src-65GKNWUJ.js 45.4 kB 0 B
./bundle/src-U45KTUYT.js 45.7 kB 0 B
./bundle/src-XZYPU6PJ.js 352 kB 0 B
./bundle/start-WPF5XI62.js 0 B -622 B (removed) 🏆
./bundle/tree-sitter-7U6MW5PS.js 274 kB 0 B
./bundle/tree-sitter-bash-34ZGLXVX.js 1.84 MB 0 B
./bundle/worker/worker-entry.js 363 kB 0 B
./bundle/cleanup-OJJHUL6I.js 902 B +902 B (new file) 🆕
./bundle/start-F3HA45CQ.js 622 B +622 B (new file) 🆕

compressed-size-action

@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 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

  • CLI Error Handling: Updated the CLI to distinguish between standard usage limits and model capacity issues, providing a more accurate 'high demand' message when capacity is exhausted.
  • Core Quota Mapping: Implemented a reverse-mapping for model identifiers in the core package to ensure quotas returned by the server are correctly associated with the active client-side model.
  • Test Coverage: Added unit tests for both the CLI quota hook and the core configuration logic to verify the new error messaging and quota mapping behavior.
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.

@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 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.

@github-actions github-actions Bot added the size/l A large sized PR label Aug 10, 2026
@DavidAPierce
DavidAPierce enabled auto-merge August 11, 2026 15:08
@DavidAPierce
DavidAPierce added this pull request to the merge queue Aug 11, 2026
Merged via the queue into main with commit 188e255 Aug 11, 2026
68 of 73 checks passed
@DavidAPierce
DavidAPierce deleted the fix/quota-exhaustion-mapping branch August 11, 2026 15:22
@DavidAPierce

Copy link
Copy Markdown
Contributor Author

/patch preview

@github-actions

Copy link
Copy Markdown

🚀 [Step 1/4] Patch workflow(s) waiting for approval!

📋 Details:

  • Channels: preview
  • Commit: 188e255bf55ebfb6b4f3a675c5b414eaef646ba2
  • Workflows Created: 1

⏳ 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:

@github-actions

Copy link
Copy Markdown

🚀 [Step 2/4] Patch PR Created!

📋 Patch Details:

📝 Next Steps:

  1. Review and approve the hotfix PR: #28771
  2. Once merged, the patch release will automatically trigger
  3. You'll receive updates here when the release completes

🔗 Track Progress:

@github-actions

Copy link
Copy Markdown

🚀 [Step 3/4] Patch Release Waiting for Approval!

📋 Release Details:

  • Environment: prod
  • Channel: preview → publishing to npm tag preview
  • Version: v0.55.0-preview.2
  • Hotfix PR: Merged ✅
  • Release Branch: release/v0.55.0-preview.2-pr-28730

⏳ 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:

@github-actions

Copy link
Copy Markdown

[Step 4/4] Patch Release Complete!

📦 Release Details:

🎉 Status: Your patch has been successfully released and published to npm!

📝 What's Available:

🔗 Links:

@zbynekwinkler

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/l A large sized PR size/m A medium sized PR status/need-issue Pull requests that need to have an associated issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants