fix(server): Antigravity 1.5 quota errors resume at the reset #39196
main fromrefs/pull/39196/head·opened View on GitHubProblem#
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_DELAYandRETRY_DELAYaccept both the Go map'skey:valueand 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_ERRORpattern reads theSTATUS (code NNN): messageheader. It is a fallback forAPI_ERROR, and its groups keepAPI_ERROR's order, soturnFailurechanges 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 inAntigravityTurnOutcome.test.ts(trimmed from the real step, with the trace ID, headers and session ids removed) fails withclass: "provider_error",message: "Antigravity stopped this turn because of an error.", which is exactly what the thread showed. With the fix it returnsusage_limitwithresetAt: "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.mainreturnsprovider_errorwith noresetAt. This branch returns{ class: "usage_limit", code: "RESOURCE_EXHAUSTED", retryable: true, resetAt: "2026-11-19T18:33:55.000Z" }. -
vp run check:changedpasses (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
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
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 samequotaResetTimeStamp.T3 recorded each as
provider_errorand 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.
This PR conflicts with
main. Rebase it or mergemaininto it. If it still conflicts after 7 days with no activity, it will be closed automatically.See the conflict window.
github-actions[bot](GitHub profile, opens in a new tab) added labelsneeds-rebase
Closing: this PR still conflicts with
mainand 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.
github-actions[bot](GitHub profile, opens in a new tab) removed labelsneeds-rebase
Sign in to join this conversation.
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
apps/server/src/provider/acp/AntigravityTurnOutcome.ts,apps/server/src/provider/acp/AntigravityTurnOutcome.test.tsusage_limitfailure with codeRESOURCE_EXHAUSTEDand a timestamp-derivedresetAt.Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related PRs
turnFailureextractsresetAtforusage_limitresults.Suggested labels:
bugfixSuggested reviewers:
t3dotgg,saphidMerge Risk:
Minimal · up to
fd673Antigravity 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:
4
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)
4d8732d3-647d-4020-beaa-ee827ee0a0f1Reviewing files that changed from the base of the PR and between b5be2ff8da650cc91a0e38850c6bc4afeccab746 and fd673b79bf3e34bccd1bc6a0b7aa80e69d848958.
apps/server/src/provider/acp/AntigravityTurnOutcome.test.tsapps/server/src/provider/acp/AntigravityTurnOutcome.tsIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.