中文 English

Antigravity Resets Gemini Quotas Again! 6 Refills in 19 Days — Did Google Just Crown Its Own 'Tibo'? Root Causes, Analogies & 3-OS Guard Scripts

Published: 2026-12-01 · Views --
AI Google Gemini Gemini 4 Gemini 4 Neon Gemini 4 Hydrogen Antigravity AI Agent OpenAI Codex LLM LLM Troubleshooting Troubleshooting Pitfall Guide Automation Automation Windows 11 Ubuntu 26.04 macOS 27

Let us open with breaking relief for anyone burning through tokens on Google Antigravity today: at 06:19 UTC on December 1, 2026 (10:19 PM PST on November 30 / 14:19 UTC+8), Google Antigravity lead Varun Mohan (@_mohansolo) dropped yet another line on X that immediately revived developer workspaces worldwide—Resetting Gemini quota on AGY for all users.

If you have been running heavy Gemini 4 Neon or Hydrogen agent workflows over the last three weeks, you have probably felt a strange sense of deja vu: every time your meter approaches empty, another global refill hits. Looking at the public logs on resetgemini.com and antigravityreset.com confirms you are not imagining things. Between November 13 and December 1—just 19 calendar days—Google issued an astonishing 6 full global Gemini quota resets (Nov 13, Nov 17, Nov 21, Nov 23, Nov 26, and Dec 1). What used to be a 12-to-44-day wait earlier in 2026 abruptly compressed into a 2-to-5-day cadence.

Across developer forums, the meme wrote itself: OpenAI Codex’s famous “Quota Reset God” Tibo (@thsottiaux) officially has a successor at Google. Yet behind the celebration lies a much deeper engineering and competitive story—spanning swarm compute amplification, Neon KV cache pool turbulence, the Issue #1890 4x custom-agent drain rollback, and yesterday’s November 30 model sunset. Worse, developers still routinely get locked out right after global resets or accidentally drain paid AI Credits without noticing. Below, backed by 17 real screenshots, custom Huashu-style diagrams, and elementary-level everyday analogies, we unpack the complete story and hand you zero-dependency guard scripts for Windows 11, Ubuntu 26.04, and macOS 27.

Original panoramic graphic: Dec 1, 2026 Antigravity quota reset overview and Varun Mohan vs OpenAI Tibo comparison

Figure 1: Original overview graphic. Today’s December 1 global reset metrics, head-to-head comparison between Varun Mohan and OpenAI’s Tibo, and a roadmap of the five root causes and 3-OS guard scripts covered below.


1. Background: From Tibo’s “Reset Done” Legend to Antigravity’s 19-Day Reset Blitz

To appreciate why developers immediately compare Varun Mohan to Tibo, it helps to revisit the culture that Thibault Sottiaux (@thsottiaux) created over at OpenAI Codex.

For over a year, developers working inside Codex or ChatGPT Work lived under constant anxiety over weekly rate caps. Right when frustration peaked after major launches or hidden billing bugs, Tibo would casually post Reset done or Put the reset in the bag on X, instantly refilling user allowances. That single habit turned rate-limit pain into cult fandom—spawning dedicated community trackers like codex-resets.com (logging 74 resets at a 6.0-day average interval, complete with a “beg” button clicked over 54,399 times) and willcodexquotareset.com, which scores 48-hour reset odds like a token weather station.

Real browser screenshot: codex-resets.com showing @thsottiaux with 74 tracked resets, 6.0d average wait, and 54,399 beg clicks

Figure 2: Live browser capture of codex-resets.com. Tibo’s 74 tracked resets even gave rise to “Tibo time,” Banked Resets, and scheduled reset previews.

Over the past three weeks, Google Antigravity—led by former Windsurf co-founder Varun Mohan (@_mohansolo)—ran the exact same playbook at even higher velocity.

At 06:19 UTC on December 1, 2026, Varun posted today’s global reset announcement: as legacy models like Gemini 3.8 Flash and Gemini 4 Argon exit Antigravity following the November 30 cleanup, Google simplified the model selector, consolidated TPU capacity around flagship models like Gemini 4 Neon, and reset everyone’s Gemini quota to celebrate—closing with his signature sign-off, Keep swarming with Neon.

Real browser screenshot: antigravityreset.com showing Last reset 1 hour ago on Nov 30 10:19 PM PST with a 5.0d last interval

Figure 3: Live browser capture of antigravityreset.com—a community tracker openly modeled after Codex Resets with the headline “We track Varun Mohan so you don’t have to keep checking.”

Zooming out across the full ledger tracked by resetgemini.com (18 confirmed global resets since May 21, 2026) makes the late-2026 acceleration unmistakable:

Real browser screenshot: resetgemini.com showing Yes confirmed Antigravity reset on Dec 1 2026 and 18 resets tracked

Figure 4: Live browser capture of resetgemini.com. It tracks 18 historical Antigravity resets (11.4-day full-year average, 2.8/month overall pace) alongside a playful “Nudge Varun” counter.

Putting both timelines side by side shows why the “Tibo successor” meme caught fire so quickly: Antigravity went from 44-day summer droughts to shipping full resets every 2 to 5 days right alongside OpenAI Codex.

Original timeline and comparison chart: Antigravity's May–Dec 2026 reset acceleration vs OpenAI Codex Tibo mode

Figure 5: Original timeline and head-to-head ledger. Notice how November compressed Antigravity’s reset rhythm into a 2-to-5-day burst while spawning mirror-image tracker culture.


2. Real-World Symptoms: Why Developers Experience Both Euphoria and Whiplash

Scrolling X makes the reset streak look like pure free compute, yet inside GitHub Issues and r/google_antigravity, developer reality over the past fortnight has been sharply split across four symptoms:

  1. Symptom 1: Five-hour buckets vanishing in 10 to 45 minutes
    Right after the November 26 Thanksgiving reset, google-antigravity/antigravity-cli#1890 erupted. Developers running custom agents via agy 1.5.17 reported five-hour limits evaporating in 10 to 45 minutes instead of lasting a full 4–5 hour session—and some watched half-full weekly allowances wipe out alongside them.
  2. Symptom 2: "Global reset announced" — yet your own workflow stays locked
    After every Varun announcement, frustrated comments pop up asking why a reset did not unblock their terminal. Almost always, the user is hitting either a stale local client cache or confusing one of Google's four separate Gemini quota clocks.
  3. Symptom 3: "Reset Roulette" and community prayer counters
    Trackers like antigravityreset.com ("Pray for a reset" / "Wake Varun?") and resetgemini.com ("Nudge Varun") turned quota anxiety into spectator sport—especially with codex-resets.com simultaneously previewing another Codex reset for December 2. Heavy users routinely gamble their final 5% expecting a surprise drop.

Real browser screenshot: antigravityreset.com announcement stream showing consecutive Dec 1, Nov 26, and Nov 24 resets

Figure 6: Live capture of the antigravityreset.com feed showing three consecutive global reset posts stacked tightly across a single week.

Real browser screenshot: willcodexquotareset.com displaying a 48-hour token weather forecast for Tibo

Figure 7: Live capture of willcodexquotareset.com—forecasting reset odds like barometric pressure, a cultural blueprint now mirrored across Antigravity trackers.

  1. Symptom 4: Legacy CI scripts breaking right alongside the Dec 1 reset
    With desktop v2.37.0 shipping November 30 and retiring Gemini 3.8 Flash and Argon, today's Dec 1 model selector cleanup immediately broke scripts that still hardcoded retired model slugs.

Real browser screenshot: antigravity.google/docs/models showing the simplified post-Dec 1 selector focused on Hydrogen, Carbon, and Neon

Figure 8: Live capture of antigravity.google/docs/models on December 1, 2026. The selector has already dropped 3.8 Flash and Argon, leaving Gemini 4 Hydrogen as the universal core and Neon / Carbon on paid plans.


3. Everyday Analogies: How Antigravity Quotas & Resets Actually Work

To make sure anyone—even an elementary student—can grasp 70%+ of what happens behind the scenes without sacrificing technical accuracy, picture these three everyday setups.

Original infographic: three plain-language analogies explaining 5h/7d quotas, frequent resets, and four separate clocks

Figure 9: Original three-analogy visual guide translating dual-window throttling, KV cache compensations, and cross-surface rate clocks into intuitive everyday mechanics.

