Problem
Multi-turn conversations fail with:
messages.15.content.5: `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
The proxy correctly protects thinking blocks during forward/reverse mapping. However, OpenClaw's internal JSON storage appears to re-serialise the conversation history (normalising whitespace, key ordering, or escaping). When the thinking blocks are sent back on the next turn, they're no longer byte-identical to the original API response.
Environment
- OpenClaw v2026.4.11
- Model: claude-sonnet-4-6 (extended thinking enabled)
- Proxy cloned from main branch
Suggested Fix
Option 1: Strip all thinking and redacted_thinking blocks from request message history before forwarding to the API. The API accepts messages without thinking blocks — it just requires them to be byte-identical if present.
Option 2: Detect and strip only from the latest assistant message (since that's what Anthropic validates).
Problem
Multi-turn conversations fail with:
Root Cause
The proxy correctly protects thinking blocks during forward/reverse mapping. However, OpenClaw's internal JSON storage appears to re-serialise the conversation history (normalising whitespace, key ordering, or escaping). When the thinking blocks are sent back on the next turn, they're no longer byte-identical to the original API response.
Environment
Suggested Fix
Option 1: Strip all
thinkingandredacted_thinkingblocks from request message history before forwarding to the API. The API accepts messages without thinking blocks — it just requires them to be byte-identical if present.Option 2: Detect and strip only from the latest assistant message (since that's what Anthropic validates).