diff --git a/src/agents/transcript-policy.ts b/src/agents/transcript-policy.ts index 264eb941024..d2d5d232d06 100644 --- a/src/agents/transcript-policy.ts +++ b/src/agents/transcript-policy.ts @@ -39,6 +39,8 @@ const OPENAI_MODEL_APIS = new Set([ ]); const OPENAI_PROVIDERS = new Set(["openai", "openai-codex"]); const OPENAI_COMPAT_TURN_MERGE_EXCLUDED_PROVIDERS = new Set(["openrouter", "opencode"]); +// Providers that use anthropic-messages API but cannot handle re-sent thinkingSignature blobs (#39798) +const ANTHROPIC_API_SIGNATURE_EXCLUDED_PROVIDERS = new Set(["kimi-coding"]); function isOpenAiApi(modelApi?: string | null): boolean { if (!modelApi) { @@ -123,8 +125,7 @@ export function resolveTranscriptPolicy(params: { (!isOpenAi && sanitizeToolCallIds) || requiresOpenAiCompatibleToolIdSanitization, toolCallIdMode, repairToolUseResultPairing, - // kimi-coding uses anthropic-messages API but cannot handle re-sent thinkingSignature blobs (#39798) - preserveSignatures: isAnthropic && provider !== "kimi-coding", + preserveSignatures: isAnthropic && !ANTHROPIC_API_SIGNATURE_EXCLUDED_PROVIDERS.has(provider), sanitizeThoughtSignatures: isOpenAi ? undefined : sanitizeThoughtSignatures, sanitizeThinkingSignatures: false, dropThinkingBlocks,