Analogy 1: The Desk Water Cup (5-Hour Window) vs. the House Water Tank (7-Day Cap)

The #1 question paid Google AI Pro and Ultra users ask is: “Docs say my quota refreshes every five hours, so why am I locked out for days?”

Imagine your account uses two connected water containers:

On normal days, refilling your cup every 5 hours feels effortless. However, if you run massive agent swarms on Monday and drain the basement tank completely dry, the 5-hour desk clock can ring ten times and not a single drop will pour out! You stay locked until your 7-day tank refills—unless Varun drives a city water truck up to everyone’s house and tops up both tanks and cups to 100% simultaneously. (Meanwhile, Free and Google AI Plus users get no desk cup at all—just one weekly bottle.)

Analogy 2: Theme Park Kitchen Upgrades & 4x Turnstile Glitches

Why has the park manager been broadcasting free “all-guest voucher refills” every 2 to 5 days since mid-November? Because two kitchen/turnstile hiccups happened right during peak crowd season:

Analogy 3: Four Doors With Four Separate Clocks

Why can your friend celebrate a Dec 1 Antigravity reset while your Python script still crashes with HTTP 429 RESOURCE_EXHAUSTED?

Because Google runs four separate doors with four separate clocks:


4. Deep Root-Cause Analysis: Why Are Resets Happening Every Few Days?

Cross-referencing official X announcements, GitHub issues, changelogs, and billing docs reveals five intertwined root causes driving this unprecedented late-November sprint.

Original breakdown diagram: 5 verified root causes behind Antigravity's frequent late-2026 quota resets

Figure 10: Five verified drivers behind Antigravity’s 19-day reset burst.

Root Cause 1: Multi-Agent Swarms & xhigh Compute Amplification

Unlike single-turn chatbots, Antigravity 2.0 actively encourages multi-agent swarms (Keep swarming with Neon). Under the hood, Google’s Plans doc states explicitly that quotas correlate with total work done by the agent rather than simple prompt counts. Enabling Extra (xhigh) reasoning globally across parallel file-editing loops multiplies backend token work 5x to 15x overnight.

Root Cause 2: Neon KV Cache Pool Expansion & Harness Tuning (“Burn First, Refund Immediately”)

Across November 20–25, Varun Mohan shared live telemetry of an aggressive backend tuning campaign:

Whenever live cache-routing migrations temporarily degrade hit rates in multi-turn coding loops, uncached prompt re-reads drain user buckets rapidly—making global resets the cleanest engineering make-good.

Root Cause 3: GitHub Issue #1890 — The Silent 4x Custom-Agent Multiplier & Rollback

On November 26–29, user mascarenhas proved in google-antigravity/antigravity-cli#1890 that starting in agy 1.5.17, passing –agent <custom-agent> burned 4.00x more weekly and 5-hour quota per token than the default agent—even for a minimal zero-tool prompt with subagent: false.

Real browser screenshot: GitHub antigravity-cli Issue #1890 showing reproducible 4x quota burn in agy 1.5.17

Figure 11: Live browser capture of google-antigravity/antigravity-cli#1890. Initially defended as an intentional anti-abuse measure, the 4x penalty sparked 30+ furious replies because Antigravity’s own blog had promoted custom agents for saving tokens.

On November 30, 2026 at 06:00 UTC, the team listened and reverted the policy: “Analytics don’t replace user feedback. We have reverted this change, no update required on your end." Today’s December 1 all-user reset cleanly wipes out any lingering weekly exhaustion caused by those 4x burn days.

Root Cause 4: November 30 Legacy Model Sunset & TPU Capacity Consolidation

Desktop v2.37.0 (Nov 30) and today’s Dec 1 reset go hand in hand: retiring Gemini 3.8 Flash, Gemini 4 Argon, and older third-party variants clears out fragmented TPU allocations and channels capacity into Neon, Carbon, and Hydrogen. Resetting all accounts concurrently clears stuck session state left behind by retired model IDs.

Root Cause 5: Competitive “Quota Diplomacy” Against OpenAI Codex

Finally, do not underestimate product psychology. Tibo proved with 74 Codex resets that turning rate-limit friction into sudden celebratory drops builds fierce loyalty. Matching Codex’s Thanksgiving reset within 7 minutes—while rolling out <=20% low-quota highlights in v2.37.0—keeps developers building inside Antigravity instead of defecting mid-sprint.

Real browser screenshot: antigravity.google/docs/plans documenting 5-hour refreshes, weekly caps, and AI Credit Overages

Figure 12: Official documentation (antigravity.google/docs/plans) confirming the exact five-hour/weekly cascade and optional AI Credit Overages billing.

Real browser screenshot: antigravity.google/docs/changelog detailing v2.37.0 November 30 View Usage <=20% alert improvements

Figure 13: Official changelog (antigravity.google/docs/changelog) for v2.37.0 (Nov 30, 2026), introducing yellow/red highlights whenever remaining quota dips to 20% or below.


5. How to Fix Lockouts & Stretch Every Reset 3x Further

Even with six resets in 19 days, tracker sites warn plainly: there is no fixed schedule (gaps have ranged from 0.7 days to 44 days). Follow this four-step triage playbook so you never get blindsided.

Original diagnostic flowchart and Antigravity 2.0 quota-efficiency routing matrix

Figure 14: Four-stage triage decision flow and December 2026 model routing table.

Step 1: Decode the Error Before Waiting on X

Real browser screenshot: resetgemini.com troubleshooting cards comparing 429, 503, and Antigravity subscription limits

Figure 15: Live capture of resetgemini.com error cards separating API midnight-PT timers from 503 capacity congestion and Antigravity subscription locks.

Step 2: Update to agy >= 1.5.20, Clear update.lock, and Run /usage

  1. Verify agy --version reports 1.5.20+ (or v2.37.0 on desktop);
  2. If self-updates stall, delete any leftover crash lock at ~/.gemini/antigravity-cli/updater/update.lock;
  3. Inside the CLI prompt, run /usage (alias /quota). Per official docs, opening this panel immediately fetches live quota and model entitlements from the backend.

Real browser screenshot: Antigravity CLI /usage documentation showing Weekly and Five Hour Limit Remaining TUI bars

Figure 16: Official /usage command guide showing both Weekly Limit Remaining and Five Hour Limit Remaining meters refreshing directly from backend state.

Step 3: Lock “useG1Credits”: false in settings.json

If AI Credit Overages (“useG1Credits”: true in ~/.gemini/antigravity-cli/settings.json) is left on, hitting your 5-hour or weekly cap silently starts burning purchased Google AI Credits instead of pausing cleanly until your next refresh or global reset. Pin it to false unless you explicitly intend to pay overage rates during an emergency.

Step 4: Daily Quota Hygiene (Medium + Orchestrator + Rules)


6. Zero-Dependency Guard Scripts for Windows 11, Ubuntu 26.04 & macOS 27 (Human + Agent Modes)

To automate version verification, stale lock cleanup, useG1Credits wallet protection, workspace trap scanning (–agent, xhigh, retired Nov-30 slugs), and exact local 00:00 PT API countdowns without installing any third-party packages or hitting third-party services, grab the script for your OS below. All scripts strictly sanitize output—never printing full IP addresses, computer hostnames, emails, or tokens—and back up settings.json before touching it.

Original architecture diagram: 3-OS zero-dependency guard scripts supporting human interactive runs and Agent JSON automation

Figure 17: Unified 3-OS automation blueprint tested across sandboxed environments.

Method 1: Human Interactive Execution

1. Windows 11 (PowerShell: agy_quota_guard_windows11.ps1)

<#
.SYNOPSIS
  Antigravity Quota Guard & 4-Clock Triage Toolkit — Windows 11
  Zero third-party dependencies (PowerShell 5.1 / 7+ built-in cmdlets & .NET TimeZoneInfo only).
  Privacy Guard: Never emits full IP addresses, computer hostnames, emails, or OAuth tokens.
.EXAMPLE
  Human Interactive: .\agy_quota_guard_windows11.ps1
  Agent Automated:   .\agy_quota_guard_windows11.ps1 -Auto -Json -Target . -Apply -ClearLock
#>
[CmdletBinding()]
param(
  [string]$Target = ".",
  [string]$HomeDir = $env:USERPROFILE,
  [ValidateSet("hydrogen-medium", "neon-medium")]
  [string]$Profile = "hydrogen-medium",
  [switch]$Auto,
  [switch]$Json,
  [switch]$Apply,
  [switch]$ClearLock,
  [switch]$Help
)

$ErrorActionPreference = "Stop"

if ($Help) {
  Write-Output "Usage: .\agy_quota_guard_windows11.ps1 [-Target <dir>] [-HomeDir <dir>] [-Profile hydrogen-medium|neon-medium] [-Auto] [-Json] [-Apply] [-ClearLock]"
  exit 0
}
if ($Json) { $Auto = $true }

if (-not (Test-Path -Path $Target -PathType Container)) {
  Write-Error "Target directory not found: $Target"
  exit 2
}
$TargetAbs = (Resolve-Path -Path $Target).Path
$TargetModel = if ($Profile -eq "neon-medium") { "Gemini 4 Neon (Medium)" } else { "Gemini 4 Hydrogen (Medium)" }

if (-not $Auto) {
  Write-Host "=====================================================================" -ForegroundColor Cyan
  Write-Host " Antigravity Quota Guard & 4-Clock Triage — Windows 11" -ForegroundColor Blue
  Write-Host "=====================================================================" -ForegroundColor Cyan
  $inDir = Read-Host "Workspace directory to scan [$TargetAbs] (Enter to keep)"
  if ($inDir -and $inDir.Trim() -ne "") {
    if (-not (Test-Path -Path $inDir -PathType Container)) {
      Write-Error "Directory not found: $inDir"
      exit 2
    }
    $TargetAbs = (Resolve-Path -Path $inDir).Path
  }
  $inProf = Read-Host "Safe default model profile [hydrogen-medium / neon-medium] ($Profile)"
  if ($inProf -eq "neon-medium" -or $inProf -eq "hydrogen-medium") {
    $Profile = $inProf
    $TargetModel = if ($Profile -eq "neon-medium") { "Gemini 4 Neon (Medium)" } else { "Gemini 4 Hydrogen (Medium)" }
  }
  $lockAns = Read-Host "Clear stale updater/update.lock if found? [y/N]"
  if ($lockAns -match "^[Yy]") { $ClearLock = $true }
  $applyAns = Read-Host "Backup settings.json, lock useG1Credits=false, and set $TargetModel? [y/N]"
  if ($applyAns -match "^[Yy]") { $Apply = $true }
}

# 1. Detect agy CLI and check >= 1.5.20 (post-#1890 rollback)
$AgyBin = $null
$cmd = Get-Command agy -ErrorAction SilentlyContinue
if ($cmd) {
  $AgyBin = $cmd.Source
} elseif (Test-Path "$env:LOCALAPPDATA\agy\bin\agy.exe") {
  $AgyBin = "$env:LOCALAPPDATA\agy\bin\agy.exe"
}

$AgyVersion = "not-installed"
$AgyPost1890 = $false
if ($AgyBin) {
  try {
    $verRaw = (& $AgyBin --version 2>$null | Select-Object -First 1).ToString().Trim()
    if ($verRaw -match "(\d+\.\d+\.\d+)") {
      $AgyVersion = $Matches[1]
      $parts = $AgyVersion.Split(".") | ForEach-Object { [int]$_ }
      if ($parts[0] -gt 1 -or ($parts[0] -eq 1 -and ($parts[1] -gt 5 -or ($parts[1] -eq 5 -and $parts[2] -ge 20)))) {
        $AgyPost1890 = $true
      }
    } else {
      $AgyVersion = $verRaw
    }
  } catch {
    $AgyVersion = "unknown"
  }
}

# 2. Compute exact local countdown to Google AI Studio 00:00 Pacific Time (zero network/3rd-party dep)
$PtNextResetLocal = "unavailable"
$PtCountdown = "unknown"
try {
  $ptTz = [System.TimeZoneInfo]::FindSystemTimeZoneById("Pacific Standard Time")
  $nowUtc = [DateTime]::UtcNow
  $nowPt = [System.TimeZoneInfo]::ConvertTimeFromUtc($nowUtc, $ptTz)
  $nextPtMidnight = $nowPt.Date.AddDays(1)
  $nextResetUtc = [System.TimeZoneInfo]::ConvertTimeToUtc($nextPtMidnight, $ptTz)
  $nextResetLocal = $nextResetUtc.ToLocalTime()
  $diff = $nextResetUtc - $nowUtc
  $PtNextResetLocal = $nextResetLocal.ToString("yyyy-MM-dd HH:mm")
  $PtCountdown = "{0}h {1:D2}m" -f [int][Math]::Floor($diff.TotalHours), $diff.Minutes
} catch {}

# 3. Inspect ~/.gemini/antigravity-cli/updater/update.lock & settings.json
$CliHome = Join-Path $HomeDir ".gemini\antigravity-cli"
$LockFile = Join-Path $CliHome "updater\update.lock"
$SettingsFile = Join-Path $CliHome "settings.json"
$LockPresent = Test-Path $LockFile
$LockCleared = $false
if ($LockPresent -and $ClearLock) {
  Remove-Item -Path $LockFile -Force -ErrorAction SilentlyContinue
  $LockCleared = -not (Test-Path $LockFile)
}

$CurrentModel = "unset"
$UseG1Credits = "unset"
$SettingsUpdated = $false
$BackupLabel = ""
$SettingsObj = [ordered]@{}

if (Test-Path $SettingsFile) {
  try {
    $parsed = Get-Content -Path $SettingsFile -Raw -Encoding UTF8 | ConvertFrom-Json
    foreach ($prop in $parsed.PSObject.Properties) {
      $SettingsObj[$prop.Name] = $prop.Value
    }
    if ($SettingsObj.Contains("model") -and $SettingsObj["model"]) {
      $CurrentModel = [string]$SettingsObj["model"]
    }
    if ($SettingsObj.Contains("useG1Credits")) {
      $UseG1Credits = ([bool]$SettingsObj["useG1Credits"]).ToString().ToLowerInvariant()
    }
  } catch {
    $CurrentModel = "parse-error"
  }
}

$ModelHighBurnRisk = ($CurrentModel -match "Extra|xhigh|max|3\.8-flash|argon")
$CreditsDrainRisk = ($UseG1Credits -eq "true")

if ($Apply) {
  New-Item -ItemType Directory -Path $CliHome -Force | Out-Null
  if (Test-Path $SettingsFile) {
    $ts = Get-Date -Format "yyyyMMddHHmmss"
    Copy-Item -Path $SettingsFile -Destination "$SettingsFile.bak.$ts" -Force
    $BackupLabel = "~/.gemini/antigravity-cli/settings.json.bak.$ts"
  }
  $SettingsObj["model"] = $TargetModel
  $SettingsObj["useG1Credits"] = $false
  $SettingsObj | ConvertTo-Json -Depth 10 | Set-Content -Path $SettingsFile -Encoding UTF8
  $CurrentModel = $TargetModel
  $UseG1Credits = "false"
  $ModelHighBurnRisk = $false
  $CreditsDrainRisk = $false
  $SettingsUpdated = $true
}

# 4. Scan workspace for high-burn traps (--agent 4x, hardcoded xhigh/max, retired models)
$Extensions = @("*.json","*.yaml","*.yml","*.toml","*.ts","*.py","*.js","*.sh","*.zsh","*.ps1",".env*")
$SkipRegex = '\\(\.git|node_modules|\.venv|dist|build)(\\|$)'
$Files = Get-ChildItem -Path $TargetAbs -Recurse -File -Include $Extensions -ErrorAction SilentlyContinue |
  Where-Object { $_.FullName -notmatch $SkipRegex }

$AgentFlagHits = 0
$XHighHits = 0
$RetiredHits = 0
$SampleFiles = New-Object System.Collections.Generic.List[string]

if ($Files) {
  $h1 = $Files | Select-String -Pattern '--agent\s+[^\s]+|acp\s+--agent' -ErrorAction SilentlyContinue
  $h2 = $Files | Select-String -Pattern '-xhigh|--effort\s+(xhigh|max)' -ErrorAction SilentlyContinue
  $h3 = $Files | Select-String -Pattern 'gemini-3\.8-flash|gemini-4-argon|claude-sonnet-4-6|gpt-oss-120b' -ErrorAction SilentlyContinue
  if ($h1) { $AgentFlagHits = @($h1).Count }
  if ($h2) { $XHighHits = @($h2).Count }
  if ($h3) { $RetiredHits = @($h3).Count }
  foreach ($hit in (@($h1) + @($h2) + @($h3) | Where-Object { $_ } | Select-Object -First 4)) {
    $rel = $hit.Path.Substring($TargetAbs.Length).TrimStart('\', '/') -replace '\\', '/'
    if (-not $SampleFiles.Contains($rel)) { $SampleFiles.Add($rel) }
  }
}

$Result = [ordered]@{
  platform = "Windows 11"
  agy_found = [bool]$AgyBin
  agy_version = $AgyVersion
  agy_post_issue_1890 = $AgyPost1890
  updater_lock_present = $LockPresent
  updater_lock_cleared = $LockCleared
  configured_model = $CurrentModel
  use_g1_credits = $UseG1Credits
  credits_drain_risk = $CreditsDrainRisk
  model_high_burn_risk = $ModelHighBurnRisk
  settings_updated = $SettingsUpdated
  backup_path = $BackupLabel
  ai_studio_next_pt_reset_local = $PtNextResetLocal
  ai_studio_pt_countdown = $PtCountdown
  workspace_custom_agent_hits = $AgentFlagHits
  workspace_xhigh_hits = $XHighHits
  workspace_retired_model_hits = $RetiredHits
  workspace_sample_files = ($SampleFiles -join ",")
}

if ($Json) {
  $Result | ConvertTo-Json -Depth 5
} else {
  Write-Host ""
  Write-Host "=== Antigravity Quota Guard Summary (Windows 11 · Sanitized) ===" -ForegroundColor Cyan
  Write-Host "Antigravity CLI (agy):   $AgyVersion (post-#1890=$AgyPost1890)"
  Write-Host "Updater Lock Present:    $LockPresent (cleared=$LockCleared)"
  Write-Host "Configured Model:        $CurrentModel (high_burn_risk=$ModelHighBurnRisk)"
  Write-Host "AI Credits Overages:     useG1Credits=$UseG1Credits (drain_risk=$CreditsDrainRisk)"
  Write-Host "Settings Updated:        $SettingsUpdated ${BackupLabel}"
  Write-Host "AI Studio 00:00 PT Next: $PtNextResetLocal (in $PtCountdown)"
  Write-Host "Workspace Traps:         --agent=$AgentFlagHits, xhigh/max=$XHighHits, retired=$RetiredHits"
  Write-Host ""
  if (-not $CreditsDrainRisk -and -not $ModelHighBurnRisk -and -not $LockPresent) {
    Write-Host "[OK] Local quota guard looks healthy. Run '/usage' inside agy to sync backend counters." -ForegroundColor Green
  } else {
    Write-Host "[ACTION] Re-run with -Apply -ClearLock or run '/usage' and '/effort medium' inside agy." -ForegroundColor Yellow
  }
}
exit 0

Run command:

powershell -ExecutionPolicy Bypass -File .gy_quota_guard_windows11.ps1

2. Ubuntu 26.04 LTS (Bash: agy_quota_guard_ubuntu2604.sh)

#!/usr/bin/env bash
# ==============================================================================
# Antigravity Quota Guard & 4-Clock Triage Toolkit — Ubuntu 26.04 LTS
# Zero third-party dependencies (GNU bash, grep, awk, sed, date, coreutils)
# Privacy Guard: Never emits full IP addresses, hostnames, emails, or OAuth tokens.
#
# Modes:
#   Human Interactive: bash ./agy_quota_guard_ubuntu2604.sh
#   Agent Automated:   bash ./agy_quota_guard_ubuntu2604.sh --auto --json --apply --clear-lock --target .
# ==============================================================================
set -euo pipefail

TARGET_DIR="."
HOME_OVERRIDE="$HOME"
PROFILE="hydrogen-medium"
AUTO_MODE=0
JSON_MODE=0
APPLY_CONFIG=0
CLEAR_LOCK=0

print_usage() {
  cat <<'USAGE'
Usage: bash agy_quota_guard_ubuntu2604.sh [options]
  --target <dir>     Workspace directory to scan for quota traps (default: .)
  --home <dir>       Override HOME for ~/.gemini/antigravity-cli (sandbox testing)
  --profile <val>    hydrogen-medium (default) or neon-medium
  --apply            Backup settings.json, lock useG1Credits=false, set safe Medium default
  --clear-lock       Remove stale ~/.gemini/antigravity-cli/updater/update.lock
  --auto             Non-interactive mode (ideal for CI / AI Agents)
  --json             Emit sanitized JSON summary to stdout
  -h, --help         Show help
USAGE
}

while (( $# > 0 )); do
  case "$1" in
    --target) shift; [[ $# -gt 0 ]] || { echo "Error: --target requires a dir" >&2; exit 2; }; TARGET_DIR="$1" ;;
    --home) shift; [[ $# -gt 0 ]] || { echo "Error: --home requires a dir" >&2; exit 2; }; HOME_OVERRIDE="$1" ;;
    --profile) shift; [[ $# -gt 0 ]] || { echo "Error: --profile requires a value" >&2; exit 2; }; PROFILE="$1" ;;
    --apply) APPLY_CONFIG=1 ;;
    --clear-lock) CLEAR_LOCK=1 ;;
    --auto) AUTO_MODE=1 ;;
    --json) JSON_MODE=1; AUTO_MODE=1 ;;
    -h|--help) print_usage; exit 0 ;;
    *) echo "Unknown option: $1" >&2; print_usage >&2; exit 2; ;;
  esac
  shift
done

[[ "$PROFILE" == "hydrogen-medium" || "$PROFILE" == "neon-medium" ]] || {
  echo "Error: --profile must be hydrogen-medium or neon-medium" >&2; exit 2;
}
[[ -d "$TARGET_DIR" ]] || { echo "Error: Target directory not found: $TARGET_DIR" >&2; exit 2; }
TARGET_ABS="$(cd "$TARGET_DIR" && pwd)"

TARGET_MODEL="Gemini 4 Hydrogen (Medium)"
[[ "$PROFILE" == "neon-medium" ]] && TARGET_MODEL="Gemini 4 Neon (Medium)"

if (( AUTO_MODE == 0 )); then
  echo "====================================================================="
  echo " Antigravity Quota Guard & 4-Clock Triage — Ubuntu 26.04 (Bash)"
  echo "====================================================================="
  printf "Workspace directory to scan [%s] (Enter to keep): " "$TARGET_ABS"
  read -r in_dir || true
  if [[ -n "${in_dir:-}" ]]; then
    [[ -d "$in_dir" ]] || { echo "Directory not found: $in_dir" >&2; exit 2; }
    TARGET_ABS="$(cd "$in_dir" && pwd)"
  fi
  printf "Safe default profile [hydrogen-medium / neon-medium] (%s): " "$PROFILE"
  read -r in_prof || true
  if [[ "${in_prof:-}" == "neon-medium" || "${in_prof:-}" == "hydrogen-medium" ]]; then
    PROFILE="$in_prof"
    TARGET_MODEL="Gemini 4 Hydrogen (Medium)"
    [[ "$PROFILE" == "neon-medium" ]] && TARGET_MODEL="Gemini 4 Neon (Medium)"
  fi
  printf "Clear stale updater/update.lock if present? [y/N]: "
  read -r in_lock || true
  [[ "${in_lock:-n}" == [Yy]* ]] && CLEAR_LOCK=1
  printf "Backup settings.json, set useG1Credits=false, pin %s? [y/N]: " "$TARGET_MODEL"
  read -r in_apply || true
  [[ "${in_apply:-n}" == [Yy]* ]] && APPLY_CONFIG=1
fi

# 1. Detect agy CLI & check >= 1.5.20 (post-#1890 4x rollback)
AGY_BIN=""
if command -v agy >/dev/null 2>&1; then
  AGY_BIN="$(command -v agy)"
elif [[ -x "${HOME}/.local/bin/agy" ]]; then
  AGY_BIN="${HOME}/.local/bin/agy"
fi

