Problem
When using Anthropic models with extended thinking enabled, the signature field on thinking content blocks is not preserved when messages are serialized to the session JSONL file. When the conversation history is sent back to the Anthropic API in subsequent turns, the API rejects the request:
LLM request rejected: messages.31.content.2: `thinking` or `redacted_thinking` blocks in the latest assistant message cannot be modified. These blocks must remain as they were in the original response.
Root cause
Anthropic API returns thinking blocks with a signature field that must be passed back verbatim. During session persistence (writing to .jsonl), the signature field is stripped or not captured. Inspecting the session file confirms all thinking blocks have no signature:
type=thinking thinking_len=224 signature=(none)
type=thinking thinking_len=562 signature=(none)
...
This causes any subsequent API call using those messages to fail, since the thinking blocks are considered "modified".
Impact
- Once the session accumulates enough messages with thinking blocks, all further interactions in that session fail permanently
/new and /reset commands may not properly clear the corrupted session
- The only workaround is manually deleting the session JSONL file
Steps to reproduce
- Configure an agent with
anthropic/claude-sonnet-4-6 (or any Anthropic model with thinking)
- Have a multi-turn conversation in a Feishu group (or any channel)
- After ~15+ assistant turns with thinking, the session starts failing with the above error
Expected behavior
The signature field (and any other fields) on thinking / redacted_thinking content blocks should be preserved exactly as received from the API when serializing to the session file.
Environment
- OpenClaw version: 2026.3.8
- Model: anthropic/claude-sonnet-4-6
- Provider: anthropic
- Compaction mode: safeguard
Problem
When using Anthropic models with extended thinking enabled, the
signaturefield onthinkingcontent blocks is not preserved when messages are serialized to the session JSONL file. When the conversation history is sent back to the Anthropic API in subsequent turns, the API rejects the request:Root cause
Anthropic API returns thinking blocks with a
signaturefield that must be passed back verbatim. During session persistence (writing to.jsonl), thesignaturefield is stripped or not captured. Inspecting the session file confirms all thinking blocks have nosignature:This causes any subsequent API call using those messages to fail, since the thinking blocks are considered "modified".
Impact
/newand/resetcommands may not properly clear the corrupted sessionSteps to reproduce
anthropic/claude-sonnet-4-6(or any Anthropic model with thinking)Expected behavior
The
signaturefield (and any other fields) onthinking/redacted_thinkingcontent blocks should be preserved exactly as received from the API when serializing to the session file.Environment