Skip to content

fix(antigravity): show a usage-limit notice with its reset time when agy's quota runs out - #50190

Merged
AmoabaKelvin merged 1 commit into
mainfrom
fix/antigravity-quota-usage-limit
Nov 27, 2026
Merged

AmoabaKelvin merged 1 commit into
mainfrom
fix/antigravity-quota-usage-limit

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

When Antigravity runs out of quota, agy says so and tells you when it resets. Orca now reads that as a usage limit, so the chat shows the usual "hit its usage limit, resets at …" row and can continue by itself after the reset, like other agents.

Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​60 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​60
Prod 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​111 $\color{#cf222e}{\Huge{\mathbf{−}}}$​8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​103

What Changed

Before: agy's ⚠ Individual quota reached. Please upgrade your subscription to increase your limits. Resets in … line came through as a plain reply or a generic failed turn. No reset time was shown and auto-continue never ran.

After: the chat shows Orca's usage-limit row ("Antigravity hit its usage limit. It resets at 3:45 PM.") with agy's sentence as the detail, plus the row's usual tools (Continue once it resets, Auto-continue on reset, Hand off, copy). The host sweep continues the chat after the reset when that setting is on. If agy gives no reset, the row says to send a message once it resets.

How:

  • antigravity-quota-notice.ts (new, main) recognises a reply chunk that is wholly one of agy's quota notices. It matches only agy's own leads (⚠ Individual quota reached, ⚠ You have exhausted your quota/capacity on this model), on a single line of at most 2,048 characters. It also matches agy's ⚠ agent executor error: … Error 429 … Status: RESOURCE_EXHAUSTED lines and RPC prompt errors (such as Cloud Code Assist API error (429): {… RESOURCE_EXHAUSTED}) whose words name quota.
  • The relative reset (Resets in, reset after, retry in, followed by a Go duration like 2h30m0s or unit words like 4 hours, 5 minutes) is parsed once, when the notice arrives, into an absolute resetsAt. usageLimitResetsAt validates it. History replay never reaches this path.
  • The Antigravity dialect maps these to stopReason: 'rate_limit' with usageLimit, which the existing turn-failure merge already turns into a usageLimitReached row. acpReplyNoticeFailure now lets a dialect's reader supply a stop reason and usage limit.
  • ANTIGRAVITY_QUOTA_WORDS (new, shared) is now the one quota rule. Main uses it to classify agy's failure reports, and the renderer's Antigravity sign-in hint classifier uses it in place of its own regex. A bare "quota exceeded" no longer counts, so disk-quota errors don't read as usage limits.
  • TURN_FAILURE_NOTICE is tested against trimmed text and loses its trailing \s*. That pair backtracked quadratically on long runs of spaces.

Why

Usage-limit rows and auto-continue already key on rate_limit and usageLimitReached. Classifying agy's own failure reports at the dialect lets Antigravity use that plumbing without a parallel path. Ordinary assistant or tool text is never scanned: other ⚠ prose that mentions quota stays a normal reply.

Linked Issue

#50155. This is a partial fix: quota failures now show as usage limits with their reset time. Moving open chats to another account is handled separately.

Visual Proof

N/A. Capturing it needs a real agy quota failure, and we don't run agy or drain a real account. The user now sees the standard usage-limit row (the same component other agents use, on desktop and mobile): "Antigravity hit its usage limit. It resets at ." with agy's sentence as the detail, the Continue/Auto-continue/Hand off tools, and Antigravity's existing offer of another detected sign-in method under it. That offer adds no lead of its own for usage limits.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below
  • Every added test fails without this change and avoids the test anti-patterns

antigravity-quota-notice.test.ts drives the real AcpTimelineTranslator with the Antigravity dialect, using agy's notice text. It checks the reset for a Go duration, unit words, no reset, a Google 429 executor line and an RPC 429 error. It also checks that model prose and disk-quota errors are not usage limits. It fails on the base dialect. pnpm check:changed passes.

Performance

None, because the quota check runs only on reply chunks: a length check and one anchored, prefix-only regex. Reset parsing runs only once a quota notice has matched. The existing failure-notice regex also got cheaper, because it no longer backtracks on long runs of spaces.

Risk

The riskiest part is a false positive: a reply wrongly shown as a usage limit, which could auto-continue. The match needs agy's exact notice leads on a single short line, so normal replies are untouched. Older clients already render usageLimitReached rows, and older hosts are unchanged. Back out with a plain revert.

Level: Low

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

The changes add shared Antigravity quota-word matching and helpers that detect quota notices, parse reset durations, and produce rate-limit failure data. The Antigravity ACP dialect applies quota handling to notifications and prompt failures. Tests cover recognized and unrecognized notices, reset times, and quota data in ACP errors. Renderer-side failure classification uses the shared quota-word expression.

Merge Risk: Low · up to 609f4

Antigravity quota notices are now shown as usage limits with a reset time. A disk-quota error whose text contains "quota exceeded for" can also be shown as a usage limit. The impact is small and the fix is narrow, so the PR is mergeable with this follow-up.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: Antigravity quota failures are shown as a usage-limit notice with the reset time. It matches the raw summary, which adds quota-notice detection and maps matches to a u…
Description check Passed The description follows the template and covers each required section. It includes ELI5, What Changed (before and after), Why, a linked issue (#50155, described as a partial fix), Visual Proof marked …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: Antigravity quota failures are shown as a usage-limit notice with the reset time. It matches the raw summary, which adds quota-notice detection and maps matches to a usage-limit row with reset time. The conventional-commit prefix is acceptable. The title is about 89 characters, slightly long but still readable.

Full details: Description check

Explanation

The description follows the template and covers each required section. It includes ELI5, What Changed (before and after), Why, a linked issue (#50155, described as a partial fix), Visual Proof marked N/A with a reason, Testing with checkboxes and test details, Performance with a concrete reason, Risk with level Low and a back-out plan, and the checklist. The AI Disclosure section is empty, but the template says it applies only to StablyAI team members, and the author may be one. The Review and Notes sections are mostly template text. The Linked Issue section uses 'Linked Issue' with 'Fixes #' replaced by '#50155' in prose rather than the 'Fixes #' line, which is a minor deviation.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ec6b3162-3026-4604-b458-94fb1565d2d3
Commits

Reviewing files that changed from the base of the PR and between 71d14c4 and 609f42f.

Files selected for processing: 6

  • src/main/acp/acp-dialects/acp-reply-notice-failure.ts
  • src/main/acp/acp-dialects/antigravity-dialect.ts
  • src/main/acp/acp-dialects/antigravity-quota-notice.test.ts
  • src/main/acp/acp-dialects/antigravity-quota-notice.ts
  • src/renderer/src/components/native-chat/antigravity-auth/antigravity-chat-auth-choices.ts
  • src/shared/agent-accounts/antigravity/antigravity-quota-words.ts

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

// sentences behind them. The host reads them only in agy's failure reports; a client in a
// failure's text. Disk quotas ("disc quota exceeded") are not usage limits.
export const ANTIGRAVITY_QUOTA_WORDS =
/individual quota reached|exhausted your (?:quota|capacity) on this model|RESOURCE_EXHAUSTED|exceeded your current quota|quota exceeded for|usage limit reached/i

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Exclude disk-quota diagnostics from the generic quota match.

For ⚠ agent executor error: open /tmp/x: disk quota exceeded for user alice, Status: INTERNAL, quota exceeded for matches. The notification path then overrides stopReason: 'error' with rate_limit. Orca shows a usage-limit row for a disk failure.

Exclude disk-quota diagnostics or restrict this alternative to provider quota wording. Keep the Google 429 cases valid. The existing disk test misses this case because its text ends at quota exceeded.

@AmoabaKelvin
AmoabaKelvin merged commit ee8d965 into main Nov 27, 2026
56 checks passed
pythonberg1997 added a commit to pythonberg1997/orca that referenced this pull request Nov 28, 2026
Reconcile the non-linear upstream v1.4.280 release tree directly from v1.4.280 so release-branch-only commits from v1.4.278/v1.4.279 do not carry over.

Resolve conflicts in antigravity-dialect.ts (combine antigravityNotification with stablyai#50190 quota notices), acp-structured-lane.ts (keep AcpLaneTurnWatchers with observer under max-lines), acp-structured-acquire.ts (pass acquire: run to initializeAndObserveAcpSession), antigravity-acp-launch-spec.ts (keep stablyai#50108 fixed clientInfo and stablyai#50262 listsCommandsInChatFolder), and foreign-sqlite-reader-client.ts (keep 30s binder idle teardown alongside antigravitySummaries).

Wrap top-level Zod schemas in antigravity-background-tasks.ts and antigravity-subagents.ts with lazyZodSchema for upstream's new zod-prefer-lazy-ratchet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant