Skip to content

[Bug]: Antigravity Gemini usage limits missing or stuck at 100% because daily-cloudcode-pa gates Gemini buckets on User-Agent version (1.0.0 vs 2.24.0) #21115

Closed

Description

@cornishandy

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Sign in to Antigravity in T3 Code using a consumer Google account (oauth-personal, e.g. Google AI Ultra where usesGcpTos: false) and use Gemini models so both 5-hour and weekly Gemini quotas are partially consumed in Antigravity IDE (Settings -> Models & Usage).
  2. Open Usage -> Limits in T3 Code.
  3. Observe how apps/server/src/provider/antigravityUsageLimits.ts probes v1internal:retrieveUserQuotaSummary across:
    const ENDPOINTS = [
      "https://daily-cloudcode-pa.googleapis.com",
      "https://cloudcode-pa.googleapis.com",
    ];
    using the hardcoded header:
    "User-Agent": `antigravity/hub/1.0.0 (aidev_client; os_type=${platform}; arch=${architecture}; cl=963137146)`

Expected behavior

Usage -> Limits should display all 4 Antigravity quota buckets (Gemini · 5-hour, Gemini · Weekly, Claude & GPT (shared) · 5-hour, Claude & GPT (shared) · Weekly) with their real remaining percentages and reset timestamps matching Antigravity IDE (Settings -> Models & Usage), and refresh them when sessions run.

Actual behavior

