← Back to agyr home

How to Fix Quota Exhausted (HTTP 429) Errors in Antigravity CLI

When running autonomous coding workflows with Google Antigravity CLI (agy), hitting an HTTP 429 quota exhausted error is a common disruption. Extended agent tasks, deep repository indexing, and multi-turn refactoring loops consume API limits rapidly. When an account reaches its limit, the CLI halts execution immediately, interrupting unattended development. Understanding how Google measures Antigravity quotas, why manual account switching creates friction, and how agyr automates failover allows developers to maintain continuous agent sessions without losing progress.

What an HTTP 429 Quota Exhausted Error Means in Antigravity CLI

Google applies per-account quota windows, shown by agyr list as GEMINI 5H, GEMINI WEEK and ARGON WEEK (as well as CLAUDE 5H and CLAUDE WEEK when enabled). During active development sessions, repeated prompts and file inspections consume the available allowances for that slot.

When an account runs out, agy stops with a quota error that includes a 'Resets in ...' time (such as 'Resets in 4h13m20s' in the site failover demo). For developers running background jobs or autonomous sub-agents, this stoppage terminates execution midway through a task.

The Manual Workaround and Its Operational Friction

When an account hits a quota wall, developers without automation must rotate accounts manually using sequential CLI commands:

# Safely clear active login state
agyr forget

# Authenticate secondary account in browser
agyr

# Save credentials to a named slot
agyr save acc2

# Switch active account
agyr use acc2

While this procedure changes credentials, performing it manually introduces friction:

How agyr Automates Account Failover and Session Resume

The open-source agyr CLI automates account switching through local credential management. It runs the official agy binary directly on your machine with no proxy in the request path. OAuth tokens remain on your local filesystem under chmod 600 permissions in ~/.gemini/antigravity-cli/accounts/ or inside Windows Credential Manager under gemini:antigravity.

To handle quota walls during execution, agyr provides the agy-run wrapper. When an automated task hits an HTTP 429 error, agy-run executes a five-step failover sequence:

  1. Immediate process termination: Detects 429 quota exhaustion and kills the stalled agy binary immediately to avoid wasted retries.
  2. Dynamic cooldown assignment: Reads the reset header and marks that account slot on cooldown.
  3. Bottleneck-aware account selection: Scans saved accounts and selects the best replacement using bottleneck heuristics (min(Gemini 5h, Week)), prioritizing slots that reset soonest.
  4. Atomic token swap: Updates the active token file atomically on disk with backup safeguards.
  5. Exact session resume: Launches agy --conversation <existing-conversation-id> with the replacement account.

Because Antigravity stores conversation history on disk or server session, the new account picks up the exact same context without wasting tokens re-reading files.

What Happens When Every Account Is on Cooldown

When all configured accounts exhaust their quotas simultaneously, agyr handles full pool exhaustion deterministically.

Rather than looping continuously or spamming Google servers, agyr and agy-run exit cleanly with exit code 5 (or exit code 3 for interactive agyr rotate). The tool outputs the earliest reset time in your local timezone, such as reporting all accounts on cooldown with the earliest reset in 48m at 05:15 PM. This clean exit allows parent scripts to pause gracefully without burning tokens.

Installation and Quick Start Guide

Installing agyr and configuring multiple accounts takes only a few minutes. All credentials remain completely local with no telemetry and no external proxy servers.

Install agyr using the official command:

curl -fsSL https://agyr.luongtrz.id.vn/install.sh | bash

Configure account slots and run automated tasks:

# Step 1: Sign in and save primary account
agyr
agyr save acc1

# Step 2: Clear active session and register second account
agyr forget
agyr
agyr save acc2

# Step 3: Inspect real-time quota status
agyr list

# Step 4: Run automated tasks with 429 auto-failover
agy-run --add-dir . --prompt "Refactor database queries and add indexes"

Run agyr list -c for fast cached quota inspection without calling the agy binary.

Related Guides