You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fall back to retrieveUserQuota for Gemini limits on Ultra - #19908
On Google AI Ultra, v1internal:retrieveUserQuotaSummary omits the Gemini group and returns only "Claude and GPT models". After #19866 rightly stopped substituting that third-party group for Gemini, Ultra accounts showed no quota meter in the agents panel ("limits": []).
Meanwhile, v1internal:retrieveUserQuota on the same Cloud Code endpoint still reports every Gemini model's live 5-hour quota bucket (remainingFraction and resetTime), ticking down in real time as prompts run.
What changed
bin/omarchy-agent-usage-agy: When retrieveUserQuotaSummary returns no Gemini Session/Weekly window, fall back to v1internal:retrieveUserQuota and pick the fullest gemini* bucket as Session (5-hour) (dropping Google's rolling now+5h synthetic resetTime when usage is 0%, and degrading cleanly on HTTP 400/404 while preserving stale cached limits on transient errors).
test/shell.d/agent-usage-agy-test.sh: Covers the Ultra fallback, project forwarding, transient 500 stale-cache preservation, untouched-bucket reset suppression, skipping the fallback when the summary already includes Gemini, and graceful 404 degradation.
Verification
Ran bin/omarchy-agent-usage-agy --force live against a Google AI Ultra account: now reports live "Session (5-hour)" usage (7.14%, real resetsAt) instead of [].
Passed test/shell.d/agent-usage-agy-test.sh, test/shell.d/agent-usage-shared-test.sh, and test/shell.d/agent-usage-partition-test.sh.
[Medium impact] The PR appears safe to merge; no actionable issues were found.
Summary
Adds retrieveUserQuota as a fallback when the quota summary has no Gemini Session or Weekly window.
Antigravity limits show a Gemini session meter when the summary omits it.
No actionable issues were found. Tests were not run during this review.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Read quota summary] --> B{Gemini window present?}
B -->|Yes| C[Save summary limits]
B -->|No| D[Read model quotas]
D -->|Success| E[Add most-used Gemini bucket]
E --> C
D -->|HTTP 400 or 404| C
D -->|Other failure| F[Keep cached limits as stale]
GPT-6 in Codex (reasoning effort not exposed) checked 046e90638d051310eb2d1b200d2d2c62e427a113 on a disposable Omarchy worker. With a local HTTPS quota fixture and dummy sign-in, the base emitted no Gemini meter, this head emitted the fixture's 37% Session usage, and reverting the fix removed it again. The CLI and six focused collector, account, update and panel test files passed. These were simulated API responses; no live Google account was queried.
One case remains open at bin/omarchy-agent-usage-agy:372: the fallback runs beyond Ultra and always calls the selected model bucket Session (5-hour). A synthetic Free-tier bucket resetting six days later was emitted with that label. A Free-tier report describes per-model quotas matching the weekly window, so the fallback needs its window assumption checked for those accounts.
The configured second reviewer, Opus 5.5 High, hit its weekly quota; omabot review --ping confirmed it was unavailable. The readiness judge also returned no judgement. This is waiting on the maintainer for review, the non-Ultra window assumption, and the overlapping request-header fixes in #17636, #17825, #18730 and #19834.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
On Google AI Ultra,
v1internal:retrieveUserQuotaSummaryomits the Gemini group and returns only"Claude and GPT models". After #19866 rightly stopped substituting that third-party group for Gemini, Ultra accounts showed no quota meter in the agents panel ("limits": []).Meanwhile,
v1internal:retrieveUserQuotaon the same Cloud Code endpoint still reports every Gemini model's live 5-hour quota bucket (remainingFractionandresetTime), ticking down in real time as prompts run.What changed
bin/omarchy-agent-usage-agy: WhenretrieveUserQuotaSummaryreturns no GeminiSession/Weeklywindow, fall back tov1internal:retrieveUserQuotaand pick the fullestgemini*bucket asSession (5-hour)(dropping Google's rollingnow+5hsyntheticresetTimewhen usage is0%, and degrading cleanly on HTTP 400/404 while preserving stale cached limits on transient errors).test/shell.d/agent-usage-agy-test.sh: Covers the Ultra fallback, project forwarding, transient 500 stale-cache preservation, untouched-bucket reset suppression, skipping the fallback when the summary already includes Gemini, and graceful 404 degradation.Verification
bin/omarchy-agent-usage-agy --forcelive against a Google AI Ultra account: now reports live"Session (5-hour)"usage (7.14%, realresetsAt) instead of[].test/shell.d/agent-usage-agy-test.sh,test/shell.d/agent-usage-shared-test.sh, andtest/shell.d/agent-usage-partition-test.sh.