Skip to content

fix(server): Antigravity quota failures keep the 'Resets in' reset time - #42339

Merged
juliusmarminge merged 2 commits into
mainfrom
factory/issue-42325
Nov 24, 2026
Merged

juliusmarminge merged 2 commits into
mainfrom
factory/issue-42325

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

When Antigravity stopped a turn with a quota error whose reset time appeared only in the message ('Resets in 4m42s.'), T3 Code saved the usage-limit failure without a reset time. The thread then showed 'Reset time unavailable' and was never resumed or snoozed automatically. The failure now takes its reset time from that duration when the error has no structured reset fields.

Fixes #42325

Reproduction on main

Commit ddaba13 (origin/main). Ran the server from a fresh worktree with T3CODE_DEV_SEED=0, a fresh --base-dir, GOOGLE_GEMINI_BASE_URL pointed at a local fake endpoint, and the Antigravity instance set to the 'Gemini API key' sign-in method with a dummy key. The endpoint answers every streamGenerateContent with HTTP 429 and {error:{code:429,status:RESOURCE_EXHAUSTED,message:'Individual quota reached. Please upgrade your subscription to increase your limits. Resets in 4m42s.',details:[ErrorInfo reason QUOTA_EXHAUSTED]}}, with no quotaResetDelay, quotaResetTimeStamp or RetryInfo. Ran t3 thread start --provider antigravity --model gemini-4-neon --wait --json . 'Say hi'. The real agy 1.5.16 called the fake endpoint and wrote step_type 17 'Error 429, Message: Individual quota reached. ... Resets in 4m42s., Status: RESOURCE_EXHAUSTED, Details: [...]'. The run ended failed and the saved failure was {class:'usage_limit', message:'You have reached your Antigravity quota for this period.', code:'RESOURCE_EXHAUSTED', retryable:true}, with no resetAt, so usage-limit auto-resume and snooze have nothing to schedule. Also added a failing assertion in apps/server/src/provider/acp/AntigravityTurnOutcome.test.ts: a 1.5 'RESOURCE_EXHAUSTED (code 429): ... Resets in 4m42s.' error step should give resetAt 1970-01-01T00:04:42.000Z. vp test run src/provider/acp/AntigravityTurnOutcome.test.ts fails on main with no resetAt property. Not reproduced: the reporter's secondary point about a background_task run masking the failure (see #40229).

Evidence

Run the real server and agy 1.5.16 on Linux with separate fresh databases, Gemini API key mode, and the same synthetic HTTP 429 endpoint returning Resets in 4m42s. without structured reset metadata. Start a Gemini 4 Neon thread with Say hi, then inspect the saved terminal failure.

Before After
ddaba13471 435c7fa15f
Runtime transcript: saved usage-limit failure has no resetAt. Runtime transcript: saved usage-limit failure has resetAt, 281.962 seconds after failure completion.
Captured runtime data Captured runtime data

Reproduction driver — accepts base checkout, head checkout, and output directory as arguments.

Not shown:

  • Web rendering of reset availability and the auto-resume/snooze interactions were not exercised; this proof captures the real provider-to-persisted-failure path.
  • The secondary background_task failure-masking report was not exercised; it is outside this fix's reproduction.

Tests

  • vp test run src/provider/acp/AntigravityTurnOutcome.test.ts (apps/server): 2 passed; the 'Resets in 4m42s.' assertion failed before the fix
  • vp run check:changed: fmt, lint, knip, graphql, typecheck and tests all passed
  • PR CI on 435c7fa: all 8 required checks passed

Not in this change

Who did the work

  • Written by Claude Opus 5.5, in Claude Code
  • Reviewed by GPT-6.1 Sol, in Codex, and by Claude Opus 5.5, each on its own
  • Proof captured by GPT-6.1 Sol and checked by Claude Opus 5.5

Run by the t3code factory in T3 Code.

