Repository navigation
fix(chatCore): retry after stripping historical thinking on signature 400 - #7929
Closed
AndrianBalanescu wants to merge 1 commit into
Closed
AndrianBalanescu wants to merge 1 commit into
AndrianBalanescu wants to merge 1 commit into
Conversation
… 400 (cheaper-inference#7899) When an Anthropic target returns 400 'Invalid signature in thinking block' (after a routing/model/account change), retry the request once after removing thinking blocks from completed historical assistant turns. The active tool_use → tool_result cycle and the latest assistant message are preserved. The recovery is narrowly scoped: only triggers on the exact 400 validation error, never on generic 400s, 429s, or the 'latest assistant message cannot be modified' error. If no historical thinking can be safely removed, the original error is returned without retrying.
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Contributor
Author
|
Superseded by #7906. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #7899.
When an Anthropic target returns
400 Invalid signature in thinking block(after a routing/model/account change), retry the request once after removing thinking blocks from completed historical assistant turns. The activetool_use→tool_resultcycle and the latest assistant message are preserved.Narrowly scoped: only triggers on the exact 400 validation error, never on generic 400s, 429s, or the separate "latest assistant message cannot be modified" error. If no historical thinking can be safely removed, the original error is returned without retrying.
Tests:
tests/unit/thinking-signature-recovery-7899.test.ts(11 cases covering detection, stripping, tool-use preservation, edge cases).