Repository navigation
Conversation
Add explicit OAuth/profile storage, cancellation-safe token refresh, bounded native transport and lossless fixed-session replay/schema adaptation. Keep disabled discovery baseline-compatible, expose read-only capabilities, and provide local count estimates with documented limitations. Validated offline under umask 022 with formatting, Clippy, build, 1206 Rust tests and 83 Python fixture/launcher tests. Native Google acceptance remains unverified; no live provider or service activation is included. Co-Authored-By: Claude Code <noreply@anthropic.com>
Default all outbound requests to claude-code-proxy/<version>. Apply a validated provider-specific full User-Agent only to generation and project discovery, preserving proxy identity for OAuth and exact override bytes. Keep the independently validated OS-string override outside legacy UTF-8 environment snapshots, with redacted failures and unchanged provider-scoped invalid configuration behavior. Tests-first regressions, independent review, fmt, Clippy, build and 1222 isolated tests pass under umask 022. No live activation. Co-Authored-By: Claude Code <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add an experimental, opt-in, default-off native Antigravity provider for Anthropic Messages and local
count_tokens. This is not anagysubprocess wrapper: agent-executed tools cannot serve as faithful external Messages tool turns.Supported exact selectors:
antigravity/gemini-4-argon-lowantigravity/gemini-4-argon-mediumantigravity/gemini-4-argon-highEnablement is explicit (
CCP_ANTIGRAVITY_ENABLED=1orantigravity.enabledconfiguration). Default-disabled model discovery remains unchanged. This draft requests code/protocol review; live Google authentication, entitlement and native-generation acceptance have not been verified by this contribution.Provider and session contract
args; caller input is{}, while native replay retains the original omission. Unsupported incremental arguments, media/server tools, forced-tool semantics and ambiguous repeated same-name ID-less parallel calls remain rejected.[1m]alias or verified native 1M claim. Model tier governs native thinking; generic effort hints cannot switch tiers.Replay boundary
The versioned
ccp:antigravity:v1:envelope retains raw native contents/signatures, stable session identity, caller/native tool mapping and codec information. Omitted/full visible thinking has the same reconstructed semantic history and local token estimate.Its digest is consistency checking, not authentication. It does not authenticate every opaque native signature byte. A mutation confined to opaque signature material may pass local consistency and be rejected by the upstream after one attempt; the provider does not repair signatures, retry inference or log the carrier.
Authentication, cancellation and privacy
Explicit User-Agent compatibility override
The default HTTP User-Agent is exactly
claude-code-proxy/<package version>.CCP_ANTIGRAVITY_USER_AGENT, thenantigravity.userAgent, can supply a full verbatim override for generation andloadCodeAssistonly. OAuth code exchange and refresh retain the proxy default; genericCCP_USER_AGENTand incoming client headers do not select this override.The documented optional agy1.3.5 example comes from pinned public protocol evidence. It is not auto-detected, automatically enabled, or a claim to match the installed/current agy1.4.2 client. No version/changelist/platform fields are synthesized or rewritten in an explicit override.
Validation rejects empty/outer-whitespace, control/non-ASCII, overlong and non-Unicode values before native requests; headers are marked sensitive and errors/status omit raw values. Tests assert exactly one UA across native and OAuth operations, default/override precedence, hostile incoming-header isolation and unchanged no-retry/no-redirect behavior.
A focused regression exposed existing full-environment UTF-8 snapshots panicking before native validation. The follow-up excludes only this independently OS-string-validated key from legacy snapshot iteration, preserving other valid entries/order/collection behavior. Invalid native configuration remains provider-scoped; unrelated non-Unicode entries still fail, now with fixed redacted panic text. Linux CLI and injected Windows ASCII-name comparisons are tested; no Windows runtime claim is made.
Read-only capability contract
GET /v1/models?include_capabilities=trueadds a versioned native-provider capability descriptor. Plain/v1/modelsremains baseline-compatible when disabled.antigravity auth status --jsonexposes the same safe local descriptor; exit 0 means a report was emitted, not that the provider is ready.Capability/status reads do not refresh credentials, look up projects, run inference or create directories. Serving metadata comes from the serving provider instance. Local configuration readiness is not proof of Google access.
Validation
All checks used disposable offline, non-root containers with private process/network namespaces, isolated homes/configuration and synthetic endpoints. No live gateway, credentials or host auth sockets were mounted.
-D warnings, build and 1,222 Rust tests passed. Credential/evidence/cache roots remained private, and source hashes were unchanged during the run.anyOfsiblings), credential mode handling, cancellation-independent refresh persistence, failed-write recovery, profile/epoch/logout races, effective-target raw-byte validation, assistant-fragment boundaries, parameterless-call replay and display-independent estimates.An independent read-only review's concrete findings were reproduced and fixed; a second pass found and verified the additional typeless-
anyOfguidance correction. Runtime acceptance remains a separate gate despite the passing local suite.Protocol provenance and limitations
Implementation is based on pinned public MIT-licensed protocol evidence from
cortexkit/antigravity-authatf5a836df058a99cee6099ad308b9675e4ef11026, with provenance/licensing recorded in the contribution. Reference observations for the low tier are distinct from catalog-inferred medium/high encodings; none establish this user's entitlement or an official service guarantee.No device identity/attestation copying, missing-signature sentinel, signature stripping, borrowed account/project identity or provider fallback is added. The optional User-Agent override is explicit compatibility metadata, not proof of official-client identity or entitlement. No binary/version installation or production activation is part of this PR. The dependent model-gateway frontend contribution is separate and must validate this native capability contract rather than assume a release already contains it.
🤖 Generated with Claude Code