Repository navigation
fix: drop a broken 5.5 thinking chain - #500
Merged
Merged
Conversation
Opus, Sonnet, and Haiku 5.5 now follow sub2api: one invalid thinking or redacted block removes the whole signed history. A redacted block stays on data, or on a usable signature when data is absent.
A content block with a thinking field and no type is invalid, matching sub2api. On 5.5 it now drops the signed history that follows it.
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.
Summary
Test
Note
Medium Risk
Changes outbound message shaping for Anthropic 5.5 thinking history on the default (non-preserve) path; misclassification could strip valid chains or leave bad blocks, affecting multi-turn adaptive-thinking sessions.
Overview
Release 1.3.183 tightens outbound thinking /
redacted_thinkingsanitization for Opus, Sonnet, and Haiku 5.5, matching sub2api behavior documented indocs/PROTOCOL.md.On 5.5 models,
stripInvalidThinkingBlocksnow treats any non-empty, non-dummy signature as valid (no 24-character cutoff).redacted_thinkingis kept when it hasdata, otherwise when its signature passes the same rules. If history contains one invalid block—including blocks withouttypebut with athinkingfield—the gateway strips the entire signed thinking chain (all laterthinking/redacted_thinking), leaves only visible text, and drops turns that end up empty. When every block is valid, nothing is chain-stripped. Older models still use per-block filtering with the 24-character signature rule;redacted_thinkingwithout long signatures is dropped as before.cli-hop first hop and default HTTP paths that set
preserveThinkingBlocks: trueare unchanged (still pad missingsignaturewithout chain teardown). Unit tests inanthropic-policy,cli-hop-body, andmid-convo-effortcover chain drops, short signatures on 5.5, and preserve-path behavior.Reviewed by Cursor Bugbot for commit cdf8b37. Configure here.