Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): Antigravity 1.5 quota errors resume at the reset #39196

ClosedOmarAlex24(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/39196/headopened View on GitHub

Problem

When an Antigravity 1.5 turn hits its individual quota, the thread shows "Provider error: Antigravity stopped this turn because of an error." instead of "Usage limit reached". Because the failure is not usage_limit and has no resetAt, usage-limit recovery never arms and the thread is not resumed when the quota resets.

#28629 and #29594 handle the 1.4.x error step, which renders Google's error as a Go map (Error 429, Message: …, Status: RESOURCE_EXHAUSTED, Details: [map[… reason:QUOTA_EXHAUSTED]]). Runtime 1.5.12 writes the same error step in a different shape: RESOURCE_EXHAUSTED (code 429): Individual quota reached. … Resets in 2h24m51s., then protobuf bytes, then Google's JSON body ("reason": "QUOTA_EXHAUSTED", "quotaResetTimeStamp": "2026-11-19T18:33:55Z"). None of the AntigravityTurnOutcome patterns match it, so turnFailure falls through to the generic provider error.

Fix

In AntigravityTurnOutcome.ts:

  • QUOTA_EXHAUSTED, RESET_TIMESTAMP, RESET_DELAY and RETRY_DELAY accept both the Go map's key:value and JSON's "key": "value". The timestamp capture stops at " and ,, so the JSON timestamp parses. Without that it would silently fall back to the delay.
  • A new STATUS_ERROR pattern reads the STATUS (code NNN): message header. It is a fallback for API_ERROR, and its groups keep API_ERROR's order, so turnFailure changes by one line. The message capture stops at the first control character, where the protobuf bytes start.

How I found it and checked it

I found it in daily use: an Antigravity thread on gemini-4-neon-xhigh ran out of quota and showed the provider-error card with no option to continue at reset. The session log's last step (type 17) contained the payload described above.

  • Red on main: the new row in AntigravityTurnOutcome.test.ts (trimmed from the real step, with the trace ID, headers and session ids removed) fails with class: "provider_error", message: "Antigravity stopped this turn because of an error.", which is exactly what the thread showed. With the fix it returns usage_limit with resetAt: "2026-11-19T18:33:55.000Z". The test runs on TestClock, so a delay fallback would produce a 1970 timestamp; this result shows the JSON timestamp itself is parsed.
  • The existing 1.4.x Go-map rows (quota, rate limit with retryDelay, invalid argument, thinking signature) still pass unchanged.
  • Replayed the real session log: I copied it to a temp profile and trimmed it to before the error step, started watchAntigravityPromptOutcome, appended the real error step, and ran the check. main returns provider_error with no resetAt. This branch returns { class: "usage_limit", code: "RESOURCE_EXHAUSTED", retryable: true, resetAt: "2026-11-19T18:33:55.000Z" }.
  • vp run check:changed passes (format, lint, knip, typecheck, tests).

I have only observed the QUOTA_EXHAUSTED case in the 1.5 format. A plain 429 rate limit in that format now also takes the existing rate-limit branch through STATUS_ERROR, but I have not seen one live.

Overlap: #33596 (open) rewrites the API_ERROR line for 502s, and #39123 (open) adds an empty-output branch. This PR leaves API_ERROR untouched and only adds a fallback next to it, so either one rebases trivially.

Written with Claude Opus 5.5 in Claude Code, running inside T3 Code.

🤖 Generated with Claude Code

    1. tanstack-source added labelsbug

    2. Explain Change →

      No actionable comments were generated in the recent review.

      Walkthrough

      Antigravity turn failure parsing now recognizes 1.5-style status errors and JSON-formatted quota and retry metadata. A new test checks the parsed usage-limit failure, retryability, error code, and quota reset time.

      Changes: Antigravity quota error handling

      Layer / File(s)Summary
      Parse and verify quota errors
      apps/server/src/provider/acp/AntigravityTurnOutcome.ts, apps/server/src/provider/acp/AntigravityTurnOutcome.test.ts
      The parser recognizes 1.5-style status errors and JSON-formatted quota and retry metadata. The test checks a retryable usage_limit failure with code RESOURCE_EXHAUSTED and a timestamp-derived resetAt.

      Estimated code review effort: 2 (Simple) | ~10 minutes

      Change: Bug fix

      Possibly related PRs

      Suggested labels: bugfix

      Suggested reviewers: t3dotgg, saphid

      Merge Risk: Minimal · up to fd673

      Antigravity 1.5 quota errors are now recognized as usage-limit failures with a reset time. The change is small and tested, and no merge-blocking risk was identified.

      Pre-merge checks: Passed 4

      Check nameStatusExplanation
      Title checkPassedThe title names the primary change: Antigravity 1.5 quota errors are fixed so threads resume at the reset time. It matches the changeset, which adds JSON-format quota/reset parsing and a STATUS_ERROR …
      Description checkPassedThe description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the failing behavior and the cause. The Change section explains the pattern up…
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Full details: Title check

      Explanation

      The title names the primary change: Antigravity 1.5 quota errors are fixed so threads resume at the reset time. It matches the changeset, which adds JSON-format quota/reset parsing and a STATUS_ERROR fallback in AntigravityTurnOutcome.ts. It follows the conventional commit style used in the repository template.

      Full details: Description check

      Explanation

      The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the failing behavior and the cause. The Change section explains the pattern updates and the STATUS_ERROR fallback. The Scope section links related PRs (#28629, #29594, #33596, #39123) but does not link a specific issue that shows the bug. It also states that the bug was found in daily use, and it does not explain why no issue exists. The Verification section gives focused tests, a replay of the real session log, and the observed results, and it states what was not checked (plain 429 in 1.5 format). The template asks for a linked issue or a reason for none, so the Scope section is incomplete, but the rest is thorough. The model and harness are named at the end, as the template requests.

      Finishing Touches

      Generate unit tests (beta)

      • Create a new PR
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
      Recent review info

      Run configuration

      Commits

      Reviewing files that changed from the base of the PR and between b5be2ff8da650cc91a0e38850c6bc4afeccab746 and fd673b79bf3e34bccd1bc6a0b7aa80e69d848958.

      Files selected for processing: 2

      • apps/server/src/provider/acp/AntigravityTurnOutcome.test.ts
      • apps/server/src/provider/acp/AntigravityTurnOutcome.ts

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

    3. I ran into this on macOS in T3 Code Nightly with Gemini 4 Neon through Antigravity. Three existing threads stopped when the individual quota ran out on Nov 21. All three native error records had the RESOURCE_EXHAUSTED (code 429) header and JSON with "reason": "QUOTA_EXHAUSTED" and the same quotaResetTimeStamp.

      T3 recorded each as provider_error and showed “Antigravity stopped this turn because of an error.” The replies contained the quota countdown, but the threads had no automatic recovery at reset. Two needed a separately scheduled retry just after the reset, and the third was still marked failed until I retried it manually later that morning. All three then completed a short prompt on the same model in their existing conversations.

      This is a real interruption for ongoing work. Thanks for addressing the error classification and reset-time parsing.

    4. This PR conflicts with main. Rebase it or merge main into it. If it still conflicts after 7 days with no activity, it will be closed automatically.

      See the conflict window.

    5. Closing: this PR still conflicts with main and has had no activity for 7 days since the rebase request.

      To continue, rebase the branch and open a new PR that links this one. See the conflict window.

    6. github-actions[bot](GitHub profile, opens in a new tab) removed labelsneeds-rebase

Sign in to join this conversation.