Skip to content

feat(model-gateway): add experimental native Antigravity support - #644

Draft
chris7iu wants to merge 2 commits into
Eigenwise:developfrom
chris7iu:feat/model-gateway-antigravity-20261024
Draft

chris7iu wants to merge 2 commits into
Eigenwise:developfrom
chris7iu:feat/model-gateway-antigravity-20261024

Conversation

@chris7iu

@chris7iu chris7iu commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add opt-in gateway routing for the experimental native Antigravity provider in claude-code-proxy. Native implementation remains separate: raine/claude-code-proxy#185 . This frontend neither imports account credentials nor implements another Google authentication client.

  • Advertise capability-backed native aliases and route them without Codex/Anthropic fallback or automatic generation resend.
  • Preserve opaque thinking/signature carriers and complete tool replay; rewrite model identity without rewriting opaque content.
  • Bound SSE framing, terminal/EOF handling, cancellation and downstream flushes.
  • Add explicit native onboarding/status and strict manual-login forwarding, matching native configuration precedence and readiness semantics.
  • Keep the provider experimental/default-off, with an explicitly unmeasured 200,000-token advertisement derived from MODEL_WINDOW_POLICY, fixed model/tier/profile sessions and no [1m] promise.
  • Preserve current upstream lifecycle, ownership and missing-CWD protections; help, skill, README and getting-started guidance move with the feature.