AGY_FOUND=false
AGY_VERSION="not-installed"
AGY_POST_1890=false
if [[ -n "$AGY_BIN" ]]; then
  AGY_FOUND=true
  VER_RAW="$("$AGY_BIN" --version 2>/dev/null | head -n 1 | tr -d '\r' || true)"
  if [[ "$VER_RAW" =~ ([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then
    AGY_VERSION="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.${BASH_REMATCH[3]}"
    v_maj="${BASH_REMATCH[1]}"; v_min="${BASH_REMATCH[2]}"; v_pat="${BASH_REMATCH[3]}"
    if (( v_maj > 1 || (v_maj == 1 && (v_min > 5 || (v_min == 5 && v_pat >= 20))) )); then
      AGY_POST_1890=true
    fi
  elif [[ -n "$VER_RAW" ]]; then
    AGY_VERSION="$VER_RAW"
  fi
fi

# 2. Pure local computation of Google AI Studio 00:00 Pacific Time reset (GNU date)
PT_NEXT_LOCAL="unavailable"
PT_COUNTDOWN="unknown"
if PT_TODAY="$(TZ=America/Los_Angeles date +%Y-%m-%d 2>/dev/null)"; then
  NEXT_PT_EPOCH="$(TZ=America/Los_Angeles date -d "${PT_TODAY} +1 day 00:00:00" +%s 2>/dev/null || echo "")"
  NOW_EPOCH="$(date +%s)"
  if [[ -n "$NEXT_PT_EPOCH" ]]; then
    PT_NEXT_LOCAL="$(date -d "@${NEXT_PT_EPOCH}" '+%Y-%m-%d %H:%M' 2>/dev/null || echo "unavailable")"
    DIFF_SEC=$(( NEXT_PT_EPOCH - NOW_EPOCH ))
    (( DIFF_SEC < 0 )) && DIFF_SEC=0
    PT_COUNTDOWN="$(( DIFF_SEC / 3600 ))h $(printf '%02d' $(( (DIFF_SEC % 3600) / 60 )))m"
  fi
fi

# 3. Inspect ~/.gemini/antigravity-cli/updater/update.lock & settings.json
CLI_HOME="${HOME_OVERRIDE}/.gemini/antigravity-cli"
LOCK_FILE="${CLI_HOME}/updater/update.lock"
SETTINGS_FILE="${CLI_HOME}/settings.json"

LOCK_PRESENT=false
LOCK_CLEARED=false
if [[ -e "$LOCK_FILE" ]]; then
  LOCK_PRESENT=true
  if (( CLEAR_LOCK == 1 )); then
    rm -f "$LOCK_FILE"
    [[ ! -e "$LOCK_FILE" ]] && LOCK_CLEARED=true
  fi
fi

CURRENT_MODEL="unset"
USE_G1_CREDITS="unset"
if [[ -f "$SETTINGS_FILE" ]]; then
  m_val="$(sed -En 's/.*"model"[[:space:]]*:[[:space:]]*"([^"]*)".*/\1/p' "$SETTINGS_FILE" | head -n 1 || true)"
  [[ -n "$m_val" ]] && CURRENT_MODEL="$m_val"
  c_val="$(sed -En 's/.*"useG1Credits"[[:space:]]*:[[:space:]]*(true|false).*/\1/p' "$SETTINGS_FILE" | head -n 1 || true)"
  [[ -n "$c_val" ]] && USE_G1_CREDITS="$c_val"
fi

CREDITS_DRAIN_RISK=false
[[ "$USE_G1_CREDITS" == "true" ]] && CREDITS_DRAIN_RISK=true
MODEL_HIGH_BURN_RISK=false
if [[ "$CURRENT_MODEL" =~ (Extra|xhigh|max|3\.8-flash|argon) ]]; then
  MODEL_HIGH_BURN_RISK=true
fi

SETTINGS_UPDATED=false
BACKUP_LABEL=""
if (( APPLY_CONFIG == 1 )); then
  mkdir -p "$CLI_HOME"
  if [[ -f "$SETTINGS_FILE" ]]; then
    TS="$(date +%Y%m%d%H%M%S)"
    cp "$SETTINGS_FILE" "${SETTINGS_FILE}.bak.${TS}"
    BACKUP_LABEL="~/.gemini/antigravity-cli/settings.json.bak.${TS}"
    awk -v tgt="$TARGET_MODEL" '
      BEGIN { has_m=0; has_c=0; buf="" }
      {
        if ($0 ~ /"model"[[:space:]]*:/) {
          sub(/"model"[[:space:]]*:[[:space:]]*"[^"]*"/, "\"model\": \"" tgt "\"")
          has_m=1
        }
        if ($0 ~ /"useG1Credits"[[:space:]]*:/) {
          sub(/"useG1Credits"[[:space:]]*:[[:space:]]*(true|false)/, "\"useG1Credits\": false")
          has_c=1
        }
        lines[NR]=$0
      }
      END {
        if (NR == 0) {
          printf "{\n  \"model\": \"%s\",\n  \"useG1Credits\": false\n}\n", tgt
          exit
        }
        last_brace=0
        for (i=1; i<=NR; i++) if (lines[i] ~ /\}/) last_brace=i
        for (i=1; i<=NR; i++) {
          if (i == last_brace && (!has_m || !has_c)) {
            if (i > 1 && lines[i-1] !~ /,[[:space:]]*$/ && lines[i-1] !~ /\{[[:space:]]*$/) {
              sub(/[[:space:]]*$/, ",", lines[i-1])
            }
          }
          print lines[i]
        }
      }
    ' "$SETTINGS_FILE" > "${SETTINGS_FILE}.tmp"
    # Clean reliable rewrite if either key was missing via lightweight awk inject
    if ! grep -q '"useG1Credits"' "${SETTINGS_FILE}.tmp" || ! grep -q '"model"' "${SETTINGS_FILE}.tmp"; then
      awk -v tgt="$TARGET_MODEL" -v hm="$(grep -c '"model"' "${SETTINGS_FILE}.tmp" || true)" -v hc="$(grep -c '"useG1Credits"' "${SETTINGS_FILE}.tmp" || true)" '
        { lines[NR]=$0; if ($0 ~ /\}/) lb=NR }
        END {
          for (i=1; i<=NR; i++) {
            if (i == lb) {
              if (i > 1 && lines[i-1] !~ /,[[:space:]]*$/ && lines[i-1] !~ /\{[[:space:]]*$/) lines[i-1]=lines[i-1] ","
            }
          }
          for (i=1; i<=NR; i++) {
            if (i == lb) {
              if (hm == 0) printf "  \"model\": \"%s\"%s\n", tgt, (hc == 0 ? "," : "")
              if (hc == 0) print "  \"useG1Credits\": false"
            }
            print lines[i]
          }
        }
      ' "${SETTINGS_FILE}.tmp" > "${SETTINGS_FILE}.tmp2" && mv "${SETTINGS_FILE}.tmp2" "${SETTINGS_FILE}.tmp"
    fi
    mv "${SETTINGS_FILE}.tmp" "$SETTINGS_FILE"
  else
    printf '{\n  "model": "%s",\n  "useG1Credits": false\n}\n' "$TARGET_MODEL" > "$SETTINGS_FILE"
  fi
  CURRENT_MODEL="$TARGET_MODEL"
  USE_G1_CREDITS="false"
  CREDITS_DRAIN_RISK=false
  MODEL_HIGH_BURN_RISK=false
  SETTINGS_UPDATED=true
fi

# 4. Scan workspace for high-burn traps
scan_count() {
  local pat="$1"
  (grep -rnE --exclude-dir=.git --exclude-dir=node_modules --exclude-dir=.venv --exclude-dir=dist --exclude-dir=build \
    --include='*.json' --include='*.yaml' --include='*.yml' --include='*.toml' --include='*.ts' \
    --include='*.py' --include='*.js' --include='*.sh' --include='*.zsh' --include='*.ps1' --include='.env*' \
    "$pat" "$TARGET_ABS" 2>/dev/null || true) | wc -l | awk '{print $1}'
}

AGENT_HITS="$(scan_count '(--agent[[:space:]]+[^[:space:]]+|acp[[:space:]]+--agent)')"
XHIGH_HITS="$(scan_count '(-xhigh|--effort[[:space:]]+(xhigh|max))')"
RETIRED_HITS="$(scan_count '(gemini-3\.8-flash|gemini-4-argon|claude-sonnet-4-6|gpt-oss-120b)')"

SAMPLE_FILES="$(grep -rlE --exclude-dir=.git --exclude-dir=node_modules --exclude-dir=.venv --exclude-dir=dist --exclude-dir=build \
  --include='*.json' --include='*.yaml' --include='*.yml' --include='*.toml' --include='*.ts' \
  --include='*.py' --include='*.js' --include='*.sh' --include='*.zsh' --include='*.ps1' --include='.env*' \
  '(--agent[[:space:]]+[^[:space:]]+|-xhigh|--effort[[:space:]]+(xhigh|max)|gemini-3\.8-flash|gemini-4-argon)' \
  "$TARGET_ABS" 2>/dev/null | head -n 4 | sed "s|^${TARGET_ABS}/||" | paste -sd ',' - || true)"

if (( JSON_MODE == 1 )); then
  cat <<EOF
{
  "platform": "Ubuntu 26.04",
  "agy_found": ${AGY_FOUND},
  "agy_version": "${AGY_VERSION}",
  "agy_post_issue_1890": ${AGY_POST_1890},
  "updater_lock_present": ${LOCK_PRESENT},
  "updater_lock_cleared": ${LOCK_CLEARED},
  "configured_model": "${CURRENT_MODEL}",
  "use_g1_credits": "${USE_G1_CREDITS}",
  "credits_drain_risk": ${CREDITS_DRAIN_RISK},
  "model_high_burn_risk": ${MODEL_HIGH_BURN_RISK},
  "settings_updated": ${SETTINGS_UPDATED},
  "backup_path": "${BACKUP_LABEL}",
  "ai_studio_next_pt_reset_local": "${PT_NEXT_LOCAL}",
  "ai_studio_pt_countdown": "${PT_COUNTDOWN}",
  "workspace_custom_agent_hits": ${AGENT_HITS},
  "workspace_xhigh_hits": ${XHIGH_HITS},
  "workspace_retired_model_hits": ${RETIRED_HITS},
  "workspace_sample_files": "${SAMPLE_FILES}"
}
EOF
else
  echo ""
  echo "=== Antigravity Quota Guard Summary (Ubuntu 26.04 · Sanitized) ==="
  echo "Antigravity CLI (agy):   ${AGY_VERSION} (post-#1890=${AGY_POST_1890})"
  echo "Updater Lock Present:    ${LOCK_PRESENT} (cleared=${LOCK_CLEARED})"
  echo "Configured Model:        ${CURRENT_MODEL} (high_burn_risk=${MODEL_HIGH_BURN_RISK})"
  echo "AI Credits Overages:     useG1Credits=${USE_G1_CREDITS} (drain_risk=${CREDITS_DRAIN_RISK})"
  echo "Settings Updated:        ${SETTINGS_UPDATED} ${BACKUP_LABEL}"
  echo "AI Studio 00:00 PT Next: ${PT_NEXT_LOCAL} (in ${PT_COUNTDOWN})"
  echo "Workspace Traps:         --agent=${AGENT_HITS}, xhigh/max=${XHIGH_HITS}, retired=${RETIRED_HITS}"
  echo ""
  if [[ "$CREDITS_DRAIN_RISK" == "false" && "$MODEL_HIGH_BURN_RISK" == "false" && "$LOCK_PRESENT" == "false" ]]; then
    echo "[OK] Local quota guard looks healthy. Run '/usage' inside agy to sync backend counters."
  else
    echo "[ACTION] Re-run with --apply --clear-lock or run '/usage' and '/effort medium' inside agy."
  fi
fi
exit 0

Run command:

chmod +x ./agy_quota_guard_ubuntu2604.sh && bash ./agy_quota_guard_ubuntu2604.sh

3. macOS 27 (Zsh: agy_quota_guard_macos27.zsh)

#!/usr/bin/env zsh
# ==============================================================================
# Antigravity Quota Guard & 4-Clock Triage Toolkit — macOS 27
# Zero third-party dependencies (macOS built-in zsh, grep, awk, sed, BSD date)
# Privacy Guard: Never emits full IP addresses, hostnames, emails, or OAuth tokens.
#
# Modes:
#   Human Interactive: zsh ./agy_quota_guard_macos27.zsh
#   Agent Automated:   zsh ./agy_quota_guard_macos27.zsh --auto --json --apply --clear-lock --target .
# ==============================================================================
emulate -L zsh
setopt PIPE_FAIL NO_UNSET

TARGET_DIR="."
HOME_OVERRIDE="$HOME"
PROFILE="hydrogen-medium"
AUTO_MODE=0
JSON_MODE=0
APPLY_CONFIG=0
CLEAR_LOCK=0

print_usage() {
  cat <<'USAGE'
Usage: zsh agy_quota_guard_macos27.zsh [options]
  --target <dir>     Workspace directory to scan for quota traps (default: .)
  --home <dir>       Override HOME for ~/.gemini/antigravity-cli (sandbox testing)
  --profile <val>    hydrogen-medium (default) or neon-medium
  --apply            Backup settings.json, lock useG1Credits=false, set safe Medium default
  --clear-lock       Remove stale ~/.gemini/antigravity-cli/updater/update.lock
  --auto             Non-interactive mode (ideal for CI / AI Agents)
  --json             Emit sanitized JSON summary to stdout
  -h, --help         Show help
USAGE
}

while (( $# > 0 )); do
  case "$1" in
    --target) shift; [[ $# -gt 0 ]] || { echo "Error: --target requires a dir" >&2; exit 2; }; TARGET_DIR="$1" ;;
    --home) shift; [[ $# -gt 0 ]] || { echo "Error: --home requires a dir" >&2; exit 2; }; HOME_OVERRIDE="$1" ;;
    --profile) shift; [[ $# -gt 0 ]] || { echo "Error: --profile requires a value" >&2; exit 2; }; PROFILE="$1" ;;
    --apply) APPLY_CONFIG=1 ;;
    --clear-lock) CLEAR_LOCK=1 ;;
    --auto) AUTO_MODE=1 ;;
    --json) JSON_MODE=1; AUTO_MODE=1 ;;
    -h|--help) print_usage; exit 0 ;;
    *) echo "Unknown option: $1" >&2; print_usage >&2; exit 2 ;;
  esac
  shift
done

[[ "$PROFILE" == "hydrogen-medium" || "$PROFILE" == "neon-medium" ]] || {
  echo "Error: --profile must be hydrogen-medium or neon-medium" >&2; exit 2;
}
[[ -d "$TARGET_DIR" ]] || { echo "Error: Target directory not found: $TARGET_DIR" >&2; exit 2; }
TARGET_ABS="$(cd "$TARGET_DIR" && pwd)"

TARGET_MODEL="Gemini 4 Hydrogen (Medium)"
[[ "$PROFILE" == "neon-medium" ]] && TARGET_MODEL="Gemini 4 Neon (Medium)"

if (( AUTO_MODE == 0 )); then
  print -P "%F{cyan}=====================================================================%f"
  print -P "%B%F{blue} Antigravity Quota Guard & 4-Clock Triage — macOS 27 (Zsh)%f%b"
  print -P "%F{cyan}=====================================================================%f"
  printf "Workspace directory to scan [%s] (Enter to keep): " "$TARGET_ABS"
  read -r in_dir || true
  if [[ -n "${in_dir:-}" ]]; then
    [[ -d "$in_dir" ]] || { echo "Directory not found: $in_dir" >&2; exit 2; }
    TARGET_ABS="$(cd "$in_dir" && pwd)"
  fi
  printf "Safe default profile [hydrogen-medium / neon-medium] (%s): " "$PROFILE"
  read -r in_prof || true
  if [[ "${in_prof:-}" == "neon-medium" || "${in_prof:-}" == "hydrogen-medium" ]]; then
    PROFILE="$in_prof"
    TARGET_MODEL="Gemini 4 Hydrogen (Medium)"
    [[ "$PROFILE" == "neon-medium" ]] && TARGET_MODEL="Gemini 4 Neon (Medium)"
  fi
  printf "Clear stale updater/update.lock if present? [y/N]: "
  read -r in_lock || true
  [[ "${in_lock:-n}" == [Yy]* ]] && CLEAR_LOCK=1
  printf "Backup settings.json, set useG1Credits=false, pin %s? [y/N]: " "$TARGET_MODEL"
  read -r in_apply || true
  [[ "${in_apply:-n}" == [Yy]* ]] && APPLY_CONFIG=1
fi

# 1. Detect agy CLI & check >= 1.5.20 (post-#1890 rollback)
AGY_BIN=""
if command -v agy >/dev/null 2>&1; then
  AGY_BIN="$(command -v agy)"
elif [[ -x "${HOME}/.local/bin/agy" ]]; then
  AGY_BIN="${HOME}/.local/bin/agy"
fi

AGY_FOUND=false
AGY_VERSION="not-installed"
AGY_POST_1890=false
if [[ -n "$AGY_BIN" ]]; then
  AGY_FOUND=true
  VER_RAW="$("$AGY_BIN" --version 2>/dev/null | head -n 1 | tr -d '\r' || true)"
  if [[ "$VER_RAW" =~ ([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then
    AGY_VERSION="${match[1]}.${match[2]}.${match[3]}"
    integer v_maj=${match[1]} v_min=${match[2]} v_pat=${match[3]}
    if (( v_maj > 1 || (v_maj == 1 && (v_min > 5 || (v_min == 5 && v_pat >= 20))) )); then
      AGY_POST_1890=true
    fi
  elif [[ -n "$VER_RAW" ]]; then
    AGY_VERSION="$VER_RAW"
  fi
fi

# 2. Pure local computation of Google AI Studio 00:00 Pacific Time reset (macOS /bin/date)
PT_NEXT_LOCAL="unavailable"
PT_COUNTDOWN="unknown"
if PT_TODAY="$(TZ=America/Los_Angeles /bin/date +%Y-%m-%d 2>/dev/null)"; then
  NEXT_PT_EPOCH="$(TZ=America/Los_Angeles /bin/date -j -v+1d -f "%Y-%m-%d %H:%M:%S" "${PT_TODAY} 00:00:00" +%s 2>/dev/null || echo "")"
  NOW_EPOCH="$(/bin/date +%s)"
  if [[ -n "$NEXT_PT_EPOCH" ]]; then
    PT_NEXT_LOCAL="$(/bin/date -r "$NEXT_PT_EPOCH" '+%Y-%m-%d %H:%M' 2>/dev/null || echo "unavailable")"
    integer diff_sec=$(( NEXT_PT_EPOCH - NOW_EPOCH ))
    (( diff_sec < 0 )) && diff_sec=0
    PT_COUNTDOWN="$(( diff_sec / 3600 ))h $(printf '%02d' $(( (diff_sec % 3600) / 60 )))m"
  fi
fi

# 3. Inspect ~/.gemini/antigravity-cli/updater/update.lock & settings.json
CLI_HOME="${HOME_OVERRIDE}/.gemini/antigravity-cli"
LOCK_FILE="${CLI_HOME}/updater/update.lock"
SETTINGS_FILE="${CLI_HOME}/settings.json"

LOCK_PRESENT=false
LOCK_CLEARED=false
if [[ -e "$LOCK_FILE" ]]; then
  LOCK_PRESENT=true
  if (( CLEAR_LOCK == 1 )); then
    rm -f "$LOCK_FILE"
    [[ ! -e "$LOCK_FILE" ]] && LOCK_CLEARED=true
  fi
fi

CURRENT_MODEL="unset"
USE_G1_CREDITS="unset"
if [[ -f "$SETTINGS_FILE" ]]; then
  m_val="$(sed -En 's/.*"model"[[:space:]]*:[[:space:]]*"([^"]*)".*/\1/p' "$SETTINGS_FILE" | head -n 1 || true)"
  [[ -n "$m_val" ]] && CURRENT_MODEL="$m_val"
  c_val="$(sed -En 's/.*"useG1Credits"[[:space:]]*:[[:space:]]*(true|false).*/\1/p' "$SETTINGS_FILE" | head -n 1 || true)"
  [[ -n "$c_val" ]] && USE_G1_CREDITS="$c_val"
fi

CREDITS_DRAIN_RISK=false
[[ "$USE_G1_CREDITS" == "true" ]] && CREDITS_DRAIN_RISK=true
MODEL_HIGH_BURN_RISK=false
if [[ "$CURRENT_MODEL" =~ (Extra|xhigh|max|3\.8-flash|argon) ]]; then
  MODEL_HIGH_BURN_RISK=true
fi

SETTINGS_UPDATED=false
BACKUP_LABEL=""
if (( APPLY_CONFIG == 1 )); then
  mkdir -p "$CLI_HOME"
  if [[ -f "$SETTINGS_FILE" ]]; then
    TS="$(date +%Y%m%d%H%M%S)"
    cp "$SETTINGS_FILE" "${SETTINGS_FILE}.bak.${TS}"
    BACKUP_LABEL="~/.gemini/antigravity-cli/settings.json.bak.${TS}"
    awk -v tgt="$TARGET_MODEL" '
      {
        if ($0 ~ /"model"[[:space:]]*:/) {
          sub(/"model"[[:space:]]*:[[:space:]]*"[^"]*"/, "\"model\": \"" tgt "\"")
        }
        if ($0 ~ /"useG1Credits"[[:space:]]*:/) {
          sub(/"useG1Credits"[[:space:]]*:[[:space:]]*(true|false)/, "\"useG1Credits\": false")
        }
        print
      }
    ' "$SETTINGS_FILE" > "${SETTINGS_FILE}.tmp"
    integer hm=0 hc=0
    grep -q '"model"' "${SETTINGS_FILE}.tmp" && hm=1 || true
    grep -q '"useG1Credits"' "${SETTINGS_FILE}.tmp" && hc=1 || true
    if (( hm == 0 || hc == 0 )); then
      awk -v tgt="$TARGET_MODEL" -v hm="$hm" -v hc="$hc" '
        { lines[NR]=$0; if ($0 ~ /\}/) lb=NR }
        END {
          if (NR == 0) {
            printf "{\n  \"model\": \"%s\",\n  \"useG1Credits\": false\n}\n", tgt
            exit
          }
          for (i=1; i<=NR; i++) {
            if (i == lb && i > 1 && lines[i-1] !~ /,[[:space:]]*$/ && lines[i-1] !~ /\{[[:space:]]*$/) {
              lines[i-1] = lines[i-1] ","
            }
          }
          for (i=1; i<=NR; i++) {
            if (i == lb) {
              if (hm == 0) printf "  \"model\": \"%s\"%s\n", tgt, (hc == 0 ? "," : "")
              if (hc == 0) print "  \"useG1Credits\": false"
            }
            print lines[i]
          }
        }
      ' "${SETTINGS_FILE}.tmp" > "${SETTINGS_FILE}.tmp2" && mv "${SETTINGS_FILE}.tmp2" "${SETTINGS_FILE}.tmp"
    fi
    mv "${SETTINGS_FILE}.tmp" "$SETTINGS_FILE"
  else
    printf '{\n  "model": "%s",\n  "useG1Credits": false\n}\n' "$TARGET_MODEL" > "$SETTINGS_FILE"
  fi
  CURRENT_MODEL="$TARGET_MODEL"
  USE_G1_CREDITS="false"
  CREDITS_DRAIN_RISK=false
  MODEL_HIGH_BURN_RISK=false
  SETTINGS_UPDATED=true
fi

# 4. Scan workspace for high-burn traps
scan_count() {
  local pat="$1"
  (grep -rnE --exclude-dir=.git --exclude-dir=node_modules --exclude-dir=.venv --exclude-dir=dist --exclude-dir=build \
    --include='*.json' --include='*.yaml' --include='*.yml' --include='*.toml' --include='*.ts' \
    --include='*.py' --include='*.js' --include='*.sh' --include='*.zsh' --include='*.ps1' --include='.env*' \
    "$pat" "$TARGET_ABS" 2>/dev/null || true) | wc -l | tr -d ' '
}

AGENT_HITS="$(scan_count '(--agent[[:space:]]+[^[:space:]]+|acp[[:space:]]+--agent)')"
XHIGH_HITS="$(scan_count '(-xhigh|--effort[[:space:]]+(xhigh|max))')"
RETIRED_HITS="$(scan_count '(gemini-3\.8-flash|gemini-4-argon|claude-sonnet-4-6|gpt-oss-120b)')"

SAMPLE_FILES="$(grep -rlE --exclude-dir=.git --exclude-dir=node_modules --exclude-dir=.venv --exclude-dir=dist --exclude-dir=build \
  --include='*.json' --include='*.yaml' --include='*.yml' --include='*.toml' --include='*.ts' \
  --include='*.py' --include='*.js' --include='*.sh' --include='*.zsh' --include='*.ps1' --include='.env*' \
  '(--agent[[:space:]]+[^[:space:]]+|-xhigh|--effort[[:space:]]+(xhigh|max)|gemini-3\.8-flash|gemini-4-argon)' \
  "$TARGET_ABS" 2>/dev/null | head -n 4 | sed "s|^${TARGET_ABS}/||" | paste -sd ',' - || true)"

if (( JSON_MODE == 1 )); then
  cat <<EOF
{
  "platform": "macOS 27",
  "agy_found": ${AGY_FOUND},
  "agy_version": "${AGY_VERSION}",
  "agy_post_issue_1890": ${AGY_POST_1890},
  "updater_lock_present": ${LOCK_PRESENT},
  "updater_lock_cleared": ${LOCK_CLEARED},
  "configured_model": "${CURRENT_MODEL}",
  "use_g1_credits": "${USE_G1_CREDITS}",
  "credits_drain_risk": ${CREDITS_DRAIN_RISK},
  "model_high_burn_risk": ${MODEL_HIGH_BURN_RISK},
  "settings_updated": ${SETTINGS_UPDATED},
  "backup_path": "${BACKUP_LABEL}",
  "ai_studio_next_pt_reset_local": "${PT_NEXT_LOCAL}",
  "ai_studio_pt_countdown": "${PT_COUNTDOWN}",
  "workspace_custom_agent_hits": ${AGENT_HITS},
  "workspace_xhigh_hits": ${XHIGH_HITS},
  "workspace_retired_model_hits": ${RETIRED_HITS},
  "workspace_sample_files": "${SAMPLE_FILES}"
}
EOF
else
  print -r -- ""
  print -P "%B=== Antigravity Quota Guard Summary (macOS 27 · Sanitized) ===%b"
  print -r -- "Antigravity CLI (agy):   ${AGY_VERSION} (post-#1890=${AGY_POST_1890})"
  print -r -- "Updater Lock Present:    ${LOCK_PRESENT} (cleared=${LOCK_CLEARED})"
  print -r -- "Configured Model:        ${CURRENT_MODEL} (high_burn_risk=${MODEL_HIGH_BURN_RISK})"
  print -r -- "AI Credits Overages:     useG1Credits=${USE_G1_CREDITS} (drain_risk=${CREDITS_DRAIN_RISK})"
  print -r -- "Settings Updated:        ${SETTINGS_UPDATED} ${BACKUP_LABEL}"
  print -r -- "AI Studio 00:00 PT Next: ${PT_NEXT_LOCAL} (in ${PT_COUNTDOWN})"
  print -r -- "Workspace Traps:         --agent=${AGENT_HITS}, xhigh/max=${XHIGH_HITS}, retired=${RETIRED_HITS}"
  print -r -- ""
  if [[ "$CREDITS_DRAIN_RISK" == "false" && "$MODEL_HIGH_BURN_RISK" == "false" && "$LOCK_PRESENT" == "false" ]]; then
    print -P "%F{green}[OK] Local quota guard looks healthy. Run '/usage' inside agy to sync backend counters.%f"
  else
    print -P "%F{yellow}[ACTION] Re-run with --apply --clear-lock or run '/usage' and '/effort medium' inside agy.%f"
  fi
fi
exit 0

Run command:

chmod +x ./agy_quota_guard_macos27.zsh && zsh ./agy_quota_guard_macos27.zsh

Method 2: Automated AI Agent Execution (Copy-Paste Prompt)

Paste this prompt directly into Antigravity, Codex, or Claude Code to run an unattended audit and apply safe defaults:

Detect the current OS and execute the corresponding zero-dependency Antigravity quota guard script in non-interactive JSON mode:
- Windows 11: powershell -ExecutionPolicy Bypass -File .gy_quota_guard_windows11.ps1 -Auto -Json -Target .
- Ubuntu 26.04: bash ./agy_quota_guard_ubuntu2604.sh --auto --json --target .
- macOS 27: zsh ./agy_quota_guard_macos27.zsh --auto --json --target .

Apply these rules strictly based on the JSON output:
1. If agy_post_issue_1890 is false or agy_version is below 1.5.20, recommend clearing update.lock (--clear-lock / -ClearLock) and running agy update.
2. If credits_drain_risk is true (useG1Credits=true) or model_high_burn_risk is true (default pinned to Extra/xhigh or retired 3.8 Flash/Argon), re-run with --apply --clear-lock (Windows: -Apply -ClearLock) to back up settings.json, set useG1Credits=false, and pin Medium.
3. If workspace_custom_agent_hits, workspace_xhigh_hits, or workspace_retired_model_hits exceed 0, list only relative filenames and ask before modifying repository files.
4. Do not install any third-party packages or call external proxy services, and never print full IP addresses, computer hostnames, emails, or tokens in your report.

7. Frequently Asked Questions (Q&A)

Q1: Did today’s December 1 reset apply to Free, Trial (including Jio), Paid Pro, and Ultra plans?
A: Yes. Varun Mohan’s post explicitly stated “Resetting Gemini quota on AGY for all users”. A global reset refills whatever Gemini quota pool your tier already has back to 100%, though model eligibility itself still follows your tier (Free/Trial access Gemini 4 Hydrogen; Paid Pro/Ultra unlock Neon and Carbon).

Q2: Why does antigravityreset.com say “8 recorded resets” while resetgemini.com says “18”?
A: Different starting dates. antigravityreset.com tracks the recent autumn/winter wave beginning mid-October 2026 (averaging 6.5 days between drops), whereas resetgemini.com logs the entire series back to May 21, 2026 (18 full resets, averaging 11.4 days across the year including the 44-day summer gap).

Q3: Does Google Antigravity have Banked Resets like OpenAI Codex?
A: Not as of December 1, 2026. Codex offers Banked Resets and Paid Instant Resets inside usage settings, whereas Antigravity currently pairs automated 5-hour/7-day rolling windows with optional AI Credit Overages and unscheduled team-wide resets on X.

Q4: Why did agy still show low or locked quota right after a global reset tweet?
A: First run /usage inside agy to force an active backend sync rather than trusting cached UI text. Second, check whether you actually hit an AI Studio API 429 (which clears strictly at 00:00 PT) or a 503 capacity error. Finally, global rollouts propagate gradually and can take 15–90 minutes to reach all accounts.

Q5: What happened to quota burned by the Issue #1890 4x custom-agent bug before the Nov 30 rollback?
A: While Google did not issue a separate targeted refund for Nov 27–29, today’s December 1 all-user reset effectively restores every affected developer back to 100% across both 5-hour and weekly meters. Make sure you are on agy >= 1.5.20 going forward.

Q6: How can I get notified automatically when Varun posts the next reset?
A: Both antigravityreset.com (email, Telegram, browser alerts) and resetgemini.com (RSS feed and iCal calendar) monitor @_mohansolo automatically. Just treat every alert as a welcome bonus rather than a guaranteed schedule.

Q7: Does 6 resets in 19 days mean Antigravity will reset every week permanently?
A: Never bet production deadlines on it. The November streak happened because Neon launched alongside aggressive KV cache tuning, the #1890 4x rollback, Thanksgiving, and the November 30 model cleanup. Earlier this year, Antigravity went 44 days without a single manual reset—so good quota hygiene remains essential.


Closing Thoughts

Calling Varun Mohan “Google’s Tibo” started as a lighthearted X joke, yet it captures a defining truth of late-2026 AI developer tools: as agent swarms consume orders of magnitude more compute than chat prompts, infrastructure teams are constantly rebalancing KV cache pools, harness efficiency, and pricing fairness in full public view. Enjoy today’s 100% reset refill—and lock in Medium effort, Orchestrator pairing, and useG1Credits: false so you stay productive whether the next reset lands in three days or forty-four.


References & Primary Sources

Comments

Sign in with GitHub to comment. Chinese and English versions share the same discussion. Discuss on GitHub

Views --