Skip to content

Name the Antigravity CLI in the quota request so Google answers with its Gemini windows - #20483

Closed
ishank26 wants to merge 1 commit into
omacom:quattrofrom
ishank26:fix/antigravity-quota-client-user-agent
Closed

ishank26 wants to merge 1 commit into
omacom:quattrofrom
ishank26:fix/antigravity-quota-client-user-agent

Conversation

@ishank26

Copy link
Copy Markdown

What changes

Fixes #20482.

omarchy-agent-usage-agy asked v1internal:retrieveUserQuotaSummary with User-Agent: antigravity. Google decides which quota groups to answer with from the client identity, and that User-Agent gets an answer holding only the "Claude and GPT models" group: the plan's own "Gemini Models" group is left out, so on a Google AI Pro account the panel showed Antigravity at 0% with no reset time while agy -p '/usage' showed 96% / 87% remaining.

The collector now names the CLI and the version it reports, the way agy itself does (antigravity/cli/1.5.18 (aidev_client; …)), falling back to a full three-part version when agy is not on PATH. Measured against the same token and body, only the User-Agent differs:

User-Agent groups returned
antigravity ["Claude and GPT models"]
antigravity/cli/1.5.18 (aidev_client; os_type=linux; arch=amd64; auth_method=consumer) ["Gemini Models", "Claude and GPT models"]

The version is load-bearing: antigravity/cli/1.5 and antigravity/cli/1.6 (no patch level), antigravity/cli/1.0.0 and 1.1.9 all get the Claude-only answer, while 1.2.0 and up get both groups, which is why the fallback keeps a full version rather than the bare name.

Nothing else in the collector changes: with the Gemini group in the answer, extract_limits() fills Session/Weekly from it as before, and the retrieveUserQuota fallback still covers Google AI Ultra, where the summary really does omit Gemini.

Verification

  • ./test/shell.d/agent-usage-agy-test.sh — all 8 checks pass, including two new ones: the request carries antigravity/cli/1.5.20 (aidev_client; auth_method=consumer) when the stubbed CLI reports 1.5.20, and a full three-part version when there is no CLI to ask.

  • On the reporter's machine (Omarchy 4.5.0-3, Google AI Pro), with the patched collector installed: omarchy-agent-usage-update --force agy, then the record read

    Session (5-hour)  14.34% used   resets 2026-11-28T00:08Z
    Weekly (7-day)     5.09% used   resets 2026-12-04T19:08Z
    

    against agy -p '/usage' at the same moment: 86% remaining / reset 2026-11-28T00:08:49Z and 95% remaining / reset 2026-12-04T19:08:49Z (used = 100 − remaining). Before the patch the same record read 0.0 for both windows with empty resetsAt.

  • The CLI's own request shape was confirmed by intercepting its traffic with a local proxy (HTTPS_PROXY + SSL_CERT_FILE), not inferred: it sends that User-Agent to daily-cloudcode-pa.googleapis.com; cloudcode-pa.googleapis.com answers identically given the same UA.

Screenshots

No visible change: the panel renders the same meters, now with the plan's real numbers instead of zeros.

@greptile-apps

greptile-apps Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 4/5 · Handle installed versions below 1.2.0 before merging so the fix also works for older CLI installs.RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The change affects quota summaries used by the Antigravity usage collector.

Handle installed versions below 1.2.0 before merging so the fix also works for older CLI installs.

Findings

  1. P1 Older installs miss Gemini windows ▶

Summary

The collector now sends a CLI-shaped User-Agent so Google returns Gemini quota windows.

  • Quota requests now identify the Antigravity CLI and its version.

Reviews (1) · Last reviewed commit: "Name the Antigravity CLI in the quota re..." · Reviewed by Greptile

Comment on lines +395 to +396
if named:
version = named.group(0)

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.

P1 Older installs miss Gemini windows

If the installed agy reports a version below 1.2.0, client_user_agent() replaces the working fallback with that version. Google then omits Gemini windows, as the new comment explains. Omarchy supports user-managed CLI installs without requiring a minimum version, so the fix remains incomplete for those users.

Keep the fallback when the reported version is below 1.2.0, and cover that case in the test.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@omarchybot omarchybot added the bug Something isn't working label Nov 27, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

GPT-6 High in Codex reviewed the collector, fixtures, and overlapping fixes, including #18730 and #20114. The proposed collector identifies itself as Google's consumer CLI even when the CLI is absent, and sends that identity on plan and fallback requests as well as the quota summary. This waits on a maintainer decision about a supported source for the quota data. Google Antigravity terms, section 6 · Official CLI quota display

Opus 5.5 High agreed after a separate source review, whose independence is not guaranteed, and found that an Argon-first reply can still put Argon's number in the main Gemini meter. The new fixtures supply the same quota data regardless of the header. This was a source review without worker tests or live requests to Google.

@dhh

dhh commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Superseded by #20916, which delegates to agy -p /usage --output-format json instead of calling Google's private API directly or spoofing User-Agent headers. Thanks for the contribution!

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agents panel shows Antigravity limits as 0% with no reset time: the quota request's User-Agent hides the Gemini group

3 participants