A fix (#52961) ensures that Anthropic's extended thinking blocks maintain their original order when processed through OpenClaw's agent pipeline.
When Claude uses extended thinking (the reasoning traces visible in models like Claude Opus 4), the response contains multiple content blocks: thinking blocks interleaved with regular text. The order of these blocks is semantically meaningful — the thinking should appear where it occurred in the reasoning process.
Extended thinking is increasingly important for complex agentic tasks. When an AI assistant reasons through a multi-step problem, users (and downstream systems) benefit from seeing the reasoning in the order it occurred:
Anthropic's API returns content blocks like:
[
{ "type": "thinking", "text": "Let me consider the options..." },
{ "type": "text", "text": "Based on the analysis, I recommend..." },
{ "type": "thinking", "text": "Wait, I should also check..." },
{ "type": "text", "text": "Actually, there's one more consideration..." }
]
The fix ensures OpenClaw preserves this exact order rather than grouping by type. This is especially important when:
This fix is part of a busy day for OpenClaw releases — alongside macOS publishing automation, plugin bundling improvements, and session transcript fixes. The project continues maturing its multi-provider support as different LLM providers expose different response structures.
Extended thinking support across providers remains an area of active development. As more models adopt chain-of-thought reasoning, maintaining semantic structure through middleware layers becomes increasingly important.