diff --git a/CHANGELOG.md b/CHANGELOG.md index 0452e772b..436b7972a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -117,6 +117,7 @@ - Logging: tolerate `EIO` from console writes to avoid gateway crashes. (#925, fixes #878) — thanks @grp06. - Sandbox: restore `docker.binds` config validation and preserve configured PATH for `docker exec`. (#873) — thanks @akonyer. - Google: downgrade unsigned thinking blocks before send to avoid missing signature errors. +- Agents: preserve Antigravity Claude signatures and skip Gemini downgrades. (#959) — thanks @rdev. #### macOS / Apps - macOS: ensure launchd log directory exists with a test-only override. (#909) — thanks @roshanasingh4. diff --git a/src/agents/pi-embedded-runner/google.ts b/src/agents/pi-embedded-runner/google.ts index be6e66a90..8dc3dac4b 100644 --- a/src/agents/pi-embedded-runner/google.ts +++ b/src/agents/pi-embedded-runner/google.ts @@ -157,14 +157,14 @@ export async function sanitizeSessionHistory(params: { sessionManager: SessionManager; sessionId: string; }): Promise { + const isAntigravityClaudeModel = isAntigravityClaude(params.modelApi, params.modelId); const sanitizedImages = await sanitizeSessionMessagesImages(params.messages, "session:history", { sanitizeToolCallIds: shouldSanitizeToolCallIds(params.modelApi), enforceToolCallLast: params.modelApi === "anthropic-messages", - preserveSignatures: params.modelApi === "google-antigravity" && isAntigravityClaude(params.modelId), + preserveSignatures: params.modelApi === "google-antigravity" && isAntigravityClaudeModel, }); const repairedTools = sanitizeToolUseResultPairing(sanitizedImages); - const shouldDowngradeGemini = - isGoogleModelApi(params.modelApi) && !isAntigravityClaude(params.modelId); + const shouldDowngradeGemini = isGoogleModelApi(params.modelApi) && !isAntigravityClaudeModel; // Gemini rejects unsigned thinking blocks; downgrade them before send to avoid INVALID_ARGUMENT. const downgradedThinking = shouldDowngradeGemini ? downgradeGeminiThinkingBlocks(repairedTools)