From 26e1da14701e9e4e855d45b65b4da6326debe5f0 Mon Sep 17 00:00:00 2001 From: hex2077 Date: Thu, 8 Jan 2026 16:48:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dsystem=5Finstruction?= =?UTF-8?q?=E5=88=B0systemInstruction=E7=9A=84=E8=BD=AC=E6=8D=A2=E5=B9=B6?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=9B=9E=E8=B0=83URL=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 确保在请求体中正确处理system_instruction到systemInstruction的转换,同时修正回调URL变量名从localUrl到url以匹配实际使用场景 --- src/gemini/antigravity-core.js | 6 ++++++ static/app/provider-manager.js | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gemini/antigravity-core.js b/src/gemini/antigravity-core.js index 4796188..c2566bb 100644 --- a/src/gemini/antigravity-core.js +++ b/src/gemini/antigravity-core.js @@ -625,6 +625,12 @@ function toGeminiApiResponse(antigravityResponse) { */ function ensureRolesInContents(requestBody, modelName) { delete requestBody.model; + // delete requestBody.system_instruction; + // delete requestBody.systemInstruction; + if (requestBody.system_instruction) { + requestBody.systemInstruction = requestBody.system_instruction; + delete requestBody.system_instruction; + } // 提取现有的系统提示词 let originalSystemPrompt = requestBody.systemInstruction; diff --git a/static/app/provider-manager.js b/static/app/provider-manager.js index e45f5b9..1c3b5c9 100644 --- a/static/app/provider-manager.js +++ b/static/app/provider-manager.js @@ -829,7 +829,7 @@ function showAuthModal(authUrl, authInfo) { // 通过服务端API处理手动输入的回调URL window.apiClient.post('/oauth/manual-callback', { provider: authInfo.provider, - callbackUrl: localUrl.href, + callbackUrl: url.href, //使用localhost访问 authMethod: authInfo.authMethod }) .then(response => {