Bug
During session compaction, assistant messages containing thinking or redacted_thinking blocks are modified (summarized/trimmed). The Anthropic API rejects this:
messages.131.content.7: 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
Compaction rewrites/summarizes assistant messages, but Anthropic requires thinking blocks to remain exactly as generated. The compactor needs to either:
- Strip thinking blocks entirely before compaction
- Preserve thinking blocks verbatim when summarizing surrounding content
- Replace the entire message (including thinking) with a plain text summary
Impact
- Blocks LLM responses until compaction retries or session resets
- User sees raw error message in Telegram
- Happens more frequently with large sessions and adaptive thinking enabled
Environment
- OpenClaw 2026.3.1 (2a8ac97)
- Model: claude-opus-4-6 with thinking=adaptive
- Compaction mode: default
Bug
During session compaction, assistant messages containing
thinkingorredacted_thinkingblocks are modified (summarized/trimmed). The Anthropic API rejects this:Root Cause
Compaction rewrites/summarizes assistant messages, but Anthropic requires thinking blocks to remain exactly as generated. The compactor needs to either:
Impact
Environment