Skip to content

feat(antigravity): route Gemini 4 Hydrogen's discovered xhigh tier through the CLI User-Agent - #8636

Merged
lidge-jun merged 3 commits into
devfrom
codex/antigravity-hydrogen-cli
Nov 13, 2026
Merged

lidge-jun merged 3 commits into
devfrom
codex/antigravity-hydrogen-cli

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

Gemini 4 Hydrogen has a fourth reasoning tier, xhigh. If Cloud Code Assist (Antigravity) lists gemini-4-hydrogen-{low,medium,high,xhigh}, OpenCodex today publishes gemini-4-hydrogen-xhigh as its own picker row. That row also misses the Gemini 4 CLI User-Agent rule (/^gemini-4-<codename>(-low|-medium|-high)?$/ from #8483), so the request goes out with the IDE User-Agent. CCA answers 404 to Gemini 4 models on that User-Agent (observed for Argon and Carbon).

After this change:

  • The Gemini 4 CLI User-Agent rule accepts the -xhigh suffix. Argon and Carbon keep the CLI UA, and near misses (-max, -xxhigh, -tiered) keep the IDE UA.
  • antigravityEffortFamilyIds includes the validated xhigh tier, so an xhigh-only saved selection projects to the collapsed base, the retained -xhigh row is hidden, and disabled-tier inheritance counts xhigh.
  • A complete discovered low/medium/high family that also lists <base>-xhigh collapses into one picker row with efforts [low, medium, high, xhigh]. Routing sends xhigh to the -xhigh wire id. A three-tier family (Argon, Carbon) still clamps xhigh to -high, and a lone -xhigh invents no ladder.
  • The persisted wire snapshot carries an optional, validated xhigh entry and still reads older snapshots.
  • A discovered gemini-4-hydrogen family defaults to high, in both the catalog row and wire resolution without an effort.

Evidence: Hydrogen's low/medium/high/xhigh ladder and its high default were verified live on Vertex AI by the author of #8583 (2026-11-13). Hydrogen has not been seen on CCA yet (the local CCA wire snapshot from 2026-11-11 lists only the Argon family). Hydrogen therefore stays out of the static Antigravity picker, like Carbon, and appears only when an account's CCA discovery lists it. Places where only Argon is registered (static picker, Argon quota group, Argon prices) are left unchanged. Code comments, the structure doc and the providers guide state this.

Verification

  • Failing first: tests/adapters/google/gemini-4-hydrogen-antigravity.test.ts against the origin/dev versions of the changed source files: 6 fail, 1 pass (the unchanged three-tier clamp case). The xhigh family-projection case (selection, public collapse, disabled inheritance) fails without the antigravity-effort-families.ts change. With the change: 8 pass, 0 fail.
  • bun run typecheck: no type errors.
  • One bun test process per file, all 0 fail: gemini-4-hydrogen-antigravity (8), provider-antigravity-effort-families (19), gemini-4-argon-antigravity (19), antigravity-discovered-families (11), google-antigravity-wire (62), antigravity-account-roster (14), antigravity-routing-carry (28), google-antigravity-replay (71), gemini-37-flash-migration (45), google-wire-shape (35), gemini-web-search (16), gemini-progress-history (8), google-models-listing (14), google-vertex-thought-signature (38), provider-antigravity-wire-snapshot (6), provider-antigravity-family-catalog (3), routing-capability-catalog (10), usage-antigravity-55 (5), model-rename-migration (56), server-images (82).
  • tests/ci-workflows/file-size-ratchet.test.ts (9 pass; guides/providers.md is at 1,999 lines), tests/test-layout.test.ts, tests/test-layout-tooling.test.ts, tests/ci-workflows/structure-ssot.test.ts: pass.
  • bun run structure:check, bun run privacy:scan: pass.
  • NOT RUN: the full bun run test suite locally. The host was shared with a concurrent full run, so this change is left to the CI test changed job. No live CCA request was made (no account here lists Hydrogen).

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Related: #8583 (Vertex Hydrogen registration), #8483 (Carbon CLI User-Agent).

Summary by CodeRabbit

  • New Features
    • Gemini 4 Antigravity models now support discovery and routing for the extra-high reasoning tier when available, including model-family and snapshot compatibility.
  • Improvements
    • Gemini 4 Hydrogen requests and model discovery now use the Antigravity CLI identity.
    • Discovered models use more appropriate default reasoning levels: Hydrogen defaults to high, while other models default to medium when available or high otherwise.

@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner November 13, 2026 03:28
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T03:31:05.161217Z e728583 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the enhancement New feature or request label Nov 13, 2026
@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Antigravity discovery and routing now support Gemini 4 Hydrogen and optional xhigh effort tiers. Hydrogen defaults to high. Gemini 4 model requests and discovery use the CLI User-Agent. Snapshot validation supports an optional xhigh wire ID.

Changes: Gemini 4 Hydrogen on Antigravity

Layer / File(s) Summary
Gemini 4 wire IDs and CLI User-Agent
src/adapters/google-antigravity-wire.ts, src/adapters/client-fingerprint.ts, tests/adapters/google/gemini-4-hydrogen-antigravity.test.ts, docs-site/src/content/docs/guides/providers.md, structure/providers-and-adapters.md
The Gemini 4 wire matcher accepts xhigh suffixes. Gemini 4 model requests and discovery use the CLI User-Agent. Tests cover matching behavior, User-Agent selection, and near-miss IDs.
Discovered effort tiers and defaults
src/providers/antigravity-effort-families.ts, src/providers/antigravity-models.ts, src/codex/catalog/provider-models.ts, tests/adapters/google/gemini-4-hydrogen-antigravity.test.ts, scripts/test-layout/layout.json, tests/fixtures/test-layout-expected.json, structure/providers-and-adapters.md
Discovery retains and routes available xhigh tiers. Hydrogen defaults to high; other discovered families use medium when available, otherwise high. Catalog and adapter tests cover discovered models and request construction.
Persisted xhigh suffix snapshots
src/providers/antigravity-wire-snapshot.ts, src/providers/antigravity-models.ts, tests/adapters/google/gemini-4-hydrogen-antigravity.test.ts
Snapshots accept an optional xhigh wire ID when it matches the base model and passes model-ID validation. Tests cover snapshots with and without that tier.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant AccountModelList
  participant AntigravityDiscovery
  participant ProviderModelCatalog
  participant GoogleAntigravityAdapter
  participant GoogleAntigravityWireMatcher
  participant Request
  AccountModelList->>AntigravityDiscovery: Provide discovered model IDs and effort tiers
  AntigravityDiscovery->>ProviderModelCatalog: Provide model family and default effort
  GoogleAntigravityAdapter->>AntigravityDiscovery: Resolve requested effort
  AntigravityDiscovery-->>GoogleAntigravityAdapter: Return selected wire model ID
  GoogleAntigravityAdapter->>GoogleAntigravityWireMatcher: Match model ID
  GoogleAntigravityWireMatcher-->>GoogleAntigravityAdapter: Return CLI User-Agent selection
  GoogleAntigravityAdapter->>Request: Set wire model ID and User-Agent
Loading

Possibly related PRs

  • lidge-jun/opencodex#8483: It updates the same Gemini 4 CLI User-Agent selector rule for bare IDs and the low, medium, and high suffixes.

Suggested reviewers: dbc-hbin

Merge Risk: Minimal · up to 16dfb

This change adds optional xhigh effort support for discovered Gemini 4 models and sets Hydrogen's default effort to high. Older snapshots and three-tier families keep working as before. No actionable merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: routing the discovered Gemini 4 Hydrogen xhigh tier through the CLI User-Agent. The raw summary and objectives confirm this. The changeset also adds family collapsing,…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names the main change: routing the discovered Gemini 4 Hydrogen xhigh tier through the CLI User-Agent. The raw summary and objectives confirm this. The changeset also adds family collapsing, snapshot validation, and a high default for Hydrogen. The title covers the primary change without listing every detail. It is 93 characters, which is at the upper end of a concise title but still readable.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between e728583 and 16dfb20.

Files selected for processing: 4

  • src/adapters/client-fingerprint.ts
  • src/adapters/google-antigravity-wire.ts
  • src/providers/antigravity-effort-families.ts
  • tests/adapters/google/gemini-4-hydrogen-antigravity.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e728583992

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if (!available.has(wireId)) return undefined;
suffixEffortMap[effort] = wireId;
}
if (available.has(`${pickerId}-xhigh`)) suffixEffortMap.xhigh = `${pickerId}-xhigh`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include xhigh in the downstream effort-family projections

When a user has saved gemini-4-hydrogen-xhigh in selectedModels (for example, while discovery exposed an incomplete family), discovering the complete ladder now collapses that row into gemini-4-hydrogen, but antigravityEffortFamilyIds() in src/providers/antigravity-effort-families.ts still enumerates only low/medium/high. Consequently, projectAntigravitySelectedModels() does not admit the base selection, and filterCatalogVisibleModels() filters out the newly collapsed model. If the old suffix row is retained, the public-collapse helper also fails to hide it. Extend the shared family enumeration to include an exact, discovered xhigh mapping so saved selections and public catalog collapse remain consistent with the parser.

Useful? React with 👍 / 👎.

…te Hydrogen's CCA evidence as unverified

Review follow-up for #8636:
- antigravityEffortFamilyIds now includes a validated optional xhigh tier, so an xhigh-only
  selection projects to the collapsed base, the retained -xhigh row is hidden, and disabled-tier
  inheritance counts xhigh.
- The CLI User-Agent comments keep the observed Argon/Carbon evidence and describe Hydrogen's
  match as anticipated, not observed on CCA.
@lidge-jun

Copy link
Copy Markdown
Owner Author

Maintainer judgment

Merging at head 16dfb2023d8eab926cb65f402fc34f1a4d04ab80.

  • Why: Once CCA lists Gemini 4 Hydrogen's xhigh tier, gemini-4-hydrogen-xhigh would go out with the IDE User-Agent and get a 404, just as Argon and Carbon do on that UA. This PR extends the existing Gemini 4 CLI rule (fix(antigravity): send Gemini 4 Carbon requests with the CLI User-Agent #8483) by one suffix and folds that tier into the discovered family.
  • Evidence and scope: Hydrogen's ladder (low/medium/high/xhigh, default high) comes from the feat(google-vertex): support live Publisher Models discovery, gemini-4-carbon, and gemini-4-hydrogen #8583 author's live Vertex AI check on 2026-11-13. Hydrogen has not been seen on CCA, so it is not added to the static picker, quota group or prices; it appears only when an account's discovery lists it. Code comments and docs say so.
  • Reviews on this exact head: an independent review (gpt-6.1-terra) and a separate security review of accounts, client identity, snapshot and disclosure (gpt-6.1-terra) both returned APPROVE. Two earlier review findings were fixed before this head: xhigh was missing from family projection, and a comment overstated the CCA evidence.
  • Verification: failing-first confirmed (6 of 7 fail on dev sources; the projection case fails without its fix). Typecheck, structure and privacy checks pass, and the 20 related test files listed in the description pass one process each.
  • CI: the docs build, structure gate, docker smoke, npm-global, storage policy, API usage, catalog async contracts and CodeRabbit are green on this head. The four test shards and gates are still queued on the runner; per the maintainer instruction, the merge does not wait for queued jobs. No job has failed.
  • Merge path: squash with --match-head-commit. The dev ruleset requires one approval and nothing else; --admin is used only for that approval requirement.

@lidge-jun
lidge-jun merged commit 7ae8f07 into dev Nov 13, 2026
36 of 37 checks passed
@lidge-jun
lidge-jun deleted the codex/antigravity-hydrogen-cli branch November 13, 2026 03:46
lidge-jun added a commit that referenced this pull request Nov 13, 2026
#8639)

Mirror the Gemini 4 Hydrogen Antigravity sentence from #8636 in the Spanish providers guide, restoring tests/ci-workflows/docs-spanish-localization.test.ts on dev.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant