-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
[Bug]: REPLAY_INVALID_RE missing Anthropic 'Invalid signature in thinking block' — hard session failure instead of recovery retry #88020
Copy link
Copy link
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.bugSomething isn't workingSomething isn't workingclawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.regressionBehavior that previously worked and now failsBehavior that previously worked and now fails
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.bugSomething isn't workingSomething isn't workingclawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.regressionBehavior that previously worked and now failsBehavior that previously worked and now fails
Type
Fields
Give feedbackNo fields configured for issues without a type.
Bug type
Regression (worked before, now fails)
Beta release blocker
No
Summary
When a session with extended thinking runs long enough for early thinking block signatures to expire, Anthropic rejects the next API call with
Invalid signature in thinking block, butisReplayInvalidErrorMessage()does not match this pattern, so OpenClaw hard-fails the session instead of stripping the stale thinking blocks and retrying.Steps to reproduce
thinking: adaptiveor explicit thinking level.invalid_request_error: messages.1.content.N: Invalid \signature` in `thinking` block`stopReason: error,totalTokens: 0,runtimeMs: ~300ms) — session is dead.Expected behavior
OpenClaw should detect
Invalid signature in thinking blockas areplay_invalidfailure kind, strip the stale thinking blocks viastripInvalidThinkingSignatures, and retry the request — same as it does for other replay-invalid patterns likeroles must alternate.Actual behavior
Session hard-fails. Transcript shows:
Session is unrecoverable. User must
/new.OpenClaw version
2026.5.27 (27ae826)
Operating system
macOS 25.5.0 Darwin arm64
Install method
npm global (homebrew)
Model
anthropic/claude-sonnet-4-6 (thinking: adaptive)
Provider / routing chain
openclaw -> Anthropic direct (cloudflare tunnel)
Additional provider/model setup details
No response
Logs, screenshots, and evidence
Impact and severity
/newand re-establish context; any in-flight subagent work is orphaned; session cost (~$10) is wastedAdditional information
The 2026.5.27 changelog mentions "strip stale Anthropic thinking" as a fix — that likely covered the absent/blank signature case in
stripInvalidThinkingSignatures. This issue is the complementary missing piece: the provider rejection error was not wired intoREPLAY_INVALID_REso the retry path is never reached for cryptographically-expired (but syntactically-present) signatures.