From b566b20ade6e69a22a0cd9103187397cb3e561b1 Mon Sep 17 00:00:00 2001 From: stoXmod Date: Thu, 13 Aug 2026 12:08:31 +0700 Subject: [PATCH] fix(antigravity): strip competitive system prompts to prevent 429 quota errors Zed IDE injects a Claude-agent system prompt that Antigravity flags as competitive, blocking the request with a 429 Quota Exhausted response. Scan systemInstruction.parts and remove the prompt before dispatch. --- open-sse/executors/antigravity.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/open-sse/executors/antigravity.js b/open-sse/executors/antigravity.js index 7f24fd85..07bbb4fc 100644 --- a/open-sse/executors/antigravity.js +++ b/open-sse/executors/antigravity.js @@ -245,6 +245,18 @@ export class AntigravityExecutor extends BaseExecutor { // Strip tools/toolConfig (handled separately) and blacklisted fields that Google rejects const { tools: _originalTools, toolConfig: _originalToolConfig, ...requestWithoutTools } = body.request || {}; stripBlacklisted(requestWithoutTools); + + // Rewrite competitive system prompts (e.g. Zed IDE's Claude prompt) to prevent Antigravity from + // flagging the request and immediately blocking it with a 429 Quota Exhausted response. + if (requestWithoutTools.systemInstruction?.parts) { + const oldText = "You are a Claude agent, built on Anthropic's Claude Agent SDK."; + for (const part of requestWithoutTools.systemInstruction.parts) { + if (typeof part.text === "string" && part.text.includes(oldText)) { + part.text = part.text.split(oldText).join(""); + } + } + } + const generationConfig = { ...(requestWithoutTools.generationConfig || {}) }; if (generationConfig.maxOutputTokens > MAX_ANTIGRAVITY_OUTPUT_TOKENS) { generationConfig.maxOutputTokens = MAX_ANTIGRAVITY_OUTPUT_TOKENS;