Repository navigation
fix(sse): recover invalid Anthropic thinking signatures once - #7906
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
bdd70b1 to
0beb168
Compare
158d9d8 to
9054c6b
Compare
9054c6b to
ce8acf8
Compare
|
Reviewed #7906 against This is a clean, well-scoped fix. The recovery is correctly bounded: it only fires on the exact Anthropic I checked out the branch and ran the new test suite plus the two adjacent suites named in the PR body:
The Two small optional suggestions, neither blocking:
CI is fully green and the PR is mergeable against |
d3f8bbe
into
cheaper-inference:release/v3.8.49
|
Merged — thanks! CI green on the current tip. (Merged on real GitHub CI; a parallel monaco 0.56 bump had left the local validation box with stale node_modules, unrelated to this PR.) |
…bare-model autopick Scopes the Antigravity 404 model-not-found lockout to the exact model (not the whole family) so one missing bare model no longer hijacks the family cooldown, plus bare-model autopick via resolveModelByProviderInference dedup. The thinking-signature-recovery portion was dropped — cheaper-inference#7899 is already fixed and merged on the release via cheaper-inference#7906. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
…bare-model autopick (#8050) Scopes the Antigravity 404 model-not-found lockout to the exact model (not the whole family) so one missing bare model no longer hijacks the family cooldown, plus bare-model autopick via resolveModelByProviderInference dedup. The thinking-signature-recovery portion was dropped — #7899 is already fixed and merged on the release via #7906. Co-authored-by: AndrianBalanescu <AndrianBalanescu@users.noreply.github.com> Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
…bare-model autopick (cheaper-inference#8050) Scopes the Antigravity 404 model-not-found lockout to the exact model (not the whole family) so one missing bare model no longer hijacks the family cooldown, plus bare-model autopick via resolveModelByProviderInference dedup. The thinking-signature-recovery portion was dropped — cheaper-inference#7899 is already fixed and merged on the release via cheaper-inference#7906. Co-authored-by: AndrianBalanescu <AndrianBalanescu@users.noreply.github.com> Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
…bare-model autopick (cheaper-inference#8050) Scopes the Antigravity 404 model-not-found lockout to the exact model (not the whole family) so one missing bare model no longer hijacks the family cooldown, plus bare-model autopick via resolveModelByProviderInference dedup. The thinking-signature-recovery portion was dropped — cheaper-inference#7899 is already fixed and merged on the release via cheaper-inference#7906. Co-authored-by: AndrianBalanescu <AndrianBalanescu@users.noreply.github.com> Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
Related issue
Fixes #7899
Summary
Anthropic can reject a historical extended-thinking block with
400 Invalid signature in thinking block. This change performs a bounded recovery after that exact validation failure instead of removing thinking eagerly from every request.Why recovery is conditional
Eager removal changes valid same-model requests, alters prompt-cache shape, and can modify Claude Code tool-use history unnecessarily. This patch leaves valid traffic untouched and changes the request only after Anthropic explicitly rejects a signature.
A trailing active cycle can contain several interleaved
assistant[thinking, tool_use]→user[tool_result]pairs. Those assistant turns are preserved verbatim. If no completed historical thinking can be removed safely, no recovery retry is sent.Recovery is not triggered for:
If the recovery attempt fails, the response continues through the normal error-classification path without another recovery attempt.
Tests
node --import tsx/esm --test tests/unit/anthropic-thinking-signature-recovery.test.ts tests/unit/claude-passthrough-thinking-2454.test.tsnode --import tsx/esm --test tests/unit/chatcore-translation-paths.test.tsnpm run typecheck:corenpm run lint