From ee80aeaba4ad997009630cd162e40cb7acf12e67 Mon Sep 17 00:00:00 2001 From: tctinh Date: Thu, 1 Jan 2026 10:34:48 +0700 Subject: [PATCH] fix: apply cross-model signature sanitization to single requests Fixes #70 - Gemini thoughtSignature persisting when switching to Claude Root cause: sanitizeCrossModelPayloadInPlace() was only called for batched requests, not for single requests. Gemini's thoughtSignature in tool metadata persisted and caused Claude to reject with 'Invalid signature in thinking block'. Bumps version to 1.2.8-beta.0 --- package-lock.json | 4 ++-- package.json | 2 +- src/plugin/request.ts | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 00e131b..7d050fb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "opencode-antigravity-auth", - "version": "1.2.7-beta.1", + "version": "1.2.8-beta.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "opencode-antigravity-auth", - "version": "1.2.7-beta.1", + "version": "1.2.8-beta.0", "license": "MIT", "dependencies": { "@openauthjs/openauth": "^0.4.3", diff --git a/package.json b/package.json index dcea1bf..3dc83fd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opencode-antigravity-auth", - "version": "1.2.7-beta.7", + "version": "1.2.8-beta.0", "description": "Google Antigravity IDE OAuth auth plugin for Opencode - access Gemini 3 Pro and Claude 4.5 using Google credentials", "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/src/plugin/request.ts b/src/plugin/request.ts index 4500b73..003a743 100644 --- a/src/plugin/request.ts +++ b/src/plugin/request.ts @@ -1110,6 +1110,9 @@ export function prepareAntigravityRequest( // Attempts to restore signatures from cache for multi-turn conversations // Handle both Gemini-style contents[] and Anthropic-style messages[] payloads. if (isClaude) { + // Step 0: Sanitize cross-model metadata (strips Gemini signatures when sending to Claude) + sanitizeCrossModelPayloadInPlace(requestPayload, { targetModel: effectiveModel }); + // Step 1: Strip corrupted/unsigned thinking blocks FIRST deepFilterThinkingBlocks(requestPayload, signatureSessionKey, getCachedSignature, true);