Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(antigravity): rate-limited turns keep their reset time #29594

Mergedsaphid(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/29594/headmerged by Yash-Singh1(GitHub profile, opens in a new tab) View on GitHub

Problem

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, pass resetAt: resetAtFrom(text, now) ?? null, the same as the quota branch. makeProviderFailure keeps resetAt only for usage_limit, so other error classes are unchanged.
  • resetAtFrom falls back to RetryInfo's retryDelay when there is no quotaResetTimeStamp or quotaResetDelay. 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 turnFailure to detect lost thinking signatures. It keeps the rate-limited branch without resetAt, 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 in AntigravityTurnOutcome.test.ts fails with AssertionError: expected { class: 'usage_limit', …(3) } to deeply equal { class: 'usage_limit', …(4) } (missing resetAt: "1970-01-01T00:00:42.000Z").
  • The existing quota fixture now lists a RetryInfo retryDelay:42s before 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: %v rendering 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. Approvability

      Verdict: Approved at a748ffb

      Macroscope'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).
    2. Review in Change Stack →

      No actionable comments were generated in the recent review.

      Recent review info
      Run configuration
      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.ts
      • apps/server/src/provider/acp/AntigravityTurnOutcome.ts

      Limit details: You’ve used all 10 included reviews currently available.

      Walkthrough

      Antigravity failure parsing now uses retryDelay as 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.ts
      The parser recognizes retryDelay and uses it when RESET_DELAY is 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 a usage_limit outcome.

      Suggested reviewers: t3dotgg

      Merge Risk: Minimal · up to a748f

      The reviewed change preserves reset times for rate-limited turns without establishing a merge-blocking regression.

      Pre-merge checks: Passed 4
      Check nameStatusExplanation
      Title checkPassedThe title clearly and concisely describes the main change: preserving reset times for rate-limited Antigravity turns.
      Description checkPassedThe 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 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: 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

      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.

Sign in to join this conversation.