Skip to content

fix(antigravity): preserve protocol fidelity and fail closed - #8098

Closed
nguyenha935 wants to merge 3 commits into
cheaper-inference:release/v3.8.49from
nguyenha935:fix/antigravity-protocol-fidelity
Closed

nguyenha935 wants to merge 3 commits into
cheaper-inference:release/v3.8.49from
nguyenha935:fix/antigravity-protocol-fidelity

Conversation

@nguyenha935

@nguyenha935 nguyenha935 commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • preserve caller text and tool names byte-for-byte on the Antigravity wire instead of adding zero-width mutations, renamed tools, or decoy declarations
  • make Google One AI credits behavior explicit and fail closed across off, one-shot retry, and credit-first always modes
  • separate live runtime endpoints from discovery/bootstrap endpoints, exclude sandbox from runtime fallback, and make project bootstrap token-safe, coalesced, and abort-aware
  • keep response-side tool-name restoration local and non-enumerable so _toolNameMap never leaks into serialized upstream requests

Root cause and impact

The previous path mixed request compatibility with prompt/tool mutation, reused discovery/bootstrap surfaces as runtime fallbacks, and allowed some abort/credits state to affect later requests. That could change caller semantics, send internal metadata upstream, repeat project bootstrap work, or disable credits after a client-side cancellation.

This change keeps compatibility at the protocol/header/endpoint layer while preserving user content, making paid-credit behavior explicit, and ensuring client aborts do not count as upstream credits failures.

Validation

Validation on production-code commit e5c8c55 (the only follow-up commit renames and formats the PR-numbered changelog fragment):

  • 212 focused Antigravity/auth/translator/usage regression tests passed
  • ESLint passed for the changed production files
  • check-public-creds, check-test-discovery, and changelog integrity passed
  • the reviewed patch built successfully as a GitHub-attested Webpack artifact on hosted run 29902026734
  • the artifact was deployed through verify → isolated candidate smoke → backup → atomic swap → runtime verification; dashboard, SQLite, API bridge, and all three listeners were healthy after deployment

High-volume operational soak evidence

Before opening this PR, the same Antigravity provider path and patch lineage was used for a real translation workload through both OmniRoute and 9router. Aggregate, privacy-safe counters from the self-hosted OmniRoute call_logs table cover 2026-07-21T04:50:03Z through 2026-07-22T08:41:57Z:

Observation Result
Real model calls (connection tests excluded) 53,997
HTTP 2xx 53,954 (99.92%)
Transient HTTP 502 43
HTTP 403 0
Distinct accounts (identifiers withheld) 5
Input tokens 11,103,224
Output tokens 1,001,586
Successful antigravity/gemini-3.5-flash-low calls 53,946

The accounts continued serving requests across the day boundary. No prompts, responses, credentials, or account identifiers are included in this PR.

This soak is supporting operational evidence from the same provider path and pre-PR patch lineage, not a claim that a client can guarantee protection from provider-side bans. Most of the workload preceded the final review-only fixes on this exact commit; exact-commit correctness is covered by the automated regression suite and the attested deployment gates above. Operators must still follow the upstream terms, keep paid credits opt-in, and apply sensible per-account rate limits.

Changed test coverage

The PR adds or updates regression coverage for:

  • recursive schema cleanup and tool-name wire fidelity
  • response tool-name restoration without serialized metadata leakage
  • credits-first and one-shot retry behavior, including client abort handling
  • missing-project bootstrap, coalescing, token rotation, and discovery/runtime endpoint separation
  • safety settings, OAuth/auth failure handling, usage fetching, and OpenAI → Gemini translation

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@nguyenha935
nguyenha935 marked this pull request as ready for review July 22, 2026 08:55
@nguyenha935

Copy link
Copy Markdown
Contributor Author

Ready for review. The description now includes privacy-safe operational soak evidence (53,997 real model calls across five accounts, 99.92% HTTP 2xx, zero HTTP 403) together with the exact automated and artifact-deployment validation. The soak is explicitly scoped as supporting evidence rather than a guarantee against provider-side enforcement.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

diegosouzapw added a commit to backryun/OmniRoute that referenced this pull request Jul 22, 2026
…e#8013) with protocol-fidelity + fail-closed (cheaper-inference#8098)

Merges the two overlapping Antigravity PRs into one:
- cheaper-inference#8013 (backryun): catalog rebuild + IDE/CLI/IDE-Node client-identity split + profile-aware headers.
- cheaper-inference#8098 (nguyenha935): fail-closed safety-settings, credits-retry-state, signal/abort propagation,
  tool-cloaking (no synthetic includeServerSideToolInvocations flag), dedicated bootstrap URL list.

User-Agent hybrid (owner decision): OS/arch token pinned to darwin/arm64 (the native macOS client
fingerprint the upstream expects, cheaper-inference#8098) while keeping the IDE/CLI/IDE-Node UA split (cheaper-inference#8013).
Bootstrap uses cheaper-inference#8098's dedicated single production loadCodeAssist URL + cheaper-inference#8013's logic + cheaper-inference#8098's
abort signal. cheaper-inference#6914 reversed per cheaper-inference#8098 protocol fidelity. cheaper-inference#8098's onboard-tier detection is NOT
ported (architecturally incompatible with cheaper-inference#8013's antigravityClientProfile rewrite) — follow-up.
Full antigravity suite 303/303 green; needs a VPS fingerprint smoke before merge (Hard Rule cheaper-inference#18).

Co-authored-by: nguyenha935 <nguyenha935@users.noreply.github.com>
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Obrigado, @nguyenha935 — excelente trabalho de protocol fidelity. Este PR foi fundido com o #8013 (@backryun) numa entrega única, já que os dois reescreviam o mesmo subsistema Antigravity com designs opostos (decisão do dono). Todo o seu trabalho foi preservado no #8013 com sua co-autoria: fail-closed nas safety-settings, credits-retry-state, propagação de signal/abort, tool-cloaking (sem o flag sintético includeServerSideToolInvocations — reverte o #6914), e a lista de URL de bootstrap dedicada. O User-Agent ficou híbrido: darwin/arm64 fixo (seu fingerprint macOS) mantendo o split IDE/CLI do #8013. Suíte antigravity completa 303/303 verde.

Fechando este em favor do #8013 (que carrega a fusão + sua co-autoria). Uma ressalva: o fluxo de onboard-tier (harness profile + getAntigravityBootstrapHeaders) não foi portado por ser incompatível com o rewrite do antigravityClientProfile.ts do #8013 — se quiser reintroduzi-lo, abra um PR focado sobre a nova base que integramos com crédito.

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