Update Antigravity provider config and headers

- Simplify ANTIGRAVITY_HEADERS to dynamic User-Agent only
- Use IDE_TYPE, PLUGIN_TYPE enums and getPlatformEnum() in metadata
- Update antigravity baseUrl to sandbox endpoint
- Bump User-Agent version from 1.104.0 to 1.107.0
- Remove redundant header spread in AntigravityExecutor

Made-with: Cursor
This commit is contained in:
xmllist
2026-03-17 10:12:17 +07:00
committed by decolua
parent 6546b162cc
commit 2bec2e1801
3 changed files with 8 additions and 12 deletions

View File

@@ -64,10 +64,7 @@ export const INTERNAL_REQUEST_HEADER = { name: "x-request-source", value: "local
// Antigravity chat/stream headers
export const ANTIGRAVITY_HEADERS = {
"X-Client-Name": "antigravity",
"X-Client-Version": "1.107.0",
"x-goog-api-client": "gl-node/18.18.2 fire/0.8.6 grpc/1.10.x",
"User-Agent": "antigravity/1.107.0 darwin/arm64"
"User-Agent": `antigravity/1.107.0 ${platform()}/${arch()}`
};
// Cloud Code Assist API
@@ -80,13 +77,13 @@ export const LOAD_CODE_ASSIST_HEADERS = {
"Content-Type": "application/json",
"User-Agent": "google-api-nodejs-client/9.15.1",
"X-Goog-Api-Client": "google-cloud-sdk vscode_cloudshelleditor/0.1",
"Client-Metadata": JSON.stringify({ ideType: "IDE_UNSPECIFIED", platform: "PLATFORM_UNSPECIFIED", pluginType: "GEMINI" }),
"Client-Metadata": JSON.stringify({ ideType: IDE_TYPE.ANTIGRAVITY, platform: getPlatformEnum(), pluginType: PLUGIN_TYPE.GEMINI }),
};
export const LOAD_CODE_ASSIST_METADATA = {
ideType: "IDE_UNSPECIFIED",
platform: "PLATFORM_UNSPECIFIED",
pluginType: "GEMINI",
ideType: IDE_TYPE.ANTIGRAVITY,
platform: getPlatformEnum(),
pluginType: PLUGIN_TYPE.GEMINI,
};
// System prompts

View File

@@ -98,10 +98,10 @@ export const PROVIDERS = {
antigravity: {
baseUrls: [
"https://daily-cloudcode-pa.googleapis.com",
"https://cloudcode-pa.googleapis.com",
"https://daily-cloudcode-pa.sandbox.googleapis.com",
],
format: "antigravity",
headers: { "User-Agent": `antigravity/1.104.0 ${platform()}/${arch()}` },
headers: { "User-Agent": `antigravity/1.107.0 ${platform()}/${arch()}` },
clientId: "1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",
clientSecret: "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"
},

View File

@@ -24,9 +24,8 @@ export class AntigravityExecutor extends BaseExecutor {
return {
"Content-Type": "application/json",
"Authorization": `Bearer ${credentials.accessToken}`,
"User-Agent": this.config.headers?.["User-Agent"] || ANTIGRAVITY_HEADERS['User-Agent'],
"User-Agent": this.config.headers?.["User-Agent"] || ANTIGRAVITY_HEADERS["User-Agent"],
[INTERNAL_REQUEST_HEADER.name]: INTERNAL_REQUEST_HEADER.value,
...ANTIGRAVITY_HEADERS,
...(sessionId && { "X-Machine-Session-Id": sessionId }),
"Accept": stream ? "text/event-stream" : "application/json"
};