Two related bugs occur in apps/server/src/provider/antigravityUsageLimits.ts:

  1. daily-cloudcode-pa.googleapis.com/v1internal:retrieveUserQuotaSummary gates the Gemini Models group on the client version in User-Agent:
    • When called with User-Agent: antigravity/hub/1.0.0 (...), https://daily-cloudcode-pa.googleapis.com/v1internal:retrieveUserQuotaSummary omits the Gemini Models group (gemini-5h and gemini-weekly) and returns only Claude and GPT models (3p-5h and 3p-weekly).
    • Because windows.length > 0, fetchWindows on main stops after daily-cloudcode-pa.googleapis.com, so Gemini · 5-hour and Gemini · Weekly are completely missing (reported in [Bug]: Antigravity shows token usage only, not limits #16104).
  2. Querying https://cloudcode-pa.googleapis.com (prod) with antigravity/hub/1.0.0 (as in PR fix(usage): show Antigravity Gemini limits when one quota endpoint omits them #20081 or prioritizing cloudcode-pa.googleapis.com first) shows Gemini · 5-hour and Gemini · Weekly permanently stuck at 100% left:
    • For consumer Antigravity accounts (usesGcpTos: false), all actual Antigravity traffic runs against daily-cloudcode-pa.googleapis.com.
    • https://cloudcode-pa.googleapis.com/v1internal:retrieveUserQuotaSummary returns gemini-5h and gemini-weekly buckets even for antigravity/hub/1.0.0, but those prod buckets are unused (remainingFraction: 1, i.e. 100% left with a rolling 4h 59m / 6d 23h reset) and never reflect real consumer Gemini usage.
    • Meanwhile, Antigravity IDE's local language_server (--override_ide_version 2.24.0) sends User-Agent: antigravity/hub/2.24.0 (...) to https://daily-cloudcode-pa.googleapis.com/v1internal:retrieveUserQuotaSummary, which causes daily-cloudcode-pa.googleapis.com to return both Gemini Models (gemini-weekly and gemini-5h with actual live remainingFraction and resetTime) and Claude and GPT models (3p-weekly and 3p-5h) in a single response.
  3. Stale cached usageLimits snapshot:
    • Once ~/.t3/caches/antigravity.json is populated, managedProvider.ts (publishEnrichedSnapshot) preserves the older current.usageLimits snapshot instead of refreshing when sessions run.

Impact

Major degradation or frequent failure

Version or commit

0.1.1-nightly.20261018.3285 (main)

Environment

macOS Darwin arm64, T3 Code Nightly 0.1.1-nightly.20261018.3285, Antigravity (oauth-personal, Google AI Ultra)

Logs or stack traces

# Same consumer OAuth token against daily-cloudcode-pa.googleapis.com/v1internal:retrieveUserQuotaSummary:

# 1. With T3 Code's current header:
# User-Agent: antigravity/hub/1.0.0 (aidev_client; os_type=darwin; arch=arm64; cl=963137146)
{
  "groups": [
    {
      "displayName": "Claude and GPT models",
      "buckets": [
        { "bucketId": "3p-weekly", "window": "weekly", "remainingFraction": 1, "resetTime": "2026-10-25T06:22:04Z" },
        { "bucketId": "3p-5h", "window": "5h", "remainingFraction": 1, "resetTime": "2026-10-18T11:22:04Z" }
      ]
    }
  ]
}

# 2. With Antigravity IDE's current version in User-Agent:
# User-Agent: antigravity/hub/2.24.0 (aidev_client; os_type=darwin; arch=arm64; cl=963137146)
{
  "groups": [
    {
      "displayName": "Gemini Models",
      "buckets": [
        { "bucketId": "gemini-weekly", "window": "weekly", "remainingFraction": 0.85039836, "resetTime": "2026-10-24T23:43:50Z" },
        { "bucketId": "gemini-5h", "window": "5h", "remainingFraction": 0.74666244, "resetTime": "2026-10-18T09:43:50Z" }
      ]
    },
    {
      "displayName": "Claude and GPT models",
      "buckets": [
        { "bucketId": "3p-weekly", "window": "weekly", "remainingFraction": 1, "resetTime": "2026-10-25T06:22:04Z" },
        { "bucketId": "3p-5h", "window": "5h", "remainingFraction": 1, "resetTime": "2026-10-18T11:22:04Z" }
      ]
    }
  ]
}

Workaround

Updating the probe User-Agent in apps/server/src/provider/antigravityUsageLimits.ts from antigravity/hub/1.0.0 to antigravity/hub/2.24.0 (while keeping https://daily-cloudcode-pa.googleapis.com first in ENDPOINTS, or merging across ENDPOINTS) immediately restores live gemini-5h and gemini-weekly usage and reset times on daily-cloudcode-pa.googleapis.com without falling back to the unconsumed 100% left prod buckets on cloudcode-pa.googleapis.com.

Activity

  1. juliusmarminge commented on Oct 18, 2026

    @juliusmarminge
    Member

    Note

    Grok responding on behalf of Julius.

    Confirmed on main: the quota probe sends a fixed antigravity/hub/1.0.0 User-Agent, stops at the first endpoint that returns any windows, and publishEnrichedSnapshot keeps the previously published usage limits when a session publishes a new snapshot. We can't check the server side from the repo, but your responses explain the missing Gemini rows. Open PR #21020 already covers all three parts: it sends a 2.24.0 User-Agent, resolves the consumer quota project, and lets fresh probes replace stale limits. I've linked this issue to that PR. #20081 only merges both endpoints with the old User-Agent, which would show the unused prod buckets you describe.

  2. added
    acceptedfeature request accepted
    bugSomething is broken or behaving incorrectly.
    via-triageFiled through npx t3 triage
    on Oct 18, 2026
  3. DeepitMagee commented on Oct 20, 2026

    @DeepitMagee

    I ran into this same bug in a separate client and captured the live requests from Antigravity IDE's language_server via a local proxy to see what it actually sends.

    A few findings from testing one variable at a time:

    1. Only the User-Agent version (2.24.0) matters: The IDE sends POST /v1internal:retrieveUserQuotaSummary to daily-cloudcode-pa.googleapis.com with {"project":"aicode-consumers"} and User-Agent: antigravity/hub/2.24.0 (...). Changing hub/1.0.0 to hub/2.24.0 immediately returns the missing Gemini Models group (gemini-5h and gemini-weekly). The cl=... build number in the User-Agent has no effect.
    2. OAuth tokens and project IDs don't change the result: Using T3's ACP token (acp_token.json with project_id: "aicode-consumers") and the IDE's own token (jetski-standalone-oauth-token) returned identical responses, despite having different OAuth scopes.
    3. daily-cloudcode-pa must stay ahead of cloudcode-pa (prod): Even with hub/2.24.0, the prod host (cloudcode-pa.googleapis.com) returns every bucket stuck at remainingFraction: 1 (100% left) with a rolling reset time. daily-cloudcode-pa has to be queried first so prod is only used as a fallback.
    4. Note on Argon quota (fix(antigravity): report Gemini 4 Argon weekly quota separately #21361): On a Pro account, daily-cloudcode-pa with hub/1.0.0 still returns gemini-argon-wtu-weekly alongside 3p-5h and 3p-weekly (3 buckets total rather than 2), whereas hub/2.24.0 returns all 5.
  4. markshan00 commented on Oct 21, 2026

    @markshan00

    Live verification of the identities in #21361 and #21020 from a second consumer account.

    Setup: macOS arm64, T3 Code v0.1.1 stable, Antigravity ACP runtime 1.3.0 installed by T3, personal Google sign-in. Every request used the same OAuth credential and the same project body from acp_token.json; only User-Agent changed. All requests ran concurrently at 2026-10-21 10:16 UTC.

    retrieveUserQuotaSummary:

    Host User-Agent Gemini 5h / weekly remainingFraction 3p-*
    daily antigravity/hub/1.0.0 (aidev_client; …; cl=963137146) (current main) not returned 1 / 1
    daily #21361: antigravity/acp/1.3.0 (aidev_client; os_type=darwin; arch=arm64; host_path=t3-code/0.1.0; proxy_client=antigravity/sdk) 0.848104 / 0.9620177 1 / 1
    daily #21361 with os_type=win32; arch=amd64 0.848104 / 0.9620177 1 / 1
    daily #21361 with os_type=linux; arch=amd64 0.8467101 / 0.9606529 1 / 1
    daily antigravity/hub/2.24.0 (aidev_client; …) (#21020 / this issue) 0.848104 / 0.9620177 1 / 1
    prod #21361, darwin 1 / 1 1 / 1

    So #21361's identity, as it would be built on each platform (it maps x64 to amd64 and keeps win32), returns the consumed Gemini quota on this account. The prod host still reports every bucket as unused, so main's most-used merge keeps the daily values.

    An hour earlier (09:03 UTC) I compared against the native Antigravity app, which showed Gemini 5-hour 90% left and weekly 98% left. At the same time the daily summary returned 0.9033314 / 0.97561556 with antigravity/hub/2.9.1 darwin/arm64, while the current main identity omitted the Gemini group. With the old identity, fetchAvailableModels on the daily host already carried the consumed fraction in per-model quotaInfo.

    Not checked: business/Workspace accounts, accounts with an Argon quota (this account returned no gemini-argon-* bucket), and the rendered T3 UI with #21361 applied. No credentials, project IDs or account identifiers are included.

  5. t3dotgg commented on Oct 21, 2026

    @t3dotgg
    Member

    Note

    🤖 Claude Opus 5.5 responding on behalf of Theo

    Thanks for the report. One part of this is fixed on main in #18723. Please test on the nightly built from main on 2026-10-21, or on the next stable release. One part is still open: Gemini quota readings still use the 1.0.0 User-Agent and may be missing or show unused production buckets. If that part still matters to you, please open a new issue for that part only.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedfeature request acceptedbugSomething is broken or behaving incorrectly.via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions