diff --git a/CHANGELOG.md b/CHANGELOG.md index 93a11b775..ab04d6777 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ Docs: https://docs.openclaw.ai - Sessions/daily reset transcript archival: archive prior transcript files during stale-session scheduled/daily resets by capturing the previous session entry before rollover, preventing orphaned transcript files on disk. (#35493) Thanks @byungsker. - Feishu/group slash command detection: normalize group mention wrappers before command-authorization probing so mention-prefixed commands (for example `@Bot/model` and `@Bot /reset`) are recognized as gateway commands instead of being forwarded to the agent. (#35994) Thanks @liuxiaopai-ai. - Agents/context pruning: guard assistant thinking/text char estimation against malformed blocks (missing `thinking`/`text` strings or null entries) so pruning no longer crashes with malformed provider content. (openclaw#35146) thanks @Sid-Qin. +- Agents/transcript policy: set `preserveSignatures` to Anthropic-only handling in `resolveTranscriptPolicy` so Anthropic thinking signatures are preserved while non-Anthropic providers remain unchanged. (#32813) thanks @Sid-Qin. - Agents/schema cleaning: detect Venice + Grok model IDs as xAI-proxied targets so unsupported JSON Schema keywords are stripped before requests, preventing Venice/Grok `Invalid arguments` failures. (openclaw#35355) thanks @Sid-Qin. - Skills/native command deduplication: centralize skill command dedupe by canonical `skillName` in `listSkillCommandsForAgents` so duplicate suffixed variants (for example `_2`) are no longer surfaced across interfaces outside Discord. (#27521) thanks @shivama205. - Agents/xAI tool-call argument decoding: decode HTML-entity encoded xAI/Grok tool-call argument values (`&`, `"`, `<`, `>`, numeric entities) before tool execution so commands with shell operators and quotes no longer fail with parse errors. (#35276) Thanks @Sid-Qin. diff --git a/src/agents/transcript-policy.test.ts b/src/agents/transcript-policy.test.ts index 13686c2f6..796cd2f43 100644 --- a/src/agents/transcript-policy.test.ts +++ b/src/agents/transcript-policy.test.ts @@ -76,6 +76,50 @@ describe("resolveTranscriptPolicy", () => { expect(policy.sanitizeMode).toBe("full"); }); + it("preserves thinking signatures for Anthropic provider (#32526)", () => { + const policy = resolveTranscriptPolicy({ + provider: "anthropic", + modelId: "claude-opus-4-5", + modelApi: "anthropic-messages", + }); + expect(policy.preserveSignatures).toBe(true); + }); + + it("preserves thinking signatures for Bedrock Anthropic (#32526)", () => { + const policy = resolveTranscriptPolicy({ + provider: "amazon-bedrock", + modelId: "us.anthropic.claude-opus-4-6-v1", + modelApi: "bedrock-converse-stream", + }); + expect(policy.preserveSignatures).toBe(true); + }); + + it("does not preserve signatures for Google provider (#32526)", () => { + const policy = resolveTranscriptPolicy({ + provider: "google", + modelId: "gemini-2.0-flash", + modelApi: "google-generative-ai", + }); + expect(policy.preserveSignatures).toBe(false); + }); + + it("does not preserve signatures for OpenAI provider (#32526)", () => { + const policy = resolveTranscriptPolicy({ + provider: "openai", + modelId: "gpt-4o", + modelApi: "openai", + }); + expect(policy.preserveSignatures).toBe(false); + }); + + it("does not preserve signatures for Mistral provider (#32526)", () => { + const policy = resolveTranscriptPolicy({ + provider: "mistral", + modelId: "mistral-large-latest", + }); + expect(policy.preserveSignatures).toBe(false); + }); + it("keeps OpenRouter on its existing turn-validation path", () => { const policy = resolveTranscriptPolicy({ provider: "openrouter", diff --git a/src/agents/transcript-policy.ts b/src/agents/transcript-policy.ts index 43238786e..189dd7a3e 100644 --- a/src/agents/transcript-policy.ts +++ b/src/agents/transcript-policy.ts @@ -123,7 +123,7 @@ export function resolveTranscriptPolicy(params: { (!isOpenAi && sanitizeToolCallIds) || requiresOpenAiCompatibleToolIdSanitization, toolCallIdMode, repairToolUseResultPairing, - preserveSignatures: false, + preserveSignatures: isAnthropic, sanitizeThoughtSignatures: isOpenAi ? undefined : sanitizeThoughtSignatures, sanitizeThinkingSignatures: false, dropThinkingBlocks,