fix(antigravity): send complete loadCodeAssist metadata (ideType/platform/pluginType as numeric enums) - #11969
Merged
diegosouzapw merged 1 commit intoAug 30, 2026
Conversation
…form/pluginType as numeric enums)
loadCodeAssist and onboardUser both returned 403 for every account on a
live deployment, even accounts with completed Gemini Code Assist
onboarding. Traced via live log comparison (same Google account, same
host) against the sibling 9router project, which succeeds against the
identical account: OmniRoute's getAntigravityLoadCodeAssistMetadata()
sent `{ ideType: "ANTIGRAVITY" }` — ideType as a bare string, with
platform and pluginType omitted entirely. 9router sends
`{ ideType: 9, platform: <os/arch enum>, pluginType: 2 }` — the field is
a protobuf-JSON int32 enum on the wire, not a string, and the API
apparently treats an incomplete/malformed identity as untrusted and
rejects it outright rather than degrading gracefully.
Fix: mirror 9router's LOAD_CODE_ASSIST_METADATA enum values and
platform-detection logic (darwin/linux/win32 x64/arm64) exactly.
A prior version of this function carried the opposite claim in a
comment ("Matches Antigravity-Manager quota.rs: only ideType — no
platform, LINUX is rejected"). That may have been true when written;
it directly contradicts today's live comparison, where the full-enum
shape (including a Linux platform value) succeeded from a Linux host.
Left a note pointing at this history in case it resurfaces.
Updated tests/unit/antigravity-headers.test.ts's metadata-shape
assertion accordingly — it previously asserted the broken string-only
shape as correct.
Validation
- New/updated unit test in tests/unit/antigravity-headers.test.ts
(6/6 passing) plus 54 usage-service + 25 oauth-provider tests whose
assertions already compare against this function's own output —
all passing.
- npx tsc --noEmit -p tsconfig.typecheck-core.json: 0 errors.
Note: in the specific deployment where this was found, the actual
403 root cause turned out to be a separate issue (a custom
ANTIGRAVITY_OAUTH_CLIENT_ID override pointing at a GCP project without
the private Cloud Code API enabled) — this metadata fix did not
resolve that deployment's error on its own, since Google's error
surfaces before the metadata shape would matter for a client-identity
rejection. It's included here because it's a real, independently
verified correctness bug (9router's identical live-working shape vs.
OmniRoute's incomplete one) that could still cause failures for
accounts using OmniRoute's default embedded OAuth client.
diegosouzapw
merged commit Aug 30, 2026
56dddfc
into
diegosouzapw:release/v3.8.51
14 of 15 checks passed
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…form/pluginType as numeric enums) (diegosouzapw#11969) Envia metadata completo do loadCodeAssist (ideType/platform/pluginType como enums numéricos) para o Antigravity, com teste de regressão atualizado. Validado no worktree combinado. Obrigado!
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
loadCodeAssistandonboardUserboth returned 403 for every account on a livedeployment, even accounts that had completed Gemini Code Assist onboarding.
Root cause
Traced via a live log side-by-side (same Google account, same host) against the
sibling 9router project, which succeeds against the identical account:
getAntigravityLoadCodeAssistMetadata()sent{ ideType: "ANTIGRAVITY" }:ideTypeas a bare string,platformandpluginTypeomitted entirely.{ ideType: 9, platform: <os/arch enum>, pluginType: 2 }.The
metadatabody on this endpoint is protobuf-JSON-shaped:ideType/pluginTypeare int32 enums on the wire, not strings, and
platformis expected. Anincomplete/malformed client identity reads to Google's backend as untrusted and
gets rejected outright rather than degrading gracefully.
Fix
Mirror 9router's
LOAD_CODE_ASSIST_METADATAenum values and platform-detectionlogic (darwin/linux/win32 × x64/arm64) exactly:
A prior version of this function carried the opposite claim in a comment
("Matches Antigravity-Manager quota.rs: only ideType — no platform, LINUX is
rejected"). That may have been true when it was written; it directly
contradicts today's live comparison, where the full-enum shape (including a
Linux platform value) succeeded from a Linux host. Left a note pointing at
this history in the code in case it resurfaces — worth a second look if
anyone reports a regression specifically tied to Linux hosts.
Honest caveat
In the specific deployment where this was found, the actual 403 root cause
for that operator turned out to be unrelated: a custom
ANTIGRAVITY_OAUTH_CLIENT_IDoverride pointing at a GCP project without theprivate Cloud Code API enabled (Google's OAuth-client-identity check fails
before the request body/metadata shape would ever matter). This metadata fix
did not resolve that particular deployment's error on its own. It's
included here anyway because it's a real, independently verified correctness
bug — confirmed by a byte-for-byte comparison against 9router's identical,
live-working request shape — that could still cause failures for any account
using OmniRoute's default embedded OAuth client (not a custom override).
Validation
tests/unit/antigravity-headers.test.ts's metadata-shape assertion(previously asserted the broken string-only shape as correct) — 6/6 passing.
live output against this function — all still passing (no hardcoded
duplicate of the old shape anywhere else).
npx tsc --noEmit -p tsconfig.typecheck-core.json: 0 errors.I could not re-validate this specific fix against a live Google account
myself (no credentials here) — the live comparison that surfaced the bug was
done via the operator's production deployment logs, documented above.