Repository navigation
fix: repair rejected Anthropic thinking replay - #92286
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 12, 2026, 12:44 PM ET / 16:44 UTC. Summary PR surface: Source +181, Tests +459. Total +640 across 7 files. Reproducibility: yes. The live Anthropic procedure captures a real signed-thinking response, corrupts its signature, reproduces provider rejection, exercises the patched durable repair, and verifies a later replay succeeds. Review metrics: 1 noteworthy metric.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the existing-path durable repair if session-state owners accept provider-confirmed active-branch reasoning removal as the canonical recovery policy, while retaining fresh reasoning generated by the successful retry and avoiding signature-size heuristics, runtime fallback readers, or a second persistence path. Do we have a high-confidence way to reproduce the issue? Yes. The live Anthropic procedure captures a real signed-thinking response, corrupts its signature, reproduces provider rejection, exercises the patched durable repair, and verifies a later replay succeeds. Is this the best way to solve the issue? Yes, subject to explicit policy acceptance. The PR extends the existing request-local recovery through the canonical transcript rewrite and runner refresh paths, and a narrower repair is not available from the current provider error because it does not identify the rejected block. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f385491c230c. Label changesLabel justifications:
Evidence reviewedPR surface: Source +181, Tests +459. Total +640 across 7 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
* fix: repair rejected Anthropic thinking replay * fix: narrow recovered retry result * test: satisfy thinking recovery lint * test: prove thinking retry preserves fresh reasoning * test: type narrow thinking retry proof
* fix: repair rejected Anthropic thinking replay * fix: narrow recovered retry result * test: satisfy thinking recovery lint * test: prove thinking retry preserves fresh reasoning * test: type narrow thinking retry proof
Summary
Reviewers should focus on the recovery gate in
thinking.ts, the active-branch rewrite helper, and the runner hook that refreshes in-memory session state after repair.Linked context
Closes #91983
Related: maintainer-requested investigation and live Crabbox reproduction of invalid Anthropic thinking-signature replay.
Real behavior proof (required for external PRs)
cbx_310989ad2e4dwith live Anthropicclaude-sonnet-4-6API call.thinkingSignature, reproduced provider rejection, then exercisedwrapAnthropicStreamWithRecoveryplusrepairRejectedThinkingReplayInSessionManagerand replayed the repaired transcript again.REGRESSION_REPRO stopReason=error rejectedInvalidThinkingSignature=truefrom the same live proof script.Tests and validation
.agents/skills/autoreview/scripts/autoreview --mode localautoreview clean: no accepted/actionable findings reported.node scripts/run-vitest.mjs src/agents/embedded-agent-runner/thinking.test.ts src/agents/embedded-agent-runner/thinking-replay-repair.test.ts src/agents/embedded-agent-runner/transcript-rewrite.test.ts --reporter=verboseRegression coverage added:
Risk checklist
Did user-visible behavior change? (
Yes/No): YesDid config, environment, or migration behavior change? (
Yes/No): NoDid security, auth, secrets, network, or tool execution behavior change? (
Yes/No): NoWhat is the highest-risk area?
Persisted session branch rewrite after a provider replay rejection.
How is that risk mitigated?
Repair only runs after the thinking-signature recovery path and only after the stripped retry returns a successful assistant result. It uses the existing transcript rewrite helper and preserves visible assistant content, falling back to the existing omitted-reasoning placeholder for thinking-only turns.
Current review state
Next action: watch CI and fix any failures related to this branch.
Still waiting on: CI.
Which bot or reviewer comments were addressed? None yet.