Bug: Empty thinking-block signatures poison Anthropic Messages sessions — fix from #70054 not applied to standard Anthropic transport
OpenClaw version: 2026.5.22
Provider: anthropic / anthropic-messages (direct Anthropic API, not Bedrock)
Model: claude-sonnet-4-6
Thinking level: medium
What happened
A user session with thinking_level: medium generated several assistant turns containing thinking blocks. The thinking blocks were persisted to the session JSONL with empty signatures ("signature": ""). On every subsequent turn the session was completely broken — every request failed immediately with:
LLM request rejected: messages.5.content.0: Invalid `signature` in `thinking` block
The session was permanently bricked. The user received no response and no error message. The only fix was to manually strip all thinking blocks from the raw JSONL transcript.
Root cause
Thinking blocks with empty/blank signatures are being persisted to the JSONL session transcript. When these are replayed to the Anthropic API on follow-up turns, Anthropic rejects the empty signature.
Why the existing fix doesn't help
Fix #70054 (released in 2026.4.25) addresses exactly this problem — "strip thinking blocks with missing, empty, or blank replay signatures before provider conversion" — but it is scoped to Agents/Anthropic/Bedrock only.
The standard anthropic-messages transport (direct Anthropic API) does not have the same guard. Sessions using direct Anthropic (not Bedrock) are still vulnerable to this issue.
Steps to reproduce
- Open a session with
thinking_level: medium using anthropic/claude-sonnet-4-6 (direct Anthropic, not Bedrock)
- Have the agent produce several turns with tool calls (tool-call turns seem to be where signatures go missing)
- The JSONL will contain
thinking blocks with "signature": ""
- Any subsequent turn in that session will fail with the
Invalid signature error
Expected behavior
The same guard applied in #70054 for Bedrock should also be applied in the standard anthropic-messages transport: thinking blocks with missing, empty, or blank signatures should be stripped (or replaced with an omitted-reasoning placeholder) before sending to the API.
Additional context
- The fix for Bedrock is at:
Agents/Anthropic/Bedrock: strip thinking blocks with missing, empty, or blank replay signatures before provider conversion (CHANGELOG line ~4589)
- The same logic needs to be applied to the equivalent path in the non-Bedrock Anthropic Messages transport
- Discovered while running an agent session where the user (
widget:user role) had thinking inadvertently enabled
Bug: Empty thinking-block signatures poison Anthropic Messages sessions — fix from #70054 not applied to standard Anthropic transport
OpenClaw version: 2026.5.22
Provider:
anthropic/anthropic-messages(direct Anthropic API, not Bedrock)Model:
claude-sonnet-4-6Thinking level:
mediumWhat happened
A user session with
thinking_level: mediumgenerated several assistant turns containingthinkingblocks. The thinking blocks were persisted to the session JSONL with empty signatures ("signature": ""). On every subsequent turn the session was completely broken — every request failed immediately with:The session was permanently bricked. The user received no response and no error message. The only fix was to manually strip all thinking blocks from the raw JSONL transcript.
Root cause
Thinking blocks with empty/blank signatures are being persisted to the JSONL session transcript. When these are replayed to the Anthropic API on follow-up turns, Anthropic rejects the empty signature.
Why the existing fix doesn't help
Fix #70054 (released in 2026.4.25) addresses exactly this problem — "strip thinking blocks with missing, empty, or blank replay signatures before provider conversion" — but it is scoped to
Agents/Anthropic/Bedrockonly.The standard
anthropic-messagestransport (direct Anthropic API) does not have the same guard. Sessions using direct Anthropic (not Bedrock) are still vulnerable to this issue.Steps to reproduce
thinking_level: mediumusinganthropic/claude-sonnet-4-6(direct Anthropic, not Bedrock)thinkingblocks with"signature": ""Invalid signatureerrorExpected behavior
The same guard applied in #70054 for Bedrock should also be applied in the standard
anthropic-messagestransport: thinking blocks with missing, empty, or blank signatures should be stripped (or replaced with an omitted-reasoning placeholder) before sending to the API.Additional context
Agents/Anthropic/Bedrock: strip thinking blocks with missing, empty, or blank replay signatures before provider conversion(CHANGELOG line ~4589)widget:userrole) had thinking inadvertently enabled