Problem
When running with thinking=adaptive (or any thinking mode) against Anthropic models, extended thinking blocks with cryptographically signed replay signatures accumulate in the session transcript. These signatures are time-limited and single-use.
The current transcript hygiene strips thinking blocks with missing, empty, or blank signatures:
Thinking blocks with missing, empty, or blank replay signatures are stripped before provider conversion.
However, it does not strip thinking blocks where the signature is present but expired/invalid. When these are replayed to the Anthropic Messages API, the API rejects the entire request:
messages.9.content.6: Invalid signature in thinking block
This causes a cascade:
- Every subsequent LLM call fails because the full history is replayed
- The corrupted transcript is persisted to disk
- Container restarts reload the same bad transcript → crash loop
- No automatic recovery without manual session reset
Expected Behavior
Historical thinking blocks should be stripped from replay regardless of signature state. The Anthropic API uses signatures for single-use replay within the same conversation turn; there is no valid reason to replay thinking blocks from earlier turns. All type: "thinking" blocks in historical assistant messages should be removed before provider conversion.
Actual Behavior
Thinking blocks with expired but non-empty signatures pass through transcript hygiene and are sent to the Anthropic API, which rejects them.
Reproduction
- Run an agent with
thinking=adaptive on Anthropic Claude
- Have a long-running session (10+ turns with thinking responses)
- Wait for signatures to expire (or restart the container after some time)
- Next LLM call fails with
Invalid signature in thinking block
- All subsequent calls fail — session is bricked
Impact
- Two production outages in our setup: 1.5h and 8h downtime
- Only recoverable via manual session transcript deletion
- Affects any long-running session using thinking mode with Anthropic
Suggested Fix
In the Anthropic provider adapter's transcript hygiene, change the stripping condition from "missing/empty/blank signature" to "all thinking blocks in historical turns":
// Before: only strips missing/blank
content.filter(b => !(b.type === 'thinking' && (!b.signature || b.signature.trim() === '')))
// After: strip ALL thinking blocks from historical assistant messages
content.filter(b => b.type !== 'thinking')
The current-turn thinking block (if any) should still be preserved for tool-call continuations within the same turn, per existing logic.
Environment
- OpenClaw: 2026.5.27
- Model: anthropic/claude-opus-4-6
- Thinking mode: adaptive
Workaround
Manual session reset to delete all transcript files and restart the gateway.
Problem
When running with
thinking=adaptive(or any thinking mode) against Anthropic models, extended thinking blocks with cryptographically signed replay signatures accumulate in the session transcript. These signatures are time-limited and single-use.The current transcript hygiene strips thinking blocks with missing, empty, or blank signatures:
However, it does not strip thinking blocks where the signature is present but expired/invalid. When these are replayed to the Anthropic Messages API, the API rejects the entire request:
This causes a cascade:
Expected Behavior
Historical thinking blocks should be stripped from replay regardless of signature state. The Anthropic API uses signatures for single-use replay within the same conversation turn; there is no valid reason to replay thinking blocks from earlier turns. All
type: "thinking"blocks in historical assistant messages should be removed before provider conversion.Actual Behavior
Thinking blocks with expired but non-empty signatures pass through transcript hygiene and are sent to the Anthropic API, which rejects them.
Reproduction
thinking=adaptiveon Anthropic ClaudeInvalid signature in thinking blockImpact
Suggested Fix
In the Anthropic provider adapter's transcript hygiene, change the stripping condition from "missing/empty/blank signature" to "all thinking blocks in historical turns":
The current-turn thinking block (if any) should still be preserved for tool-call continuations within the same turn, per existing logic.
Environment
Workaround
Manual session reset to delete all transcript files and restart the gateway.