From 93fc0268cf815086f9861c2c9b02a3ddd612a9e7 Mon Sep 17 00:00:00 2001 From: JoshRob <99092299+JoshRob297@users.noreply.github.com> Date: Fri, 27 Nov 2026 11:14:41 -0600 Subject: [PATCH] docs: sync the client contract with the 1.5.18 capture The API spec still told readers to send the Electron UA, X-Goog-Api-Client and Client-Metadata, and claimed the changelist must never be bumped. Both are wrong today: the CLI sends only the bearer token, JSON content type and its signed UA, and every release has its own build id. - API spec: required headers corrected, version-to-build table, requestId in the CLI shape, Hydrogen added, endpoint comparison fixed - AGY-CONTRACT: refreshed to the authenticated 1.5.18 capture and the remaining differences reduced to the ones still measurable - README (en/es): suspension handling, signature table, Hydrogen, ToS warning links to the new troubleshooting section - CONFIGURATION (en/es): quota output shows suspended accounts as usable: no - MULTI-ACCOUNT (en/es): suspended accounts and their persisted fields - TROUBLESHOOTING (es): the 403 ToS section the English page already had --- README.es.md | 10 ++++-- README.md | 8 +++-- docs/AGY-CONTRACT.md | 67 ++++++++++++++++++++++++++---------- docs/ANTIGRAVITY_API_SPEC.md | 54 +++++++++++++++++++++++------ docs/CONFIGURATION.es.md | 2 ++ docs/CONFIGURATION.md | 2 ++ docs/MULTI-ACCOUNT.es.md | 10 ++++++ docs/MULTI-ACCOUNT.md | 10 ++++++ docs/TROUBLESHOOTING.es.md | 21 ++++++++++- docs/TROUBLESHOOTING.md | 2 +- 10 files changed, 151 insertions(+), 35 deletions(-) diff --git a/README.es.md b/README.es.md index 31e8ee6..3aa3c0c 100644 --- a/README.es.md +++ b/README.es.md @@ -27,9 +27,10 @@ ### Qué cambia este fork - **OpenCode v1 y v2 en un solo entrypoint.** Una factory invocable de v1 más `.setup()` nativo de v2, con modelos, variantes, tools y comandos registrados por los registries de v2. -- **Catálogo real de modelos de Antigravity.** El núcleo curado es Gemini 3.8 Flash, la pareja Claude 4.6 y GPT-OSS 120B; todo lo más nuevo que tu cuenta tenga concedido (Gemini 4 Argon, Claude 5.5) lo registra `model_discovery` desde el catálogo del backend, con una entrada por familia y variantes `low`/`medium`/`high`. -- **Firma oficial del cliente CLI.** Las peticiones presentan `antigravity/cli/ (aidev_client; ...)`, resuelta al arranque desde el auto-updater del CLI. Sin ella el backend responde `404 NOT_FOUND` para las líneas nuevas de Gemini, que es también por lo que una firma vieja parecía "preview access no habilitado". +- **Catálogo real de modelos de Antigravity.** El núcleo curado es Gemini 3.8 Flash, la pareja Claude 4.6 y GPT-OSS 120B; todo lo más nuevo que tu cuenta tenga concedido (Gemini 4 Argon/Hydrogen, Claude 5.5) lo registra `model_discovery` desde el catálogo del backend, con una entrada por familia y variantes `low`/`medium`/`high`. +- **Firma oficial del cliente CLI.** Las peticiones presentan `antigravity/cli/ (aidev_client; ...)`, resuelta al arranque desde el auto-updater del CLI. Sin ella el backend responde `404 NOT_FOUND` para las líneas nuevas de Gemini, que es también por lo que una firma vieja parecía "preview access no habilitado". Versión y build id salen de una sola tabla (`1.5.18` / `cl=1030252320` hoy); una versión cuyo build no se conoce se ignora en vez de emparejar una versión nueva con un `cl` viejo. - **Pool multi-cuenta con rotación por entitlement.** Cuota, salud y catálogo de modelos medidos por cuenta; failover en `429`, `403`, caídas de transporte y fallos `404`; cooldowns y circuit breakers para que una cuenta mala no envenene el pool. +- **Manejo de suspensiones a nivel de cuenta.** Un `403 violation of Terms of Service` no se reintenta: la cuenta se deshabilita, se persiste como `suspended`, sale de la rotación y se reporta como `SUSPENDED` / `(suspended)` en vez de un 100% saludable. - **Reporte de cuota de doble ventana.** `antigravity_quota` y `/antigravity-quota` muestran las ventanas 5h y semanal por familia (Gemini, Claude/GPT, Gemini 4 Argon), cuentas regresivas cortas, un `USABLE` veraz y las capacidades medidas de cada cuenta. - **Tiers de thinking y firmas de Claude.** Ids del backend con tier, presupuestos de thinking para Claude, caché de firmas y recuperación de loops de tools interrumpidos. - **Controles de seguridad.** `safety_level` configurable, más `safety_shield` para exponer y rotar ante telemetría de seguridad de Google. @@ -91,6 +92,8 @@ No hace falta cambiar nada de configuración al pasar de OpenCode v1 a v2. > - Tu cuenta puede ser suspendida o baneada de forma permanente > - Asumes todos los riesgos asociados al uso del plugin > +> Cuando Google deshabilita una cuenta, el plugin deja de reintentarla y la marca como `suspended`; consulta [Solución de problemas](docs/TROUBLESHOOTING.es.md#403-this-service-has-been-disabled-in-this-account-for-violation-of-terms-of-service). +> @@ -195,10 +198,11 @@ quejarse, por eso se queda documentado para quien tenga uno que funcione. | Modelo | Variantes | Descripción | |---|---|---| | `antigravity-gemini-3.8-flash` | `low`, `medium`, `high` | **Gemini 3.8 Flash** — el de por defecto; 1M de contexto | -| `antigravity-claude-sonnet-4-6` | `low`, `medium`, `high`, `max` | Claude Sonnet 4.6 — se está retirando; las cuentas con grant ya reciben "cambia a Claude Sonnet 5.5" | +| `antigravity-claude-sonnet-4-6` | — | Claude Sonnet 4.6 — se está retirando; las cuentas con grant ya reciben "cambia a Claude Sonnet 5.5". Sin thinking: no tiene tiers | | `antigravity-claude-opus-4-6-thinking` | `low`, `medium`, `high`, `max` | Claude Opus 4.6 con thinking extendido; 200k de contexto | | `antigravity-gpt-oss-120b-medium` | `low`, `medium`, `high` | GPT-OSS 120B, pesos abiertos | | `antigravity-gemini-4-argon` | `low`, `medium`, `high` | **Gemini 4 Argon** — lo registra `model_discovery` cuando la cuenta tiene el grant | +| `antigravity-gemini-4-hydrogen` | `low`, `medium`, `high` | **Gemini 4 Hydrogen** — lo registra `model_discovery` cuando hay grant; verificado el 2026-11-27 con la firma del CLI | | `antigravity-claude-sonnet-5-5` | `low`, `medium`, `high`, `max` | Claude Sonnet 5.5 — 1M de contexto / 128k de salida | | `antigravity-claude-opus-5-5` | `low`, `medium`, `high`, `max` | Claude Opus 5.5 | diff --git a/README.md b/README.md index 97d0b97..8ae6e68 100644 --- a/README.md +++ b/README.md @@ -24,9 +24,10 @@ ### What this fork changes - **OpenCode v1 and v2 in one entrypoint.** A callable v1 factory plus native v2 `.setup()`, with models, variants, tools and slash commands registered through the v2 registries. -- **Real Antigravity model catalog.** The curated core is Gemini 3.8 Flash, the Claude 4.6 pair and GPT-OSS 120B; anything newer that your account is granted (Gemini 4 Argon, Claude 5.5) is registered by `model_discovery` from the backend catalog, one selector entry per family with `low`/`medium`/`high` variants. -- **Official CLI client signature.** Requests present `antigravity/cli/ (aidev_client; ...)`, resolved at startup from the CLI auto-updater. Without it the backend answers `404 NOT_FOUND` for the newer Gemini lines - which is also why a stale signature used to look like "preview access not enabled". +- **Real Antigravity model catalog.** The curated core is Gemini 3.8 Flash, the Claude 4.6 pair and GPT-OSS 120B; anything newer that your account is granted (Gemini 4 Argon/Hydrogen, Claude 5.5) is registered by `model_discovery` from the backend catalog, one selector entry per family with `low`/`medium`/`high` variants. +- **Official CLI client signature.** Requests present `antigravity/cli/ (aidev_client; ...)`, resolved at startup from the CLI auto-updater. Without it the backend answers `404 NOT_FOUND` for the newer Gemini lines - which is also why a stale signature used to look like "preview access not enabled". Version and build id come from one table (`1.5.18` / `cl=1030252320` today); a version whose build id is unknown is ignored instead of pairing a new version with an old `cl`. - **Multi-account pool with entitlement-aware rotation.** Per-account quota, health and measured model catalog; failover on `429`, `403`, transport drops and `404` misses; account cooldowns and circuit breakers so a bad account cannot poison the pool. +- **Account-level suspension handling.** A `403 violation of Terms of Service` is not retried: the account is disabled, persisted as `suspended`, excluded from rotation, and reported as `SUSPENDED` / `(suspended)` instead of a healthy 100%. - **Dual-window quota reporting.** `antigravity_quota` and `/antigravity-quota` show 5h and weekly windows per model family (Gemini, Claude/GPT, Gemini 4 Argon), short reset countdowns, a truthful `USABLE` flag and the measured capabilities of each account. - **Thinking tiers and Claude signatures.** Tiered backend ids, thinking budgets for Claude, signature caching and recovery for interrupted tool loops. - **Safety controls.** Configurable `safety_level`, plus `safety_shield` to surface and rotate on Google safety telemetry. @@ -88,6 +89,8 @@ No configuration changes are required when transitioning between OpenCode v1 and > - Your account may be suspended or permanently banned > - You assume all risks associated with using this plugin > +> When Google disables an account, the plugin stops retrying it and marks it `suspended`; see [Troubleshooting](docs/TROUBLESHOOTING.md#403-this-service-has-been-disabled-in-this-account-for-violation-of-terms-of-service). +> @@ -198,6 +201,7 @@ complaint, which is why it stays documented for setups that ship a working one. | `antigravity-claude-opus-4-6-thinking` | `low`, `medium`, `high`, `max` | Claude Opus 4.6 with extended thinking; 200k context | | `antigravity-gpt-oss-120b-medium` | `low`, `medium`, `high` | GPT-OSS 120B, open weights | | `antigravity-gemini-4-argon` | `low`, `medium`, `high` | **Gemini 4 Argon** — registered by `model_discovery` when the account holds the grant | +| `antigravity-gemini-4-hydrogen` | `low`, `medium`, `high` | **Gemini 4 Hydrogen** — discovery-registered when granted; verified 2026-11-27 with the CLI signature | | `antigravity-claude-sonnet-5-5` | `low`, `medium`, `high`, `max` | Claude Sonnet 5.5 — 1M context / 128k output | | `antigravity-claude-opus-5-5` | `low`, `medium`, `high`, `max` | Claude Opus 5.5 | diff --git a/docs/AGY-CONTRACT.md b/docs/AGY-CONTRACT.md index f937973..469e5c4 100644 --- a/docs/AGY-CONTRACT.md +++ b/docs/AGY-CONTRACT.md @@ -4,6 +4,11 @@ Reverse engineering de `agy` 1.5.11 (Antigravity CLI, ELF sin símbolos, 268.841.672 bytes) para comparar lo que envía con lo que envía este plugin, y documentar por qué el plugin recibía `429 RESOURCE_EXHAUSTED`. +Actualizado el 2026-11-27 con una captura completa de `agy` **1.5.18** +autenticado (cabeceras y body de `:streamGenerateContent`). Las secciones +marcadas como medidas en esa fecha sustituyen a las de 1.5.11 donde entran en +conflicto. + Todo lo marcado **medido** viene de una captura o de una matriz de respuestas registrada; lo marcado **estimado** es inferencia y no debe tratarse como hecho. @@ -24,9 +29,14 @@ registrada; lo marcado **estimado** es inferencia y no debe tratarse como hecho. `User-Agent` real, tal cual lo emite la CLI: ``` -antigravity/cli/1.5.11 (aidev_client; os_type=linux; arch=amd64; cl=1024248524; auth_method=consumer) +antigravity/cli/1.5.18 (aidev_client; os_type=linux; arch=amd64; cl=1030252320; auth_method=consumer) ``` +Medido el 2026-11-27. El par version/build de cada release vive en una sola +tabla (`ANTIGRAVITY_CLI_BUILDS` en `src/constants.ts`); la 1.5.11 reportaba +`cl=1024248524`, la 1.5.18 reporta `cl=1030252320`. Una versión sin build +conocido se ignora para no emitir una pareja que ningún cliente real manda. + - No envía **ninguna** cabecera `x-goog-*` ni `x-sherlog-*` en `:streamGenerateContent`. Esas cadenas existen en el binario pero pertenecen a otras rutas (telemetría/endpoints internos), no a esta petición. @@ -77,6 +87,12 @@ Dos cosas que importan más de lo que parecen: `daily-cloudcode-pa.sandbox.googleapis.com` acepta los mismos bodies, y `cloudcode-pa.googleapis.com` (PROD) devuelve `429` a *cualquier* body. +La captura de 1.5.18 (2026-11-27) confirma las mismas seis claves +(`project`, `requestId`, `request`, `model`, `userAgent`, `requestType`) y el +mismo `userAgent: "antigravity"`. El modelo medido ese día fue +`gemini-4-hydrogen-high`, con `requestId` en la forma +`agent////1`. + ## 3. El 429 no era cuota Medido el 2026-11-18 con una cuenta, `gemini-4-argon-low`, cuerpo idéntico byte a @@ -137,28 +153,34 @@ comportamiento. Implementación: `neutralizeBlockedSystemInstructionLiterals()` en `src/plugin/request-helpers.ts`, aplicada al final sobre todo -`systemInstruction` en `src/plugin/request.ts:1717-1733`. La lista de literales +`systemInstruction` en `src/plugin/request.ts`. La lista de literales bloqueados es una tabla explícita, para que añadir otro sea un diff de una línea. -## 4. Tabla de diferencias plugin ↔ CLI +## 4. Diferencias plugin ↔ CLI (estado 2026-11-27) + +La tabla original comparaba `agy` 1.5.11 contra el plugin de noviembre. Estos +puntos ya están alineados y se dejan aquí para que nadie los "redescubra": -Solo la nº 11 cambia el status (medido, ver §3). Las demás son reales pero se -dejan fuera de este parche por alcance: ninguna movió `200` ↔ `429` en los -replays de variable única. +- Host por defecto: `ANTIGRAVITY_ENDPOINT_FALLBACKS[0]` es + `daily-cloudcode-pa.googleapis.com`, igual que la CLI. +- Host de cuota y verificación: usan el mismo primario (antes iban a PROD). +- Versión y `cl` del UA: pareja `1.5.18` / `1030252320` en la tabla única. +- `requestId`: forma `agent////1`. +- `Client-Metadata.platform`: el plugin ya no manda esa cabecera en + `loadCodeAssist`; usa `User-Agent: antigravity` a propósito porque es lo que + resuelve el proyecto administrado. +- Regex de familias con tier: incluye `hydrogen`. -| # | Diferencia | Plugin | CLI (medido) | Efecto | +Diferencias que siguen existiendo, ninguna con efecto medido sobre el status: + +| # | Diferencia | Plugin | CLI (medido 2026-11-27) | Efecto | | --- | --- | --- | --- | --- | -| 1 | Host por defecto | `daily-cloudcode-pa.sandbox.googleapis.com` — `src/constants.ts:35` | `daily-cloudcode-pa.googleapis.com` | ninguno (ambos 200) | -| 2 | Host en verificación/quota | `cloudcode-pa.googleapis.com` — `src/plugin.ts:519`, `src/plugin/quota.ts:181,207` | nunca PROD para sgen | PROD da 429 a todo body | -| 3 | `cl` en el UA | `962369648` — `src/constants.ts:95` | `1024248524` | ninguno | -| 4 | Versión en el UA | `1.5.8` — `src/constants.ts:88` | `1.5.11` | ninguno | -| 5 | `requestId` | `agent-` — `src/plugin/request.ts:1744` | `agent////1` | ninguno | -| 6 | `request.labels` | ausente | 9 claves (`cascade_id`, `trajectory_id`, …) | ninguno | -| 7 | Proyecto | cacheado (`managedProjectId`) — `src/plugin/request.ts:1684` | `loadCodeAssist` → `cloudaicompanionProject` | ninguno | -| 8 | UA en otras rutas | navegador / `"antigravity"` — `src/constants.ts:113-115`, `src/plugin/project.ts:131` | UA de CLI en todo | ninguno | -| 9 | `Client-Metadata.platform` | linux reporta `MACOS` — `src/constants.ts:114` | — | cosmético | -| 10 | Regex de familias con tier | falta `hydrogen` — `src/plugin/transform/model-resolver.ts:229` | — | modelo sin tier | -| 11 | `systemInstruction` | reenvía tal cual el catálogo del harness | no aplica | **causa del 429** | +| 1 | `request.labels` | ausente | 9 claves (`cascade_id`, `trajectory_id`, `model_enum`, …) | ninguno | +| 2 | `Accept` / `accept-encoding` | `text/event-stream` + `gzip, deflate, br, zstd` | sin `Accept`, solo `gzip` | ninguno | +| 3 | `request.sessionId` | solo cuando el harness da una sesión | siempre presente | ninguno | +| 4 | UA en otras rutas | `antigravity` en `loadCodeAssist` | UA de CLI en todo | ninguno; el valor del plugin es intencional | +| 5 | Endpoints auxiliares | no los llama | `fetchAdminControls`, `fetchUserInfo`, `listExperiments`, `writeTrajectoryAcls`, `aicode fetchConfig`, `play log` | ninguno para inferencia | +| 6 | Origen del proyecto | `managedProjectId` cacheado, resuelto por `ensureProjectContext` | `loadCodeAssist` al arrancar | ninguno | ## 5. Verificación del arreglo @@ -171,3 +193,12 @@ replays de variable única. y 22.048 bytes, **0** ocurrencias del literal original y **2** de la forma con espacio en el body grande; ambas respuestas `200 OK` con `text/event-stream`. Antes del parche, el body grande daba 429 de forma determinista. + +## 6. Verificación 2.9.14 (2026-11-27) + +- Firma `1.5.18` / `cl=1030252320` con el endpoint primario del CLI + (`daily-cloudcode-pa.googleapis.com`). +- Peticiones vivas: `gemini-3.8-flash-high` → `200` + (`modelVersion: gemini-3.8-flash-n`), `gemini-4-hydrogen-high` → `200` + (`modelVersion: gemini-4-hydrogen`), `claude-sonnet-4-6` → `200`. +- `requestId` emitido con la forma del CLI y aceptado por el backend. diff --git a/docs/ANTIGRAVITY_API_SPEC.md b/docs/ANTIGRAVITY_API_SPEC.md index e4e4f19..94b9842 100644 --- a/docs/ANTIGRAVITY_API_SPEC.md +++ b/docs/ANTIGRAVITY_API_SPEC.md @@ -61,18 +61,27 @@ https://www.googleapis.com/auth/experimentsandconfigs ### Required Headers +Measured 2026-11-27 against an authenticated `agy` 1.5.18: the CLI sends only +the bearer token, JSON content type and its client signature. Anything else is +added by the HTTP stack, not by the client. + ```http Authorization: Bearer {access_token} Content-Type: application/json -User-Agent: antigravity/1.15.8 windows/amd64 -X-Goog-Api-Client: google-cloud-sdk vscode_cloudshelleditor/0.1 -Client-Metadata: {"ideType":"ANTIGRAVITY","platform":"MACOS","pluginType":"GEMINI"} +User-Agent: antigravity/cli/ (aidev_client; os_type=linux; arch=amd64; cl=; auth_method=consumer) ``` -For streaming requests, also include: +Do **not** send `x-goog-api-key`, `x-goog-user-project`, `X-Goog-Api-Client` or +`Client-Metadata` on inference requests. The first two make the backend reject +the request with `400 API_KEY_INVALID` / project checks, and the last two are +artifacts of the old Electron-style client that the backend no longer expects. +The plugin strips them defensively. + +For streaming requests, the plugin also sends: ```http Accept: text/event-stream ``` +The CLI omits it and relies on `?alt=sse`; both are accepted. --- @@ -81,18 +90,36 @@ Accept: text/event-stream Every model is served only to the official Antigravity **CLI** signature. Requests carry: ```http -User-Agent: antigravity/cli/ (aidev_client; os_type=linux; arch=amd64; cl=962369648; auth_method=consumer) +User-Agent: antigravity/cli/ (aidev_client; os_type=linux; arch=amd64; cl=; auth_method=consumer) ``` The generic Electron-style UA (`Antigravity/ ...`) is no longer accepted. Measured 2026-11-07 on a three-account pool, for `claude-sonnet-4-6`, `claude-sonnet-5-5`, `gemini-3.8-flash` and `gemini-4-argon-*`: the generic UA returns **HTTP 200** with the body *"This version of Antigravity is no longer supported. Please download and install the latest version..."* instead of an answer. Because it is a `200` with text, it looks like a successful turn in the client, which is worse than the old `404 NOT_FOUND` those Gemini models returned in the same situation. Sending the CLI UA for the same requests returns content. The IDE-style version (`Antigravity/`) is still resolved from the IDE auto-updater, but it is no longer used for content requests. -`` is resolved at plugin startup from the CLI auto-updater endpoint (`https://antigravity-cli-auto-updater-974169037036.us-central1.run.app`), falling back to `ANTIGRAVITY_CLI_VERSION_FALLBACK` in `src/constants.ts` when unreachable. It used to be hardcoded, which meant it silently drifted behind the real client: only the version string is spoofed, so bumping it is a one-line change once the endpoint is reachable. +**Version and build id travel together.** `cl` is not shared across releases: each +CLI build reports its own number. The plugin keeps one table +(`ANTIGRAVITY_CLI_BUILDS` in `src/constants.ts`) and derives both halves from the +same entry: + +| CLI version | `cl` | +|---|---| +| `1.5.18` | `1030252320` | +| `1.5.17` | `4823843970351104` | +| `1.5.14` | `1027820220` | +| `1.5.8` | `962369648` | + +`` is resolved at plugin startup from the CLI auto-updater endpoint +(`https://antigravity-cli-auto-updater-974169037036.us-central1.run.app`), +falling back to `ANTIGRAVITY_CLI_VERSION_FALLBACK` when unreachable. If the +updater announces a version whose build id is not in the table, the plugin +ignores it on purpose: a mismatched pair (new version, old `cl`) is a signature +no real client emits. Update the table when a new release appears; that is the +one-line change. Two things measured against `agy` 1.5.3 (2026-11-08) that are worth writing down before someone "fixes" them: -- **Do not bump the changelist in the signature.** The 1.5.3 binary builds its own UA with `cl=1012564305`, while this plugin sends `cl=962369648`, and the backend still accepts it — a live request with the older `cl` returns content. Changing the number has no demonstrated benefit and breaks the tests that assert the signature literally. +- **A stale `cl` is not free forever.** The 1.5.3 binary built its UA with `cl=1012564305`, and the backend accepted the older `cl=962369648` for a while, which is why the plugin sat on that pair long after it stopped being accurate. That grace is not a guarantee: every release gets a new build id, and the backend can start refusing old ones. Keep the table current (it now carries 1.5.18) and verify with a live request when you touch it. - **Deep-reasoning models can take longer than a minute to emit the first response header.** The 1.5.3 client retries when a request fails with `http2: timeout awaiting response headers` before any SSE chunk arrives. A fetch layer that aborts at 60 s will surface a timeout where the model was about to answer; keep the retry, or keep the timeout above the model's time-to-first-header. The web changelog is not the source of truth for this: at 2026-11-08 it documented up to 1.5.1 while 1.5.3 was already rolled out to 100% through the auto-updater. Read the updater endpoint. The IDE-style version (`Antigravity/`) is resolved the same way from the IDE auto-updater endpoint. @@ -108,6 +135,7 @@ The web changelog is not the source of truth for this: at 2026-11-08 it document | Gemini 3.8 Flash (Low / Medium / High) | `gemini-3.8-flash-{low,medium,high}` | Google | Verified | | GPT-OSS 120B Medium | `gpt-oss-120b-medium` | Other | Verified | | Gemini 4 (Argon) | `gemini-4-argon-{low,medium,high}` | Google | Grant is **per account**, not by plan name: measured 2026-10-31, a `free-tier` account received the real ids plus its own `Gemini 4 Argon` weekly bucket, while other accounts only get `gemini-4-argon-disabled` (no `quotaInfo`, `404` on the real id). Requires the CLI User-Agent. Registered by `model_discovery` as one model with tier variants. | +| Gemini 4 (Hydrogen) | `gemini-4-hydrogen-{low,medium,high}` | Google | Verified 2026-11-27: `agy` 1.5.18 serves `gemini-4-hydrogen-high` with the CLI signature, and the plugin gets `200` with `modelVersion: gemini-4-hydrogen` on the same body shape. Same per-account grant model as Argon. | | Claude Sonnet / Opus 5.5 | `claude-sonnet-5-5-{low,medium,high}`, `claude-opus-5-5-{low,medium,high}` | Anthropic (Vertex) | Same per-account grant. Works with the generic UA. Reports 1M context / 128k output. Free accounts answer `404`; they keep Claude 4.6 quota. | > Gemini 3.7 Flash, 3.6 Flash and 3.1 Pro were reachable from consumer plans until **2026-10-13**, when they moved to Ultra / Enterprise-only. Their backend resolvers are retained for future / Enterprise use but they are no longer registered as selectable models. @@ -148,10 +176,14 @@ the plugin maps a model to its bucket without guessing from the name. "tools": [...] }, "userAgent": "antigravity", - "requestId": "{unique_id}" + "requestType": "agent", + "requestId": "agent/{conversation_id}/{turn_epoch_ms}/{turn_id}/1" } ``` +`requestId` follows the CLI shape `agent////1`. The older +`agent-` form is still accepted; the plugin emits the CLI form since 2.9.14. + ### Contents Array (REQUIRED) **IMPORTANT: Must use Gemini-style format. Anthropic-style `messages` array is NOT supported.** @@ -647,7 +679,8 @@ The following Anthropic/Vertex AI features are **NOT supported**: } }, "userAgent": "antigravity", - "requestId": "agent-abc123" + "requestType": "agent", + "requestId": "agent/3f6e0c1a-8f2b-4f0e-9a53-2b1c7d4e5f60/1795798847406/bf0f4456-242d-486c-bdf4-ac60e5ed6d97/1" } ``` @@ -666,7 +699,7 @@ The following Anthropic/Vertex AI features are **NOT supported**: | Feature | Antigravity | Vertex AI Anthropic | |---------|-------------|---------------------| -| Endpoint | `cloudcode-pa.googleapis.com` | `aiplatform.googleapis.com` | +| Endpoint | `daily-cloudcode-pa.googleapis.com` (fallbacks: prod, sandbox) | `aiplatform.googleapis.com` | | Request format | Gemini-style `contents` | Anthropic `messages` | | `anthropic_version` | Not used | Required | | Model names | Simple (`claude-sonnet-4-6`) | Versioned (`claude-4-5@date`) | @@ -677,5 +710,6 @@ The following Anthropic/Vertex AI features are **NOT supported**: ## Changelog +- **2026-11-27**: Verified against an authenticated `agy` 1.5.18 capture. CLI signature moved to `1.5.18` / `cl=1030252320` with a version-to-build table, `requestId` documented in the CLI shape, headers section corrected (no `x-goog-*`/`Client-Metadata` on inference), Hydrogen added. - **2025-12-14**: Added function calling quirks, JSON Schema support matrix, tool name rules - **2025-12-13**: Initial specification based on direct API testing diff --git a/docs/CONFIGURATION.es.md b/docs/CONFIGURATION.es.md index 5bb35b1..f00c36f 100644 --- a/docs/CONFIGURATION.es.md +++ b/docs/CONFIGURATION.es.md @@ -166,6 +166,7 @@ Los modelos descubiertos se agrupan por familia: una sola entrada en el selector - **Ambas ventanas** (5h y semanal) con su barra, y solo las ventanas que esa familia realmente tiene; Argon imprime únicamente la columna semanal. - **Cuenta regresiva corta por ventana** (`3h 54m`, `6d 22h`), tomada del timestamp que declara el backend. Sin la fecha y hora completa que solo agregaba ruido. - **`USABLE` en lugar de un health estático**: la cuenta aparece como `no · ` mientras cualquier ventana de esa familia esté en `0%`, porque una barra de 5h con cuota no sirve si el bucket semanal está vacío. Solo las cuentas que realmente pueden servir esa familia muestran `yes`. +- **Las cuentas suspendidas lo dicen**: tras un `403 violation of Terms of Service` la cuenta imprime `no · suspended` y `(suspended)` junto a su nombre, aunque el endpoint de cuota siga respondiendo. La cuenta está fuera de rotación, así que los números son solo informativos. - **Capacidades por cuenta (medidas)**: cuántos modelos alcanza cada cuenta, si tiene Gemini 4 Argon (con su porcentaje restante y su cuenta regresiva al reset), **Claude 4.6 y Claude 5.5 por separado**, y si `gemini-3.8-flash` está disponible. La cuota de Claude es de la familia, así que una cuenta Free puede tener cuota de Claude y no tener 5.5: medido el 2026-10-31, `claude-sonnet-4-6` responde `200` en ambas cuentas Free mientras `claude-sonnet-5-5-medium` responde `404`. Las cuentas que nunca se midieron dicen `not measured` en lugar de adivinar. ``` @@ -177,6 +178,7 @@ QUOTA (weekly) RESET (weekly) USABLE ACCOUNT QUOTA (5h) RESET (5h) QUOTA (weekly) RESET (weekly) USABLE ACCOUNT [██████████] 99% 3h 53m [██████████] 99% 6d 22h yes joshuaadair.hr [██████████] 100% 3h 38m [░░░░░░░░░░] 0% 11h 59m no · 11h 59m hrjoces22 +[██████████] 100% 4h 59m [██████████] 100% 6d 23h no · suspended suspended@example (suspended) ## Account capabilities (measured) ACCOUNT MODELS GEMINI 4 ARGON CLAUDE 4.6 CLAUDE 5.5 GEMINI 3.8 FLASH diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md index 19b3bc5..d2319dd 100644 --- a/docs/CONFIGURATION.md +++ b/docs/CONFIGURATION.md @@ -117,6 +117,7 @@ Settings for managing multiple Google accounts. - **Both windows** (5h and weekly) with the bar, and only the windows that family actually has - Argon prints the weekly column alone. - **Short reset countdown** per window (`3h 54m`, `6d 22h`), taken from the timestamp the backend declares. No full date/time clutter. - **`USABLE` instead of a static health score**: an account is `no · ` while any window of that family sits at `0%`, because a 5h bar with quota left cannot be used once the weekly bucket is empty. Only accounts that can actually serve the family show `yes`. +- **Suspended accounts say so**: after a `403 violation of Terms of Service` the account prints `no · suspended` and `(suspended)` next to its name, even though the quota endpoint keeps answering. The account is out of rotation, so the numbers are informational only. - **Account capabilities (measured)**: models each account can reach, whether it has Gemini 4 Argon (with its remaining percentage and reset countdown), **Claude 4.6 vs Claude 5.5** separately, and whether `gemini-3.8-flash` is available. Claude quota is shared by the family, so a Free account can have Claude quota and still lack 5.5: measured 2026-10-31, `claude-sonnet-4-6` answers `200` on both Free accounts while `claude-sonnet-5-5-medium` answers `404`. Accounts that were never measured say `not measured` instead of guessing. ``` @@ -128,6 +129,7 @@ QUOTA (weekly) RESET (weekly) USABLE ACCOUNT QUOTA (5h) RESET (5h) QUOTA (weekly) RESET (weekly) USABLE ACCOUNT [██████████] 99% 3h 53m [██████████] 99% 6d 22h yes joshuaadair.hr [██████████] 100% 3h 38m [░░░░░░░░░░] 0% 11h 59m no · 11h 59m hrjoces22 +[██████████] 100% 4h 59m [██████████] 100% 6d 23h no · suspended suspended@example (suspended) ## Account capabilities (measured) ACCOUNT MODELS GEMINI 4 ARGON CLAUDE 4.6 CLAUDE 5.5 GEMINI 3.8 FLASH diff --git a/docs/MULTI-ACCOUNT.es.md b/docs/MULTI-ACCOUNT.es.md index e9761b4..378c28b 100644 --- a/docs/MULTI-ACCOUNT.es.md +++ b/docs/MULTI-ACCOUNT.es.md @@ -84,6 +84,13 @@ O selecciona una cuenta de la lista y elige "Enable/Disable account". - Siguen apareciendo en las comprobaciones de cuota (marcadas como `[disabled]`) - Se pueden volver a habilitar en cualquier momento +**Cuentas suspendidas (403 de Terms of Service):** cuando Google responde +`This service has been disabled in this account for violation of Terms of Service`, +el plugin deshabilita la cuenta, la marca como `suspended` y deja de reintentarla. +Aparece como `SUSPENDED` en `antigravity_stats`, `(suspended)` / `USABLE no` en +`antigravity_quota` y `[suspended: ToS]` en el menú. Volver a habilitarla limpia +la marca; hazlo solo después de que prospere una apelación. + Útil cuando: - Una cuenta está baneada o limitada temporalmente por un periodo prolongado - Quieres reservar ciertas cuentas para casos de uso específicos @@ -145,6 +152,9 @@ Las cuentas se almacenan en `~/.config/opencode/antigravity-accounts.json`: | `refreshToken` | Token de refresco de OAuth (gestionado automáticamente) | | `projectId` | ID de proyecto de Google Cloud opcional (autodescubierto). | | `enabled` | Opcional. Ponlo en `false` para deshabilitar la rotación de cuentas. Por defecto es `true`. | +| `suspended` | Lo pone el plugin tras un 403 de Terms of Service. Una cuenta suspendida queda fuera de rotación aunque `enabled` sea `true`; habilitarla explícitamente limpia la marca. | +| `suspendedAt` | Marca de tiempo de la suspensión. | +| `suspendedReason` | Mensaje que devolvió el backend con la suspensión. | | `activeIndex` | Índice de la cuenta activa actualmente | | `activeIndexByFamily` | Cuenta activa por familia de modelos (claude/gemini se rastrean por separado) | diff --git a/docs/MULTI-ACCOUNT.md b/docs/MULTI-ACCOUNT.md index 83549e6..f16396d 100644 --- a/docs/MULTI-ACCOUNT.md +++ b/docs/MULTI-ACCOUNT.md @@ -81,6 +81,13 @@ Or select an account from the list and choose "Enable/Disable account". - Still appear in quota checks (marked `[disabled]`) - Can be re-enabled at any time +**Suspended accounts (403 Terms of Service):** when Google answers +`This service has been disabled in this account for violation of Terms of Service`, +the plugin disables the account, marks it `suspended`, and stops retrying it. It +shows as `SUSPENDED` in `antigravity_stats`, `(suspended)` / `USABLE no` in +`antigravity_quota`, and `[suspended: ToS]` in the menu. Re-enabling the account +clears the mark, so only do it after an appeal succeeds. + Useful when: - An account is temporarily banned or rate-limited for an extended period - You want to reserve certain accounts for specific use cases @@ -142,6 +149,9 @@ Accounts are stored in `~/.config/opencode/antigravity-accounts.json`: | `refreshToken` | OAuth refresh token (auto-managed) | | `projectId` | Optional Google Cloud project ID (auto-discovered). | | `enabled` | Optional. Set to `false` to disable account rotation. Defaults to `true`. | +| `suspended` | Set by the plugin after a 403 Terms of Service response. A suspended account stays out of rotation even if `enabled` is `true`; enabling it explicitly clears the mark. | +| `suspendedAt` | Timestamp of the suspension. | +| `suspendedReason` | Message the backend returned with the suspension. | | `activeIndex` | Currently active account index | | `activeIndexByFamily` | Per-model-family active account (claude/gemini tracked separately) | diff --git a/docs/TROUBLESHOOTING.es.md b/docs/TROUBLESHOOTING.es.md index 7f401f3..2553328 100644 --- a/docs/TROUBLESHOOTING.es.md +++ b/docs/TROUBLESHOOTING.es.md @@ -220,7 +220,7 @@ Algunos servidores MCP tienen esquemas incompatibles con el formato JSON estrict **Síntomas:** - Los prompts se cuelgan indefinidamente (200 OK en los logs pero sin respuesta) -- Errores 403 "Permission Denied" incluso con cuentas nuevas +- Errores 403 "Permission Denied" incluso con cuentas nuevas (si el mensaje menciona Terms of Service, mira la sección dedicada más abajo) - "All accounts rate-limited" pero la cuota parece disponible - Las cuentas nuevas quedan rate-limited de inmediato al añadirlas @@ -297,6 +297,25 @@ Si ves un comportamiento de rate limit inusual, compártelo en un [issue de GitH --- +## 403 "This service has been disabled in this account for violation of Terms of Service" + +No es un rate limit ni el flujo de `validation_required`. Google deshabilitó la +cuenta, así que reintentar no cambia nada: el backend responde el mismo 403 para +todos los modelos. + +Desde 2.9.13 el plugin lo detecta, saca la cuenta de la rotación, persiste +`suspended: true` junto con `suspendedReason`, y lo reporta como `SUSPENDED` en +`antigravity_stats`, `(suspended)` en `antigravity_quota` y `[suspended: ToS]` en +el menú de cuentas. + +Qué hacer: +1. Apela con el enlace o las instrucciones que incluya el error de Google, si las hay. +2. Sigue usando otra cuenta mientras tanto; la suspendida se salta. +3. Si Google la reinstala, vuelve a habilitarla (menú o `enabled: true` sin + `suspended`); el plugin limpia la marca y la prueba de nuevo. + +--- + ## Se crean archivos `.tmp` infinitos **Causa:** cuando la cuenta está rate-limited y el plugin reintenta infinitamente, genera muchos archivos temporales. diff --git a/docs/TROUBLESHOOTING.md b/docs/TROUBLESHOOTING.md index 69f384b..ed78666 100644 --- a/docs/TROUBLESHOOTING.md +++ b/docs/TROUBLESHOOTING.md @@ -259,7 +259,7 @@ Some MCP servers have schemas incompatible with Antigravity's strict JSON format **Symptoms:** - Prompts hang indefinitely (200 OK in logs but no response) -- 403 "Permission Denied" errors even with fresh accounts +- 403 "Permission Denied" errors even with fresh accounts (if the message mentions Terms of Service, see the dedicated section below) - "All accounts rate-limited" but quota looks available - New accounts get rate-limited immediately after adding