fix(core): emit quota data for non-auto models in footer#25080
fix(core): emit quota data for non-auto models in footer#25080Anjaligarhwal wants to merge 1 commit intogoogle-gemini:mainfrom
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 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
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 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.
|
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 Closing this as a duplicate, sorry didn't see this one earlier! |
|
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! |
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/statsdisplays the quota correctly.Details
emitQuotaChangedEvent()callsgetPooledQuota()directly, which returns an empty object for non-auto models (isAutoModel()check fails). The event is emitted withundefinedvalues, and the footer skips rendering.The public getters (
getQuotaRemaining(),getQuotaLimit(),getQuotaResetTime()) each have a fallback that resolves the specific model and looks it up inmodelQuotas. Both/statsand the footer initialization already use these getters — only the event-emission path was missing the fallback.The fix replaces the direct
getPooledQuota()call inemitQuotaChangedEvent()with the public getters, making the event path consistent with the initialization path and/stats.Related Issues
Fixes #25065
How to Validate
/modelto select a specific model (e.g.gemini-3.1-pro-preview)/footerand enable the quota section/stats— verify quota info is shownPre-Merge Checklist