juliusmarminge and others added 2 commits November 24, 2026 18:34
Repro for #42325: fails on main because resetAtFrom ignores 'Resets in <duration>.'

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Antigravity 1.5 can state a quota reset only as 'Resets in <Go duration>.'
in the error message, which resetAtFrom did not read, so the usage_limit
failure had no resetAt. Fall back to that duration after quotaResetDelay
and retryDelay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 21.5 KiB 21.5 KiB 0 B (0.0%) 24.4 KiB ✅
Codex Live turn messages 1 1 0 (0.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.9 KiB 21.9 KiB 0 B (0.0%) 24.4 KiB ✅
Claude Live turn messages 1 1 0 (0.0%) 8 ✅

Other scenarios

All 64 scenario measurements match main.

All 64 scenario measurements
Provider Scenario Metric Main baseline This PR Impact PR ceiling
Codex short turn resume WebSocket decoded 10.5 KiB 10.5 KiB 0 B (0.0%) 12.7 KiB ✅
Codex short turn resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Codex long turn running, cold open HTTP decoded 281.7 KiB 281.7 KiB 0 B (0.0%) 302.7 KiB ✅
Codex long turn running, cold open rows 75 75 0 (0.0%) 75 ✅
Codex long turn running, history page HTTP decoded 92.4 KiB 92.4 KiB 0 B (0.0%) 107.4 KiB ✅
Codex long turn running, history page rows 75 75 0 (0.0%) 75 ✅
Codex long turn finished, cold open HTTP decoded 381.5 KiB 381.5 KiB 0 B (0.0%) 410.2 KiB ✅
Codex long turn finished, cold open rows 151 151 0 (0.0%) 151 ✅
Codex long turn finished, socket cold open WebSocket decoded 381.6 KiB 381.6 KiB 0 B (0.0%) 410.2 KiB ✅
Codex long turn finished, socket cold open WebSocket messages 2 2 0 (0.0%) 2 ✅
Codex long turn finished, socket cold open rows 151 151 0 (0.0%) 151 ✅
Codex long turn finished, work page HTTP decoded 186.2 KiB 186.2 KiB 0 B (0.0%) 200.2 KiB ✅
Codex long turn finished, work page rows 150 150 0 (0.0%) 150 ✅
Codex idle thread resume WebSocket decoded 65 B 65 B 0 B (0.0%) 200 B ✅
Codex idle thread resume WebSocket messages 1 1 0 (0.0%) 1 ✅
Codex fleet shell snapshot HTTP decoded 42.4 KiB 42.4 KiB 0 B (0.0%) 53.7 KiB ✅
Codex fleet shell snapshot rows 27 27 0 (0.0%) 27 ✅
Codex fleet shell subscribe WebSocket decoded 65 B 65 B 0 B (0.0%) 200 B ✅
Codex fleet shell subscribe WebSocket messages 1 1 0 (0.0%) 1 ✅
Codex fleet shell resume check HTTP decoded 18 B 18 B 0 B (0.0%) 100 B ✅
Codex fleet shell resume check rows 0 0 0 0 ✅
Codex stale shell reload HTTP decoded 42.4 KiB 42.4 KiB 0 B (0.0%) 53.7 KiB ✅
Codex stale shell reload rows 27 27 0 (0.0%) 27 ✅
Codex stale shell resume WebSocket decoded 140 B 140 B 0 B (0.0%) 400 B ✅
Codex stale shell resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Codex stale todo list cold open HTTP decoded 72.4 KiB 72.4 KiB 0 B (0.0%) 83.0 KiB ✅
Codex stale todo list cold open rows 75 75 0 (0.0%) 75 ✅
Codex stale todo list cold open nodes 2 2 0 (0.0%) 4 ✅
Codex stale todo list cold open subagents 2 2 0 (0.0%) 4 ✅
Codex stale todo list cold open plans 1 1 0 (0.0%) 2 ✅
Codex stale todo list cold open providerTurns 1 1 0 (0.0%) 2 ✅
Codex stale todo list cold open checkpoints 1 1 0 (0.0%) 2 ✅
Claude short turn resume WebSocket decoded 10.6 KiB 10.6 KiB 0 B (0.0%) 12.7 KiB ✅
Claude short turn resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Claude long turn running, cold open HTTP decoded 283.3 KiB 283.3 KiB 0 B (0.0%) 302.7 KiB ✅
Claude long turn running, cold open rows 75 75 0 (0.0%) 75 ✅
Claude long turn running, history page HTTP decoded 93.4 KiB 93.4 KiB 0 B (0.0%) 107.4 KiB ✅
Claude long turn running, history page rows 75 75 0 (0.0%) 75 ✅
Claude long turn finished, cold open HTTP decoded 384.2 KiB 384.2 KiB 0 B (0.0%) 410.2 KiB ✅
Claude long turn finished, cold open rows 151 151 0 (0.0%) 151 ✅
Claude long turn finished, socket cold open WebSocket decoded 384.3 KiB 384.3 KiB 0 B (0.0%) 410.2 KiB ✅
Claude long turn finished, socket cold open WebSocket messages 2 2 0 (0.0%) 2 ✅
Claude long turn finished, socket cold open rows 151 151 0 (0.0%) 151 ✅
Claude long turn finished, work page HTTP decoded 188.1 KiB 188.1 KiB 0 B (0.0%) 200.2 KiB ✅
Claude long turn finished, work page rows 150 150 0 (0.0%) 150 ✅
Claude idle thread resume WebSocket decoded 66 B 66 B 0 B (0.0%) 200 B ✅
Claude idle thread resume WebSocket messages 1 1 0 (0.0%) 1 ✅
Claude fleet shell snapshot HTTP decoded 43.0 KiB 43.0 KiB 0 B (0.0%) 53.7 KiB ✅
Claude fleet shell snapshot rows 27 27 0 (0.0%) 27 ✅
Claude fleet shell subscribe WebSocket decoded 66 B 66 B 0 B (0.0%) 200 B ✅
Claude fleet shell subscribe WebSocket messages 1 1 0 (0.0%) 1 ✅
Claude fleet shell resume check HTTP decoded 18 B 18 B 0 B (0.0%) 100 B ✅
Claude fleet shell resume check rows 0 0 0 0 ✅
Claude stale shell reload HTTP decoded 43.0 KiB 43.0 KiB 0 B (0.0%) 53.7 KiB ✅
Claude stale shell reload rows 27 27 0 (0.0%) 27 ✅
Claude stale shell resume WebSocket decoded 140 B 140 B 0 B (0.0%) 400 B ✅
Claude stale shell resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Claude stale todo list cold open HTTP decoded 73.4 KiB 73.4 KiB 0 B (0.0%) 83.0 KiB ✅
Claude stale todo list cold open rows 75 75 0 (0.0%) 75 ✅
Claude stale todo list cold open nodes 2 2 0 (0.0%) 4 ✅
Claude stale todo list cold open subagents 2 2 0 (0.0%) 4 ✅
Claude stale todo list cold open plans 1 1 0 (0.0%) 2 ✅
Claude stale todo list cold open providerTurns 1 1 0 (0.0%) 2 ✅
Claude stale todo list cold open checkpoints 1 1 0 (0.0%) 2 ✅

Baseline: ece5f21 · PR result: 435c7fa · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

resetAtFrom now recognizes Antigravity’s Resets in <duration> message as a fallback after existing reset-delay formats. The change includes a quota-error fixture and an assertion for the resulting reset time.

Changes: Antigravity reset duration

Layer / File(s) Summary
Parse and verify reset durations
apps/server/src/provider/acp/AntigravityTurnOutcome.ts, apps/server/src/provider/acp/AntigravityTurnOutcome.test.ts
resetAtFrom checks Resets in <duration> after RESET_DELAY and RETRY_DELAY; timestamp handling remains unchanged. The test checks that a 4m42s quota error produces a usage_limit failure with reset time 1970-01-01T00:04:42.000Z.

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

Change: Bug fix · Severity of issue fixed: Medium

Possibly related PRs

Suggested reviewers: shivamhwp, macroscopeapp

Merge Risk: Minimal · up to 435c7

This change lets Antigravity quota errors that report a reset duration only in the message produce a reset time, so usage-limit recovery can schedule auto-resume or snoozing. The change is small, and a test covers it. No merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the fix (Antigravity quota failures keep the 'Resets in' reset time), which matches the changeset. It adds a fallback that parses the 'Resets in ' message into resetAt, and t…
Linked Issues check Passed [#42325] Requirement: a quota error whose text contains 'Resets in .' must set failure.resetAt to now plus that duration. The head file apps/server/src/provider/acp/AntigravityTurnOutcome.ts…
Out of Scope Changes check Passed The change set, per the summary and the head source, touches only AntigravityTurnOutcome.ts (+4/-1, adding RESETS_IN, its GO_DURATION helpers, and the fallback in resetAtFrom) and AntigravityTurnOutco…
Description check Passed The description explains the problem (a quota error whose reset time appears only in the message, so the usage-limit failure saves with no reset time and never auto-resumes or snoozes), the change (de…
Full details: Title check

Explanation

The title names the fix (Antigravity quota failures keep the 'Resets in' reset time), which matches the changeset. It adds a fallback that parses the 'Resets in <duration>' message into resetAt, and the title says the same. It uses the conventional commit form and is specific. No fault found.

Full details: Linked Issues check

Explanation

[#42325] Requirement: a quota error whose text contains 'Resets in <duration>.' must set failure.resetAt to now plus that duration. The head file apps/server/src/provider/acp/AntigravityTurnOutcome.ts adds RESETS_IN, matching \bResets in ((?:\d+(?:\.\d+)?(?:ns|us|µs|μs|ms|h|m|s))+)(?!\w|\.\d). resetAtFrom() uses it as a fallback after quotaResetTimeStamp, quotaResetDelay, and retryDelay. It sums Go duration parts and returns now plus the sum when the sum is positive. For '4m42s' the sum is 282000 ms, which gives 1970-01-01T00:04:42.000Z when now is the epoch. The existing timestamp and delay precedence is unchanged. The regex covers the issue's examples ('4m42s', '1h2m', '30s'). The test file adds a fixture and an assertion for the 1.5 'Resets in 4m42s.' case. The author reports that the new test fails on main and passes at head. I could not read the test diff or run the test, so that part rests on the author's report and the raw summary. The reviewed source shows the behavior the issue requests.

Full details: Out of Scope Changes check

Explanation

The change set, per the summary and the head source, touches only AntigravityTurnOutcome.ts (+4/-1, adding RESETS_IN, its GO_DURATION helpers, and the fallback in resetAtFrom) and AntigravityTurnOutcome.test.ts (+14/-0). Each change serves the issue #42325 objective. The PR states that the #40229 background_task masking observation is not reproduced and not changed. The PR also states that open PRs #39196 and #40244 are unchanged. No unrelated file or behavior change appears in the evidence. The diff tool was unavailable, so the file list rests on the supplied summary. The head source shows no other logic change relevant to this scope.

Full details: Description check

Explanation

The description explains the problem (a quota error whose reset time appears only in the message, so the usage-limit failure saves with no reset time and never auto-resumes or snoozes), the change (derive resetAt from the 'Resets in <duration>' text when structured reset fields are absent), and the scope (links the bug issue #42325). The Verification section gives the focused test command, the before/after failure, the commit references, and a runtime reproduction with transcripts. It also states what was not checked: the web rendering and auto-resume/snooze interactions, and the background_task masking report. The template's required sections are all present and substantively filled in. The description has some extra material, such as the authorship attribution and the long reproduction setup, but this does not make it incomplete.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • 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 ece5f21 and 435c7fa.

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; 2 remain after this review.

@juliusmarminge
juliusmarminge merged commit 8261b23 into main Nov 24, 2026
39 checks passed
@juliusmarminge
juliusmarminge deleted the factory/issue-42325 branch November 24, 2026 19:02
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Nov 25, 2026
**v0.1.12-nightly.20261124.5209** · 23 changes from 11 contributors

- **T3 Connect sign-in alerts.** Get notified when a new T3 Connect device signs in.
- **Antigravity quota recovery.** Threads can resume or snooze automatically when Antigravity reports a quota reset time in its error message.
- **Theme editor changes.** Canceling an input method candidate with Escape no longer closes the editor and discards unsaved changes.

### Plus 19 more bug fixes.

<details>
<summary>Full changelog</summary>

## What's Changed
* fix(web): Voice Models language menu resets its search filter on close by @only21mil in pingdotgg/t3code#42321
* feat(connect): tell people when a new T3 Connect device signs in by @juliusmarminge in pingdotgg/t3code#42311
* fix(web): new-commits banner on a PR spans the full header width by @juliusmarminge in pingdotgg/t3code#42342
* fix(web): opening a resolved PR comment keeps its toggle under the cursor by @ipanasenko in pingdotgg/t3code#42312
* fix(web): large SVG project icons come back after their link expires by @smirea in pingdotgg/t3code#42329
* fix(server): Antigravity quota failures keep the 'Resets in' reset time by @juliusmarminge in pingdotgg/t3code#42339
* fix(server): file listing keeps gitignore status when a filename looks like a git pathspec by @only21mil in pingdotgg/t3code#42333
* fix(bitbucket): checkouts cloned from ssh.bitbucket.org match their pull requests by @adrhumphreys-atlas in pingdotgg/t3code#42330
* fix(client): a tab-indented fence line in a PR description code block no longer swaps which video plays by @Marve10s in pingdotgg/t3code#42331
* fix(web): script command field shows both hyphens with ligature fonts by @Mnigos in pingdotgg/t3code#42352
* fix(server): honor sort: "created" when merging IssueService.list entries by @AymanKhan9 in pingdotgg/t3code#42350
* fix(server): a terminal commit refreshes cached Changes totals by @juliusmarminge in pingdotgg/t3code#42365
* fix(web): an IME Escape no longer closes the theme editor or ends inspection by @omaribrahim6 in pingdotgg/t3code#42332
* fix(web): Esc in a font family field closes Settings when no edit is pending by @only21mil in pingdotgg/t3code#42361
* fix(relay): traces no longer record callers' IP addresses or user agents by @juliusmarminge in pingdotgg/t3code#42380
* fix(server): source control discovery no longer runs the auth command of a CLI that is not installed by @juliusmarminge in pingdotgg/t3code#42379
* fix(web): sidebar issue and pull request badges share one component by @Bil0000 in pingdotgg/t3code#42275
* feat(relay): delete a user's relay data when Clerk deletes the user by @juliusmarminge in pingdotgg/t3code#42285
* fix(web): Esc in Theme Editor color filter clears the filter without closing the editor by @juliusmarminge in pingdotgg/t3code#42395
* fix(mobile): analytics uses its own random device id by @juliusmarminge in pingdotgg/t3code#42394
* fix(desktop): Windows desktop applies the saved user telemetry opt-out by @juliusmarminge in pingdotgg/t3code#42376
* fix(web): Enter commits Background Activity interval values by @only21mil in pingdotgg/t3code#42392
* fix(server): analytics no longer reads or sends Codex and Claude account IDs by @gabrielelpidio in pingdotgg/t3code#42299

## New Contributors
* @adrhumphreys-atlas made their first contribution in pingdotgg/t3code#42330

**Full Changelog**: pingdotgg/t3code@v0.1.12-nightly.20261124.5204...v0.1.12-nightly.20261124.5209

</details>


Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.1.12-nightly.20261124.5209
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: AntigravityTurnOutcome.resetAtFrom misses 'Resets in <dur>.' so failure.resetAt is null

1 participant