Claude Code. Any Model. The most powerful AI coding agent now speaks every language.
docs(antigravity): replace the stale self-refresh description
Jack Rudenko5732aa746104
diff --git a/ai-docs/architecture/providers/antigravity.md b/ai-docs/architecture/providers/antigravity.mdindex b377db6e..b60412dc 100644--- a/ai-docs/architecture/providers/antigravity.md+++ b/ai-docs/architecture/providers/antigravity.md@@ -193,7 +193,7 @@ That rule now governs only the fallback list. When the backend sends**Token lifecycle** (`auth/antigravity-token.ts`, macOS):- **Shared store**: the same keychain item the `agy` CLI uses — `service=gemini, account=antigravity`, value `go-keyring-base64:<base64(JSON)>` (zalando/go-keyring). claudish reads AND writes it, so both tools reuse one live token.-- **Self-refresh**: when the token is expired, POST `oauth2/token` with `grant_type=refresh_token`. The Antigravity client_id/secret are **never shipped** — they're extracted at runtime from the user's own local `agy` binary (`strings` for the `…apps.googleusercontent.com` id + `GOCSPX-` secret; the working combo is discovered by first-200 and cached). The refreshed (and possibly rotated) token is written back to the shared store.+- **Refresh is delegated to `agy`**: when the access token is expired or within 2 minutes of expiry, claudish runs `agy models` (12 s timeout). That lightweight, authed command makes `agy` mint a fresh token with its OWN current client secret and write it back to the shared store, and claudish then re-reads the store. claudish never handles the Antigravity client secret in any form: no embed, no scrape, no token exchange. The secret is a literal inside `agy`, and `agy` auto-updates, so each release rotates it and Google revokes the old one. Any copy claudish held would break within days. The refresh outcome (`ran` / `not-installed` / `timeout` / `failed`, with agy's stderr) decides the error: a slow or failing `agy` is retryable, while a missing `agy` or a session that is still stale after a clean run is terminal.- **Degradation**: no store (agy not installed / not signed in) or non-macOS → actionable error pointing at `g@` + `GEMINI_API_KEY`.**Model ids — LIVE discovery, no hardcoded map**: the Antigravity backend requires a reasoning-tier suffix (bare `gemini-3.6-flash` → 404), but which variants a subscription serves is **per-account and drifts**, so claudish never hardcodes a model list. `getServedAntigravityModels()` fetches the live set from the backend's own `v1internal:fetchAvailableModels` (body `{project}`) — the served ids are the response `models` keys, plus a backend `defaultAgentModelId` — cached with a TTL. `resolveAntigravityModelId(requested, servedIds, defaultId)` then resolves against that LIVE set: exact match passes through; a bare family (e.g. `gemini-3.6-flash`) resolves to the backend's `defaultAgentModelId` when it's a variant of that family, else to the strongest reasoning tier by a *rank rule* (`high>medium>low>extra-low>tiered` — a rule, like `rankCodeAssistModel`, not pinned ids); anything else passes through to the F1–F7 404 rewrite. The only literals are the tier-rank ordering and endpoint strings — no concrete model ids in source.