Skip to content

[Reference Only] Upstream PR #141 - feat(antigravity): initial steps for Antigravity anti-ban alignment - #4

Draft
nsalvacao wants to merge 7 commits into
masterfrom
upstream-prs/pr-141
Draft

nsalvacao wants to merge 7 commits into
masterfrom
upstream-prs/pr-141

Conversation

@nsalvacao

@nsalvacao nsalvacao commented Mar 16, 2026 •

Copy link
Copy Markdown

Context

This draft PR mirrors upstream branch 'upstream-prs/pr-141' into 'master' for review, provenance, and later decision-making only.
It must not be merged wholesale. If we adopt anything from it, the intended path is commit-level intake only.

Upstream Source

Current Intake Recommendation

  • Decision: Reference only / absorbed-noop
  • Status: Planned review only, with no integration performed yet
  • Credit policy: preserve original author metadata, use git cherry-pick -x for any later intake, and keep any conflict adaptation in separate follow-up commits with explicit upstream attribution

Selected Commits For Any Future Intake

  • No direct intake currently selected. This mirrored branch is retained for audit and provenance only.

Skipped / Excluded Scope

  • Branch is retained as reference only because the main theme appears already represented upstream.

Acceptance Gates

  • Do not merge this mirrored branch as-is.
  • If anything is adopted later, intake only the explicitly selected commits or a newly re-validated subset.
  • Preserve upstream authorship and provenance in Git history.
  • Keep conflict-resolution/adaptation commits separate from upstream-authored commits.
  • Reconfirm branch contents against current master at intake time before changing the selected scope.

Verification / Validation Checklist

  • Reconfirm current master already covers the useful anti-ban behavior.
  • Keep this PR draft and unmerged unless a missing delta is proven.
  • If a residual commit is later selected, update the intake manifest first.

Review Focus

  • Whether any residual anti-ban behavior is actually still missing from current master
  • Whether this branch should remain reference-only and unmerged

Notes

  • This PR is intentionally draft and serves as a reviewable reference mirror inside the fork.
  • Current recommendation is to keep it unmerged unless a missing residual commit is proven.

zx added 7 commits February 17, 2026 10:57
- Update client metadata (ideType, platform, pluginType) to use numeric enums matching binary specs
- Add runtime platform detection to accurately report OS and architecture
- Add 'mode: 1' parameter to loadCodeAssist and onboardUser API calls
- Generate dynamic User-Agent based on system runtime information
- Update session ID format to `UUID + Date.now().toString()` to align with binary specs
- Introduce sessionManager to handle per-connection/account session persistence
- Ensure session ID stability during the process lifetime to improve prompt caching
- Integrate session derivation into both Antigravity executor and translator
- Introduce `ANTIGRAVITY_HEADERS` constant with specific client version and gRPC metadata
- Update `AntigravityExecutor` to include standard client headers
- Inject `X-Machine-Session-Id` header derived from the request session ID
- Remove custom `X-9Router-Source` header to better mimic official client behavior
- Reorder execution logic to extract session ID from transformed body before building headers
- Add `mode: 1` to `loadCodeAssist`, `onboardUser`, and usage quota requests to match binary protocol
- Replace hardcoded metadata with centralized `getOAuthClientMetadata()` and `CLIENT_METADATA` in Gemini and Antigravity services
- Update Antigravity User-Agent to use dynamic platform-specific string via `getPlatformUserAgent()`

(cherry picked from commit 1805188)
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.

1 participant