fix(antigravity): rate-limited turns keep their reset time #29594
main fromrefs/pull/29594/head·merged by Yash-Singh1(GitHub profile, opens in a new tab) View on GitHubProblem#
When Antigravity ends a turn on a Google 429 / RESOURCE_EXHAUSTED error that is a plain rate limit (for example reason:RATE_LIMIT_EXCEEDED, not reason:QUOTA_EXHAUSTED), T3 Code correctly marks the failure as usage_limit. But it drops the reset time that the payload carries (quotaResetDelay, or the standard google.rpc.RetryInfo retryDelay).
Without resetAt, the thread shows no reset time. Limit recovery (limitRecoveryCommand requires usageLimitResetAt) also cannot snooze the thread or resume it automatically once the limit clears. The QUOTA_EXHAUSTED path right above already passes resetAt.
Change#
- In the API-error branch of
turnFailure, passresetAt: resetAtFrom(text, now) ?? null, the same as the quota branch.makeProviderFailurekeepsresetAtonly forusage_limit, so other error classes are unchanged. resetAtFromfalls back to RetryInfo'sretryDelaywhen there is noquotaResetTimeStamporquotaResetDelay. It uses a separate regex, so a RetryInfo listed earlier in the details never outranks a quota reset.
Scope and approval#
Very small, focused fix for an obvious bug, so no prior issue: a failure the server already classifies as a usage limit loses the reset time that its sibling branch preserves, and 6 non-test lines restore it.
Overlap search (local PR index plus gh search prs for "antigravity resetAt rate limit" and "AntigravityTurnOutcome"):
- #28629 (merged) introduced this code.
- #28889 (open) restructures
turnFailureto detect lost thinking signatures. It keeps the rate-limited branch withoutresetAt, so it does not fix this, but the two PRs touch the same lines and will need a trivial rebase. - The Antigravity usage-probe PRs (#29565, #21361, #21020) cover quota display, not turn failures.
Verification#
- Red on
main: the new rate-limit assertion inAntigravityTurnOutcome.test.tsfails withAssertionError: expected { class: 'usage_limit', …(3) } to deeply equal { class: 'usage_limit', …(4) }(missingresetAt: "1970-01-01T00:00:42.000Z"). - The existing quota fixture now lists a
RetryInfo retryDelay:42sbefore its ErrorInfo and still expects the 3600s quota reset. That guards the precedence. - Green:
vp test run src/provider/acp/AntigravityTurnOutcome.test.ts, 2/2 passed. vp run check:changed: all pass (format, lint, knip, graphql, typecheck 3 packages, tests).- Not checked: a live rate-limited Antigravity turn. The fixture follows the Go
Error %d, Message: %s, Status: %s, Details: %vrendering that the existing quota fixture uses.
Reviewed with sol-loop: 2 rounds with GPT-6.1 Sol on high. Sol verdict: approved (round 1 found the delay-precedence issue, now fixed and tested).
Created with Claude Opus 5.5 in Claude Code (T3 Code).
🤖 Generated with Claude Code
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
Approvability#
Verdict: Approved at
a748ffbMacroscope's review found this PR approvable — Antigravity rate-limit failures now retain their reported reset time, including RetryInfo delays, for existing displays and recovery scheduling. Quota-reset precedence and recovery defaults remain unchanged, keeping the impact limited.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).No actionable comments were generated in the recent review.
Recent review info-
Run configuration-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: cbd3e14
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
4c12ffa3-e875-4842-babe-768e45792000
Commits-
Reviewing files that changed from the base of the PR and between cbd3e149a130f1d99d2d067c77b9889d64e28755 and a748ffb820fa1690e113ec2e9e7307eb998082a0.
Files selected for processing: 2-
apps/server/src/provider/acp/AntigravityTurnOutcome.test.tsapps/server/src/provider/acp/AntigravityTurnOutcome.ts
Limit details: You’ve used all 10 included reviews currently available.
-
Walkthrough
-
Antigravity failure parsing now uses
retryDelayas a fallback source for reset timestamps. API-error failures include that timestamp, and a test verifies the retryable usage-limit outcome for a rate-limit error.Changes: Antigravity retry-delay handling
Layer / File(s) Summary Parse and report retry delays
apps/server/src/provider/acp/AntigravityTurnOutcome.ts,apps/server/src/provider/acp/AntigravityTurnOutcome.test.tsThe parser recognizes retryDelayand uses it whenRESET_DELAYis absent. API-error failures include the parsed reset timestamp. Tests cover a rate-limit outcome with a 42-second reset time.Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix
Possibly related issues
- pingdotgg/t3code issue 28658: The change covers the reported reset-time behavior by parsing
retryDelay, and the test verifies a rate-limit error produces ausage_limitoutcome.
Suggested reviewers:
t3dotgg - pingdotgg/t3code issue 28658: The change covers the reported reset-time behavior by parsing
Merge Risk:
Minimal · up toa748f-
The reviewed change preserves reset times for rate-limited turns without establishing a merge-blocking regression.
Pre-merge checks:
4-
Check name Status Explanation Title check The title clearly and concisely describes the main change: preserving reset times for rate-limited Antigravity turns. Description check The description covers the problem, implementation, scope rationale, overlap, focused tests, observed results, and an explicit limitation. It matches the repository template and provides sufficient ve… Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request. Full details: Description check
-
Explanation
The description covers the problem, implementation, scope rationale, overlap, focused tests, observed results, and an explicit limitation. It matches the repository template and provides sufficient verification detail.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Usage-based review receipt#
- Mode: Continue automatically
- Reviewed files: 2
- Charged: $0.50
- View usage details
Note
This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.
-
Yash-Singh1(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes