Skip to content

fix(core): emit quota data for non-auto models in footer#25080

Closed
Anjaligarhwal wants to merge 1 commit intogoogle-gemini:mainfrom
Anjaligarhwal:fix/core/footer-quota-non-auto-model
Closed

fix(core): emit quota data for non-auto models in footer#25080
Anjaligarhwal wants to merge 1 commit intogoogle-gemini:mainfrom
Anjaligarhwal:fix/core/footer-quota-non-auto-model

Conversation

@Anjaligarhwal
Copy link
Copy Markdown
Contributor

Summary

Footer quota section renders nothing when a user selects a non-auto model via /model (e.g. gemini-3.1-pro-preview), even though /stats displays the quota correctly.

Details

emitQuotaChangedEvent() calls getPooledQuota() directly, which returns an empty object for non-auto models (isAutoModel() check fails). The event is emitted with undefined values, and the footer skips rendering.

The public getters (getQuotaRemaining(), getQuotaLimit(), getQuotaResetTime()) each have a fallback that resolves the specific model and looks it up in modelQuotas. Both /stats and the footer initialization already use these getters — only the event-emission path was missing the fallback.

The fix replaces the direct getPooledQuota() call in emitQuotaChangedEvent() with the public getters, making the event path consistent with the initialization path and /stats.

Related Issues

Fixes #25065

How to Validate

  1. Start gemini-cli and run /model to select a specific model (e.g. gemini-3.1-pro-preview)
  2. Run /footer and enable the quota section
  3. Use the CLI until quota data is available
  4. Run /stats — verify quota info is shown
  5. Verify the footer now also displays quota percentage

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
    • Windows
    • Linux

@Anjaligarhwal Anjaligarhwal requested a review from a team as a code owner April 10, 2026 00:54
@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 addresses an issue where the footer quota section failed to render for non-auto models. By switching from a direct internal method call to established public getters, the system now correctly resolves and emits quota data, ensuring the UI accurately reflects usage limits across all model types.

Highlights

  • Quota Event Emission: Updated emitQuotaChangedEvent to use public getters instead of direct pooled quota access, ensuring consistent data retrieval for non-auto models.
  • Consistency: Aligned the event emission logic with existing initialization and stats reporting paths to fix missing footer quota rendering.
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 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 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

  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.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

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 refactors the emitQuotaChangedEvent method in packages/core/src/config/config.ts. The logic now retrieves quota details using individual getter methods—getQuotaRemaining, getQuotaLimit, and getQuotaResetTime—instead of the aggregate getPooledQuota method. I have no feedback to provide.

@gemini-cli gemini-cli Bot added priority/p1 Important and should be addressed in the near term. area/core Issues related to User Interface, OS Support, Core Functionality labels Apr 10, 2026
@jackwotherspoon
Copy link
Copy Markdown
Collaborator

Hey @Anjaligarhwal thanks for the PR.

I actually was working on this unrelated to the issue tagged based on someone on X's mention of this.

I have a similar change as part of #25121 with a regression test and other improvements to quota of /footer.

Closing this as a duplicate, sorry didn't see this one earlier!

@Anjaligarhwal
Copy link
Copy Markdown
Contributor Author

Hey @jackwotherspoon, No worries at all! I saw the issue, find it interesting and dug into the config code, just glad we landed on the same root cause. Your PR is more thorough anyway with the regression test and the fraction-only handling. Thanks for the mention!

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

Labels

area/core Issues related to User Interface, OS Support, Core Functionality priority/p1 Important and should be addressed in the near term.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Model usage quota doesn't show on footer

2 participants