You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Anthropic's signed thinking blocks have cryptographic signatures with a time-to-live (TTL). When these blocks are stored in session history and replayed on subsequent turns, the signatures can silently expire, causing 400 Invalid signature in thinking block errors that poison the session.
Issue #89684 shipped reactive auto-recovery for this error class. This issue requests the complementary proactive approach: track the signature TTL and strip expired thinking blocks from the session before they are included in the outbound request, preventing the error entirely.
Observed behavior
Session file accumulates signed thinking blocks over time (14 blocks across 55 messages in our case)
After some period (likely hours), the cryptographic signatures expire
Every subsequent Anthropic request replays the expired signatures and gets an instant HTTP 400
The session is bricked for that provider until manually cleared or auto-recovery kicks in
OpenClaw should track the TTL of signed thinking blocks (either by querying Anthropic's documented TTL or by recording the block creation timestamp) and proactively strip or redact blocks whose signatures have expired before including them in the outbound message payload.
This could be implemented as:
A timestamp annotation on thinking blocks when they are first persisted to the session file
A configurable TTL (e.g. session.thinkingBlockTtl) that defaults to a safe value
A pre-request sanitization pass that drops thinking blocks older than the TTL
Alternatively, during session hydration / context assembly, filter out blocks past TTL
Why proactive > reactive
No wasted API calls — reactive recovery still sends the bad request first
No error log noise — the 400 never fires
Cleaner context windows — expired thinking blocks consume tokens but provide no value (the model can't see redacted thinking anyway)
Compaction-friendly — naturally shrinks session context over time
Summary
Anthropic's signed thinking blocks have cryptographic signatures with a time-to-live (TTL). When these blocks are stored in session history and replayed on subsequent turns, the signatures can silently expire, causing
400 Invalid signature in thinking blockerrors that poison the session.Issue #89684 shipped reactive auto-recovery for this error class. This issue requests the complementary proactive approach: track the signature TTL and strip expired thinking blocks from the session before they are included in the outbound request, preventing the error entirely.
Observed behavior
HTTP 400Proposed behavior
OpenClaw should track the TTL of signed thinking blocks (either by querying Anthropic's documented TTL or by recording the block creation timestamp) and proactively strip or redact blocks whose signatures have expired before including them in the outbound message payload.
This could be implemented as:
session.thinkingBlockTtl) that defaults to a safe valueWhy proactive > reactive
Environment
thinking: adaptivemessages.5.content.10: Invalid signature in thinking blockRelated