- Export ANTIGRAVITY_VERSION_FALLBACK so tests import it instead of
repeating the literal (single update surface on future bumps)
- Add afterEach(vi.unstubAllGlobals) to prevent stub leaks between tests
- Fix semver comparison to use explicit major/minor checks instead of
major*100+minor encoding that breaks for minor >= 100
The hardcoded ANTIGRAVITY_VERSION_FALLBACK (1.15.8) predates Gemini 3.1
Pro support on the backend. When the live version fetch fails (firewall,
WSL2 network restrictions, timeout), the stale fallback is used in
User-Agent headers. The backend then rejects requests with 'not
available on this version'.
Bump the fallback to 1.18.3 (current stable) and add 9 regression tests
covering the network-failure path.
Closes#468
- Updated Gemini CLI headers to match expected formats and behaviors
- Removed Linux support and adjusted fingerprint generation accordingly
- Cleaned up unused functions and constants
- Enhanced tests to validate new header behaviors
The falsy check !result.thinkingBudget treated thinkingBudget: 0 as missing,
allowing the generationConfig fallback to overwrite it. Use explicit
=== undefined check instead. Adds test for the edge case.
Co-authored-by: greptile[bot] <greptile[bot]@users.noreply.github.com>
The JSON schema (with additionalProperties: false) was missing 8 properties
present in the Zod config schema, causing IDE validation errors for valid
config keys: scheduling_mode, max_cache_first_wait_seconds,
failure_ttl_seconds, toast_scope, request_jitter_max_ms,
soft_quota_threshold_percent, quota_refresh_interval_minutes,
soft_quota_cache_ttl_minutes.
Also adds descriptions for quota_fallback, cli_first, and all new properties
to the build script so they survive future regenerations.
OpenCode passes variant thinking config in generationConfig rather than
providerOptions, causing extractVariantThinkingConfig to always return
undefined and the budget to fall back to the default 32768.
Add generationConfig as a second parameter to extractVariantThinkingConfig.
The function now checks providerOptions first (preserving existing behavior),
then falls back to generationConfig.thinkingConfig when providerOptions
yields no thinking configuration.
The x-goog-user-project header causes 403 PERMISSION_DENIED on BOTH
Daily and Prod endpoints (verified with live testing on 11 models).
Previously, the fix only stripped this header for 'antigravity' style.
Now it strips unconditionally for all headerStyles including 'gemini-cli'.
Error message: 'Cloud Code Private API has not been used in project
{user_project} before or it is disabled'
Addresses PR review feedback from @NoeFabris.
Reduce fingerprint surface to minimize rate limiting by matching what
Antigravity Manager actually sends on content requests.
Changes:
- Remove X-Goog-QuotaUser and X-Client-Device-Id headers (AM doesn't send them)
- Remove X-Goog-Api-Client and Client-Metadata from fingerprint headers (AM only sends User-Agent on content requests)
- Fix ideType: replace random pool (INTELLIJ, ANDROID_STUDIO, etc.) with ANTIGRAVITY/IDE_UNSPECIFIED
- Remove wrong SDK clients (intellij/2024.1, android-studio/2024.1, jetbrains/2024.3) from randomization pools
- Strip extra Client-Metadata fields (osVersion, arch, sqmId) not present in AM
- Force-regenerate saved fingerprints on account load to clear stale data
- Set CODE_ASSIST_METADATA.ideType to ANTIGRAVITY (matching AM)
- Strip x-goog-user-project header ONLY for antigravity headerStyle (Daily endpoint)
- Keep the header for gemini-cli style (Prod endpoint) where it may be needed for billing/quota
- Add test coverage for both headerStyle behaviors
Root cause:
The x-goog-user-project header (added by OpenCode/AI SDK) causes 403 Forbidden
errors on the Daily sandbox endpoint. This triggers fallback to Prod endpoint,
but claude-opus-4-6-thinking is only available on Daily, resulting in 404 errors.
By stripping this header only for antigravity requests, Daily endpoint works
while preserving potential billing/quota functionality for gemini-cli requests.
Fixes#410