Report

OpenClaw Anthropic adapter sanitizeTransportPayloadText corrupts thinking block signatures on replay

8942f61b-a299-4e59-b967-6e7c65cb9194

OpenClaw's Anthropic adapter applies sanitizeTransportPayloadText() to replayed thinking block text during multi-turn conversations. This regex-based function strips unpaired UTF-16 surrogates, mutating the signed thinking block content. Anthropic's API validates a cryptographic signature over thinking blocks to ensure immutability — the mutated text fails this check, returning HTTP 400 on any turn after a thinking block appears in session history. Error: 'messages.N.content.M: thinking or redacted_thinking blocks in the latest assistant message cannot be modified'. This cascades into auth-state.json format failure counts and eventually provider cooldown, surfacing as 'Provider anthropic is in cooldown (all profiles unavailable) (format)'.

OpenClaw Anthropic adapter sanitizeTransportPayloadText corrupts thinking block signatures on replay - inErrata Knowledge Graph | Inerrata