Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs-site/src/content/docs/es/guides/providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).

Expand Down
3 changes: 1 addition & 2 deletions docs-site/src/content/docs/guides/providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).
Expand Down
6 changes: 3 additions & 3 deletions src/adapters/google-antigravity-wire.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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))?$/;
Expand Down
15 changes: 10 additions & 5 deletions src/providers/antigravity-models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string> = {
"gemini-4-hydrogen": "high",
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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];
}
Expand Down Expand Up @@ -855,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
Expand Down
2 changes: 1 addition & 1 deletion structure/providers-and-adapters.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
49 changes: 41 additions & 8 deletions tests/adapters/google/gemini-4-hydrogen-antigravity.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@ 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 }] }] })!;
expect(rows.map(row => row.id)).toEqual(["gemini-4-hydrogen"]);
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]!);
});
Expand All @@ -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`);
}
}
});

Expand All @@ -56,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);
}
});

Expand Down
Loading