From 7a7b23314ec6f1fc411afd3c584cd0cf5149e0c0 Mon Sep 17 00:00:00 2001 From: "Andrew (agent)" Date: Thu, 12 Nov 2026 23:26:24 -0500 Subject: [PATCH 1/4] test(antigravity): pin max and ultra to Hydrogen's discovered xhigh tier --- .../google/gemini-4-hydrogen-antigravity.test.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/adapters/google/gemini-4-hydrogen-antigravity.test.ts b/tests/adapters/google/gemini-4-hydrogen-antigravity.test.ts index 1673198f3c0..94b6a6eafa7 100644 --- a/tests/adapters/google/gemini-4-hydrogen-antigravity.test.ts +++ b/tests/adapters/google/gemini-4-hydrogen-antigravity.test.ts @@ -12,8 +12,8 @@ import { expect, test } from "bun:test"; import { antigravityUserAgentForWireModel, ANTIGRAVITY_CLI_REQUEST_UA, ANTIGRAVITY_REQUEST_UA } from "../../../src/adapters/google-antigravity-wire"; import { parseAntigravityAvailableModels, registerAntigravityDiscoveredWireModels, resolveAntigravityEffortWireModel } from "../../../src/providers/antigravity-models"; -// Vertex evidence 2026-11-13 from #8583's author; CCA listing shape is assumed -// from the Argon/Carbon per-tier pattern and has not been live-verified. +// Vertex evidence 2026-11-13 from #8583's author; on CCA an entitled account listed exactly these +// four tiers on 2026-11-12. test("discovered Hydrogen retains its four wire tiers", () => { const ids = ["low", "medium", "high", "xhigh"].map(tier => `gemini-4-hydrogen-${tier}`); const rows = parseAntigravityAvailableModels({ models: Object.fromEntries(ids.map(id => [id, {}])), agentModelSorts: [{ groups: [{ modelIds: ids }] }] })!; @@ -21,6 +21,9 @@ test("discovered Hydrogen retains its four wire tiers", () => { expect(rows[0]?.effortWireModelIds).toEqual({ low: ids[0], medium: ids[1], high: ids[2], xhigh: ids[3] }); registerAntigravityDiscoveredWireModels("https://hydrogen.test", rows); expect(resolveAntigravityEffortWireModel("gemini-4-hydrogen", "xhigh", "https://hydrogen.test").wireModelId).toBe(ids[3]!); + for (const effort of ["max", "ultra"]) { + expect(resolveAntigravityEffortWireModel("gemini-4-hydrogen", effort, "https://hydrogen.test").wireModelId).toBe(ids[3]!); + } expect(resolveAntigravityEffortWireModel("gemini-4-hydrogen", "high", "https://hydrogen.test").wireModelId).toBe(ids[2]!); expect(resolveAntigravityEffortWireModel("gemini-4-hydrogen", undefined, "https://hydrogen.test").wireModelId).toBe(ids[2]!); }); @@ -47,7 +50,9 @@ test("incomplete families stay separate and three-tier families clamp xhigh", () const ids = ["low", "medium", "high"].map(t => `${base}-${t}`); const rows = parseAntigravityAvailableModels({ models: Object.fromEntries(ids.map(id => [id, {}])), agentModelSorts: [{ groups: [{ modelIds: ids }] }] })!; registerAntigravityDiscoveredWireModels("https://three.example.test", rows); - expect(resolveAntigravityEffortWireModel(base, "xhigh", "https://three.example.test").wireModelId).toBe(`${base}-high`); + for (const effort of ["xhigh", "max", "ultra"]) { + expect(resolveAntigravityEffortWireModel(base, effort, "https://three.example.test").wireModelId).toBe(`${base}-high`); + } } }); From eee014bf4ecccfc3a462b5102c6124b2f65dc91d Mon Sep 17 00:00:00 2001 From: "Andrew (agent)" Date: Thu, 12 Nov 2026 23:26:49 -0500 Subject: [PATCH 2/4] fix(antigravity): let max and ultra select Hydrogen's xhigh tier and record its CCA verification On a discovered family that has an xhigh tier, requested max and ultra now select it instead of clamping to high; three-tier families are unchanged. Comments and docs that called Hydrogen on CCA unobserved now record the 2026-11-12 check: an entitled account's CCA discovery listed the four tiers and gemini-4-hydrogen-xhigh answered 200 under the CLI User-Agent. --- docs-site/src/content/docs/guides/providers.md | 3 +-- src/adapters/google-antigravity-wire.ts | 6 +++--- src/providers/antigravity-models.ts | 12 ++++++++---- structure/providers-and-adapters.md | 2 +- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/docs-site/src/content/docs/guides/providers.md b/docs-site/src/content/docs/guides/providers.md index 39619da6067..f197913a473 100644 --- a/docs-site/src/content/docs/guides/providers.md +++ b/docs-site/src/content/docs/guides/providers.md @@ -274,8 +274,7 @@ tier. On `google-antigravity`, Argon is listed with the same three levels, which `gemini-4-argon-low`, `-medium`, and `-high` wire models. Google limits it there to AI Ultra and eligible Enterprise accounts. Cloud Code Assist serves Argon only to the Antigravity CLI client, so OpenCodex sends every Gemini 4 model request and model discovery with the CLI User-Agent -(`antigravity/cli/1.3.4`) and keeps the IDE User-Agent for every other model. Gemini 4 Hydrogen (low, medium, high by default, and xhigh; verified on Vertex AI on 2026-11-13, not yet seen -on Antigravity) appears on `google-antigravity` only when your account's model list includes it, each level mapping to its `gemini-4-hydrogen-*` wire model. +(`antigravity/cli/1.3.4`) and keeps the IDE User-Agent for every other model. Gemini 4 Hydrogen (low, medium, high by default, and xhigh) appears on `google-antigravity` only when your account's model list includes it, each level mapping to its `gemini-4-hydrogen-*` wire model; requesting `max` or `ultra` also selects xhigh. Vertex AI model discovery, its credential rules and how Gemini 4 Argon, Carbon and Hydrogen receive tool images are described in [Google Vertex AI](/guides/google-vertex/). diff --git a/src/adapters/google-antigravity-wire.ts b/src/adapters/google-antigravity-wire.ts index d793bdae542..450c983f78a 100644 --- a/src/adapters/google-antigravity-wire.ts +++ b/src/adapters/google-antigravity-wire.ts @@ -29,9 +29,9 @@ export const ANTIGRAVITY_DISCOVERY_UA = ANTIGRAVITY_CLI_REQUEST_UA; * Wire ids sent with the CLI User-Agent: every Gemini 4 codename, bare or with a low, medium, high * or xhigh tier suffix. Observed on CCA: Argon was verified 2026-10-14, and on 2026-11-11 the CLI * discovery list was exactly the IDE list plus the Argon and Carbon tiers, with - * `gemini-4-carbon-medium` answering 404 under the IDE UA and 200 under the CLI UA. Anticipated, - * not observed: Hydrogen (low/medium/high/xhigh, verified on Vertex AI by #8583's author on - * 2026-11-13) has not been seen on CCA. Matching the generation keeps a newly discovered codename + * `gemini-4-carbon-medium` answering 404 under the IDE UA and 200 under the CLI UA. Hydrogen + * (low/medium/high/xhigh, verified on Vertex AI by #8583's author on 2026-11-13) was listed by CCA + * discovery on 2026-11-12, and `gemini-4-hydrogen-xhigh` answered 200 under the CLI UA. Matching the generation keeps a newly discovered codename * callable instead of listing it in the picker and 404ing every request. */ const ANTIGRAVITY_CLI_ONLY_WIRE_MODEL = /^gemini-4-[a-z][a-z0-9]*(?:-(?:low|medium|high|xhigh))?$/; diff --git a/src/providers/antigravity-models.ts b/src/providers/antigravity-models.ts index 7610a0f2ab6..a1fab4f9b24 100644 --- a/src/providers/antigravity-models.ts +++ b/src/providers/antigravity-models.ts @@ -295,8 +295,9 @@ function completeDiscoveredEffortWireModelIds( /** * Default rung for a model known only from live discovery. Gemini 4 Hydrogen defaults to high: * its low/medium/high/xhigh ladder and high default were verified on Vertex AI by #8583's author - * (2026-11-13). Hydrogen on CCA has not been live-verified, so this applies only once CCA - * discovery lists its family. Other discovered families keep medium when they have it. + * (2026-11-13). On CCA it is entitlement-gated: an account whose discovery listed the four + * `gemini-4-hydrogen-*` tiers answered an xhigh request with 200 (2026-11-12), so this applies only + * once that account's CCA discovery lists the family. Other discovered families keep medium when they have it. */ const ANTIGRAVITY_DISCOVERED_DEFAULT_EFFORT: Record = { "gemini-4-hydrogen": "high", @@ -345,8 +346,11 @@ function pickerToWireId(pickerId: string): string { return ANTIGRAVITY_PICKER_TO_WIRE[pickerId] ?? pickerId; } +/** Requested efforts above `high`: they select a discovered xhigh tier when one exists, else `high`. */ +const ANTIGRAVITY_ABOVE_HIGH_EFFORTS = new Set(["xhigh", "max", "ultra"]); + function resolveAntigravityThinkingLevel(effort: string): string | undefined { - if (effort === "xhigh" || effort === "max" || effort === "ultra") return "high"; + if (ANTIGRAVITY_ABOVE_HIGH_EFFORTS.has(effort)) return "high"; return ANTIGRAVITY_THINKING_LEVELS.has(effort) ? effort : undefined; } @@ -593,7 +597,7 @@ function discoveredAntigravityEffortWireModelId( const effortMap = discoveredAntigravityMapping(baseUrl)?.effortModels.get(modelId); if (!effortMap) return undefined; - const requestedEffort = effort === "xhigh" && effortMap.xhigh ? "xhigh" : effort ? resolveAntigravityThinkingLevel(effort) : undefined; + const requestedEffort = effort && ANTIGRAVITY_ABOVE_HIGH_EFFORTS.has(effort) && effortMap.xhigh ? "xhigh" : effort ? resolveAntigravityThinkingLevel(effort) : undefined; if (requestedEffort && isAntigravityDiscoveryEffort(requestedEffort) && effortMap[requestedEffort]) { return effortMap[requestedEffort]; } diff --git a/structure/providers-and-adapters.md b/structure/providers-and-adapters.md index 78fe7651261..dbb1d0dbae4 100644 --- a/structure/providers-and-adapters.md +++ b/structure/providers-and-adapters.md @@ -577,7 +577,7 @@ Preflight heartbeat retention keeps `replayUnsafe` sticky in the replayed tail, ## Antigravity effort families -Antigravity discovery in `src/providers/antigravity-models.ts` collapses complete low/medium/high wire families without a version allowlist. An optional discovered xhigh tier joins a complete family; partial families retain exact wire IDs. Hydrogen defaults to high, following Vertex evidence from 2026-11-13; its CCA availability and tier shape have not been live-verified. The adapter sends the selected suffix without a second thinking level, except Gemini 4 Argon: its wire ids already carry the tier, but CCA returns thought parts only when `thinkingLevel` is also named alongside `includeThoughts`, so the adapter repeats the selected tier only when summaries are requested, including for a lone discovered Argon tier (`tests/adapters/google/gemini-4-argon-antigravity.test.ts`, `tests/adapters/google/antigravity-discovered-families.test.ts`); summary-disabled requests and the web-search sidecar retain their suffix-only shape; `gemini-3.8-flash` keeps its one-field shape; saved suffix requests keep their tier. Existing Claude 4.6 single-wire thinking levels and Gemini irregular aliases keep their contracts. Grouped context is the minimum known across every tier; image support requires agreement, with an explicit negative taking precedence. Mappings are scoped to config home, normalized destination (including path case), and accepted cache generation. `src/providers/antigravity-wire-snapshot.ts` atomically saves bounded exact suffix maps before synthetic catalog rows are published. Hash-named files contain no destination URLs or credentials. First-use restoration after restart supplies routing aliases only; current live discovery replaces the snapshot, and invalidation tombstones prevent stale restoration. A failed snapshot write leaves the previous coherent discovery result. +Antigravity discovery in `src/providers/antigravity-models.ts` collapses complete low/medium/high wire families without a version allowlist. An optional discovered xhigh tier joins a complete family; partial families retain exact wire IDs. Hydrogen defaults to high, following Vertex evidence from 2026-11-13; on CCA an entitled account listed the four `-low/-medium/-high/-xhigh` tiers and answered an xhigh request with 200 on 2026-11-12. On a family with the xhigh tier, requested `xhigh`, `max` and `ultra` select it; three-tier families still clamp all three to `high` (`tests/adapters/google/gemini-4-hydrogen-antigravity.test.ts`). The adapter sends the selected suffix without a second thinking level, except Gemini 4 Argon: its wire ids already carry the tier, but CCA returns thought parts only when `thinkingLevel` is also named alongside `includeThoughts`, so the adapter repeats the selected tier only when summaries are requested, including for a lone discovered Argon tier (`tests/adapters/google/gemini-4-argon-antigravity.test.ts`, `tests/adapters/google/antigravity-discovered-families.test.ts`); summary-disabled requests and the web-search sidecar retain their suffix-only shape; `gemini-3.8-flash` keeps its one-field shape; saved suffix requests keep their tier. Existing Claude 4.6 single-wire thinking levels and Gemini irregular aliases keep their contracts. Grouped context is the minimum known across every tier; image support requires agreement, with an explicit negative taking precedence. Mappings are scoped to config home, normalized destination (including path case), and accepted cache generation. `src/providers/antigravity-wire-snapshot.ts` atomically saves bounded exact suffix maps before synthetic catalog rows are published. Hash-named files contain no destination URLs or credentials. First-use restoration after restart supplies routing aliases only; current live discovery replaces the snapshot, and invalidation tombstones prevent stale restoration. A failed snapshot write leaves the previous coherent discovery result. Antigravity catalog rows carry the observed complete effort map from `src/providers/antigravity-models.ts` through the in-memory cache. `src/providers/antigravity-effort-families.ts` uses that evidence to group public rows and project suffix allowlists into the base selection, including both final catalog merge callers. Internal retained suffix rows remain available to combo resolution. Authoritative new-model reconciliation normalizes both the prior baseline and policy input before detecting arrivals: an existing suffix family is not a new model. All-disabled tiers transfer a base disable once; a known base keeps the operator's later choice. Genuinely new families still follow new-model policy. Saved defaults, combo targets, suffix disables and provider selections remain unchanged. A discovered ladder advertises only its wire-backed efforts unless explicitly overridden; unknown single-wire models gain no invented ladder. From 458cd9d7313636178edaebaa65c8dc2fcbcc4633 Mon Sep 17 00:00:00 2001 From: lidge-jun <243035832+lidge-jun@users.noreply.github.com> Date: Fri, 13 Nov 2026 14:58:00 +0900 Subject: [PATCH 3/4] docs(es): mirror Hydrogen's CCA status and the max/ultra rule from the English guide --- docs-site/src/content/docs/es/guides/providers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs-site/src/content/docs/es/guides/providers.md b/docs-site/src/content/docs/es/guides/providers.md index 5df369eedbf..96bb71c933a 100644 --- a/docs-site/src/content/docs/es/guides/providers.md +++ b/docs-site/src/content/docs/es/guides/providers.md @@ -146,7 +146,7 @@ Cursor, Kiro, Zed Hosted AI y Nous Portal son solo de inicio de sesión y no tie La pestaña Cuentas Antigravity muestra un nivel de membresía observado como una insignia junto a la etiqueta de la cuenta, utilizando el ID de nivel ascendente (por ejemplo, `free-tier` o `gemini-pro`). No aparece ninguna insignia cuando el plan es desconocido; no afecta el enrutamiento ni la cuota. -Gemini 4 Argon (`gemini-4-argon`) aparece en el preajuste `google` con niveles de pensamiento bajos, medios (el predeterminado) y altos. Google lo ofrece solo en el nivel pagado Gemini API, no en el nivel gratuito. El `google-antigravity`, Argon aparece con los mismos tres niveles, que se asignan a los modelos del protocolo `gemini-4-argon-low`, `-medium` y `-high`. Google lo limita a las cuentas AI Ultra y Enterprise elegibles. Cloud Code Assist sirve Argon solo al cliente Antigravity CLI, por lo que OpenCodex envía todas las solicitudes de modelos Gemini 4 y el descubrimiento de modelos con el CLI User-Agent (`antigravity/cli/1.3.4` ) y mantiene el IDE User-Agent para cualquier otro modelo. Gemini 4 Hydrogen (low, medium, high por defecto y xhigh; verificado en Vertex AI el 2026-11-13, aún no visto en Antigravity) aparece en `google-antigravity` solo cuando la lista de modelos de tu cuenta lo incluye, y cada nivel se asigna a su modelo del protocolo `gemini-4-hydrogen-*`. +Gemini 4 Argon (`gemini-4-argon`) aparece en el preajuste `google` con niveles de pensamiento bajos, medios (el predeterminado) y altos. Google lo ofrece solo en el nivel pagado Gemini API, no en el nivel gratuito. El `google-antigravity`, Argon aparece con los mismos tres niveles, que se asignan a los modelos del protocolo `gemini-4-argon-low`, `-medium` y `-high`. Google lo limita a las cuentas AI Ultra y Enterprise elegibles. Cloud Code Assist sirve Argon solo al cliente Antigravity CLI, por lo que OpenCodex envía todas las solicitudes de modelos Gemini 4 y el descubrimiento de modelos con el CLI User-Agent (`antigravity/cli/1.3.4` ) y mantiene el IDE User-Agent para cualquier otro modelo. Gemini 4 Hydrogen (low, medium, high por defecto y xhigh) aparece en `google-antigravity` solo cuando la lista de modelos de tu cuenta lo incluye, y cada nivel se asigna a su modelo del protocolo `gemini-4-hydrogen-*`; solicitar `max` o `ultra` también selecciona xhigh. En Vertex AI, `gemini-4-argon`, `gemini-4-carbon` y `gemini-4-hydrogen` reciben las imágenes devueltas por herramientas, como capturas de pantalla, dentro de la respuesta de función correspondiente. El descubrimiento de modelos de Vertex AI, sus reglas de credenciales y este tratamiento se describen en [Google Vertex AI](/es/guides/google-vertex/). From 45fdd2a9743f531816e78bb26e4c340b74d279eb Mon Sep 17 00:00:00 2001 From: lidge-jun <243035832+lidge-jun@users.noreply.github.com> Date: Fri, 13 Nov 2026 15:00:34 +0900 Subject: [PATCH 4/4] test(antigravity): pin max/ultra xhigh routing through the adapter and a restored snapshot --- src/providers/antigravity-models.ts | 3 +- .../gemini-4-hydrogen-antigravity.test.ts | 38 ++++++++++++++++--- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/src/providers/antigravity-models.ts b/src/providers/antigravity-models.ts index a1fab4f9b24..f5917eefefc 100644 --- a/src/providers/antigravity-models.ts +++ b/src/providers/antigravity-models.ts @@ -859,7 +859,8 @@ export function resolveAntigravityEffortWireModel( if (effortMap) { const suffixTiered = ANTIGRAVITY_SUFFIX_TIER_MODELS.has(modelId); // Normalize FIRST for suffix-tiered models. The discovery path clamps max/xhigh/ultra to - // `high` before its own lookup, so a static path that skipped the clamp answered `medium` + // `high` for a family without a discovered xhigh tier (a family that has one selects it, see + // ANTIGRAVITY_ABOVE_HIGH_EFFORTS), so a static path that skipped the clamp answered `medium` // for the same request: one input, two tiers, decided by whether discovery happened to run. const requested = suffixTiered && effort ? resolveAntigravityThinkingLevel(effort) ?? effort diff --git a/tests/adapters/google/gemini-4-hydrogen-antigravity.test.ts b/tests/adapters/google/gemini-4-hydrogen-antigravity.test.ts index 94b6a6eafa7..aa5da9a4043 100644 --- a/tests/adapters/google/gemini-4-hydrogen-antigravity.test.ts +++ b/tests/adapters/google/gemini-4-hydrogen-antigravity.test.ts @@ -61,11 +61,39 @@ test("adapter sends the discovered Hydrogen tier", async () => { const rows = parseAntigravityAvailableModels({ models: Object.fromEntries(ids.map(id => [id, {}])), agentModelSorts: [{ groups: [{ modelIds: ids }] }] })!; const baseUrl = "https://hydrogen-adapter.example.test"; registerAntigravityDiscoveredWireModels(baseUrl, rows); - const adapter = withTestTranslatorBudget(createGoogleAdapter({ adapter: "google", baseUrl, googleMode: "cloud-code-assist", project: "fixture", apiKey: "fixture" })); - for (const [effort, wire] of [["xhigh", ids[3]], [undefined, ids[2]]] as const) { - const request = await adapter.buildRequest({ modelId: "gemini-4-hydrogen", stream: false, context: { messages: [{ role: "user", content: "hello" }], systemPrompt: [], tools: [] }, options: effort ? { reasoning: effort } : {} } as OcxParsedRequest); - expect(JSON.parse(request.body).model).toBe(wire); - expect(request.headers["User-Agent"]).toBe(ANTIGRAVITY_CLI_REQUEST_UA); + // Without a configured ladder, and with the ladder the discovered catalog row publishes. + for (const ladder of [undefined, { "gemini-4-hydrogen": ["low", "medium", "high", "xhigh"] }]) { + const adapter = withTestTranslatorBudget(createGoogleAdapter({ adapter: "google", baseUrl, googleMode: "cloud-code-assist", project: "fixture", apiKey: "fixture", + ...(ladder ? { modelReasoningEfforts: ladder } : {}) })); + for (const [effort, wire] of [["xhigh", ids[3]], ["max", ids[3]], ["ultra", ids[3]], ["high", ids[2]], [undefined, ids[2]]] as const) { + const request = await adapter.buildRequest({ modelId: "gemini-4-hydrogen", stream: false, context: { messages: [{ role: "user", content: "hello" }], systemPrompt: [], tools: [] }, options: effort ? { reasoning: effort } : {} } as OcxParsedRequest); + expect({ ladder: !!ladder, effort, model: JSON.parse(request.body).model }).toEqual({ ladder: !!ladder, effort, model: wire }); + expect(request.headers["User-Agent"]).toBe(ANTIGRAVITY_CLI_REQUEST_UA); + } + } +}); + +test("a family restored from the persisted snapshot routes max and ultra to xhigh", () => { + const previousHome = process.env.OPENCODEX_HOME; + const home = mkdtempSync(join(tmpdir(), "ocx-hydrogen-restore-")); + process.env.OPENCODEX_HOME = home; + const dest = "https://hydrogen-restore.example.test"; + const tiers = { low: "gemini-4-hydrogen-low", medium: "gemini-4-hydrogen-medium", high: "gemini-4-hydrogen-high" }; + try { + writeAntigravityWireSnapshot(dest, { version: 1, provider: "google-antigravity", families: { "gemini-4-hydrogen": { ...tiers, xhigh: "gemini-4-hydrogen-xhigh" } } }); + for (const effort of ["xhigh", "max", "ultra"]) { + expect(resolveAntigravityEffortWireModel("gemini-4-hydrogen", effort, dest).wireModelId).toBe("gemini-4-hydrogen-xhigh"); + } + expect(resolveAntigravityEffortWireModel("gemini-4-hydrogen", undefined, dest).wireModelId).toBe("gemini-4-hydrogen-high"); + const threeTier = "https://argon-restore.example.test"; + writeAntigravityWireSnapshot(threeTier, { version: 1, provider: "google-antigravity", families: { "gemini-4-carbon": { + low: "gemini-4-carbon-low", medium: "gemini-4-carbon-medium", high: "gemini-4-carbon-high" } } }); + for (const effort of ["xhigh", "max", "ultra"]) { + expect(resolveAntigravityEffortWireModel("gemini-4-carbon", effort, threeTier).wireModelId).toBe("gemini-4-carbon-high"); + } + } finally { + if (previousHome === undefined) delete process.env.OPENCODEX_HOME; else process.env.OPENCODEX_HOME = previousHome; + removeTreeWithRetry(home); } });