Current head 11810be86 is rebased onto develop (7350b1919, including merged #820) and stacked on standalone startup-catalog/fixture-isolation PR #827 (f7dc66d57) so default-off /v1/models is byte-identical to develop (2dfdd7f47 / SQ-4102) and #827's test-only files drop out of this diff once #827 merges.

Local verification

  • Canonical strict V8 preload capture across all changed/added JS files: 972 functions measured, all with CRAP below 6 and maximum cyclomatic complexity ≤ 5, zero untaken branches, zero UNVERIFIED rows, zero scope failures.
  • Docs: docs/scripts/content.test.mjs 8/8 passed; generated reference files were not hand-edited.
  • Targeted controls cover default-off startup parity, portable Windows path resolution, bounded headers/body cancellation, and isolated fixture teardown diagnostics (via #827).

Strict local measurement uses the read-only Quality Gate V8 capture binding (plugins/quality-gate/lib/core.mjs). No Quality Gate source, dependency, threshold, exclusion or CI-policy change is bundled here.

Windows follow-up and acceptance boundaries

Earlier hosted Windows runs exposed two test assumptions: configuration expectations used the process drive instead of the injected cwd, and startup-policy assertions took a snapshot before the first authoritative catalog refresh. The standalone startup fallback catalog test and fixture-home isolation/teardown diagnostics have been split out into #827 .

Prior acceptance verification on the feature implementation:

  • Generic SSE/tool/carrier replay and an actual fresh Claude CLI 2.1.270 against the mock backend passed: 22 all-hop HTTP requests, five frontend message posts, three mock generations, zero Google calls, zero fallback; owned children/container exited and were removed.
  • One generic live request through the owned standalone gateway and the owned daily native proxy passed: HTTP 200, exact synthetic GATEWAY_NATIVE_OK, end_turn, 50 input / 10 output tokens, zero tool calls and zero fallback. No inference retry or second generation phase was used.
  • Both exact owned containers exited zero after graceful shutdown and were independently verified absent. No account credential contents were read by host inspection tools.

The live phase is closed and cannot be resumed. This proves the narrow text route, not all tiers/media, measured large context, or live Claude-CLI tool execution. Actual native-provider SSE/tool continuation proof remains separate from the frontend's synthetic client replay.

Release reference

This external contribution uses .release/unreleased/GH-644.md (bump: minor, plugins: [model-gateway]); the development release guard passes without findings. No manifest version, tag or changelog was hand-edited.

Tests use isolated synthetic homes/ports and public-only inputs. No existing serving stack, account credential store or user settings were replaced/reconfigured. No deployment, upstream approval or merge is implied.

chris7iu added a commit to chris7iu/eigenwise-toolshed that referenced this pull request Oct 24, 2026
Co-Authored-By: Claude Code <noreply@anthropic.com>
chris7iu added a commit to chris7iu/eigenwise-toolshed that referenced this pull request Oct 24, 2026
Co-Authored-By: Claude Code <noreply@anthropic.com>

@Eigenwise Eigenwise left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Routed review of head 1af503c merged onto develop 3ead47a. Requesting changes on one point; the rest checks out.

  1. Default-off state is not byte-identical. With no Antigravity configuration and all proxy model probes pending, develop's startup /v1/models returns five null rows; this branch returns five populated Codex rows. Root: request-worker.js:1145, the initial modelCache changed .map(gatewayModel) to .map((id) => gatewayModel(id)). That's a real fix of an existing startup bug, and I want it, but it ships inside a 6,300-line opt-in feature while SKILL.md says "Legacy Codex/Grok behavior is unchanged". Please split that one-line fix into its own small PR (with its own test and fragment) and drop or qualify the "unchanged" sentence here.

What passed: 893 tests / 882 pass / 11 platform skips in an isolated home; the five pre-existing modified test files also pass on develop. Opaque thinking/signature carriers and tool replay stay byte-exact on the two-hop path; reserved selectors, [1m] and OpenAI paths fail locally before any generation or fallback. The new supervisor spawns, kills and listens on nothing and writes no settings; the new process sites (archive extraction, --version, native auth status, explicit login/logout) are bounded; incoming auth/cookie/control headers are stripped by the relay allowlist; no control-token printing. All 1,189 changed bodies measured, every new or raised one CC ≤ 5; CRAP coverage is UNVERIFIED on our side because the capture binding wasn't taken, which is our debt, not yours.

Two smaller notes, not blocking: commands.catalogContextWindow hard-codes 200000 next to the policy table that already carries it (derive it instead), and the relay/discovery, onboarding and test-infrastructure parts would review faster as separate PRs.

Whether model-gateway should carry a native Gemini provider at all is a maintainer decision I'll take to Kenny separately; this review is only the technical side.

@Eigenwise

Copy link
Copy Markdown
Owner

Direction call from Kenny (2026-11-09): yes, model-gateway will carry a native Antigravity provider, as an experimental, default-off backend. So this is wanted, and the open point is still the one from the October review: please split the one-line startup fix in request-worker.js (the .map(gatewayModel) to .map((id) => gatewayModel(id)) change) into its own small PR with its own test and fragment, and either drop or qualify the "Legacy Codex/Grok behavior is unchanged" sentence in SKILL.md. The two non-blocking notes (derive catalogContextWindow from the policy table, and split relay/discovery, onboarding and test infrastructure into separate PRs if you can) still stand and would make the review a lot quicker. Once the split PR is up I'll merge it first and then re-review this one against develop.

…eardown tests

Trim support.test.js to product-exercising fixture shutdown and diagnostic cases, drop scaffolding-only owned-teardown-tree.js and readRecordedGatewayPid seam/export, register testContext cleanup on live-child tests, bound the held worker /v1/models probe window explicitly, and drop commit: from EigenwiseGH-827.
Rebase onto current develop (stacked on EigenwiseGH-827), derive Antigravity catalogContextWindow from MODEL_WINDOW_POLICY via gatewayAdvertisedWindow, and drop PR narration from SKILL.md and docs.
@chris7iu
chris7iu force-pushed the feat/model-gateway-antigravity-20261024 branch from c8079cd to 11810be Compare November 12, 2026 14:51
@chris7iu

Copy link
Copy Markdown
Contributor Author

Addressed in 11810be86 (rebased onto current develop 7350b1919 and stacked on #827):

  1. Default-off /v1/models parity & standalone test split (test(model-gateway): add held-probe startup catalog and fixture teardown proofs #827):
  2. Smaller notes:
    • Derived catalogContextWindow in plugins/model-gateway/lib/commands.js from MODEL_WINDOW_POLICY via gatewayAdvertisedWindow(id) instead of hard-coding 200000.
    • Dropped the branch-only commit: line from .release/unreleased/GH-644.md.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants