Repository navigation
sync: tolerate Anthropic's thinking block binding on Claude 5.1+ (three upstream ports) - #132
Merged
Merged
Conversation
…46653) Ported from anomalyco/opencode 3f39a32. Fable 5.1 binds each thinking signature to the system prompt, tool list and messages above it, and rejects the request when any of that changes; we re-render parts of that prefix between turns. The request now asks the API to drop the affected blocks instead of failing, via a patched @ai-sdk/anthropic 3.0.111 and @ai-sdk/amazon-bedrock 4.0.166 that carry the thinking-binding-controls beta, and the processor logs the blocks Anthropic reports dropping. Port notes: the two @ai-sdk versions were bumped here (upstream bumped Bedrock in an earlier commit we had not taken), the lockfile was regenerated rather than patched, and the nested copy under @ai-sdk/google-vertex needed a relink for the override to reach it — the vertex wire test is what showed that. Upstream: 3f39a32
…nomalyco#46820) Ported from anomalyco/opencode 68abdce. Co-authored-by: Aiden Cline <aidenpcline@gmail.com> Upstream: 68abdce
filipeforattini
force-pushed
the
sync/anthropic-thinking
branch
from
September 5, 2026 15:49
790ec29 to
ae3fadd
Compare
filipeforattini
enabled auto-merge (rebase)
September 5, 2026 15:49
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.
First port with the ledger (#131, which this is stacked on). Three upstream commits, each carrying its
Upstream:trailer:3f39a329cfeat: tolerate Anthropic thinking block binding9a71624d2fix: scope thinking binding to Claude 5.1+68abdce1afix: let config opt out of Anthropic thinking blockBindingWhat it does
Fable 5.1 binds each thinking signature to the system prompt, tool list and messages above it, and rejects the request when any of that changes; we re-render parts of that prefix between turns (system prompt, tools, compaction). Requests to Claude 5.1+ —
@ai-sdk/anthropic,@ai-sdk/google-vertex/anthropic,@ai-sdk/amazon-bedrock— now carryblockBinding: { prefixMismatchBehavior: "drop_block" }, which the patched SDKs turn into thethinking-binding-controlsbeta; the processor logs the blocks Anthropic reports dropping so churn in the prefix can be tracked down.blockBinding: falsein the model's provider options opts out.Port notes
@ai-sdk/amazon-bedrockto 4.0.166 in an earlier commit we had not taken, so itspackage.jsonhunks and the lockfile were done by hand — versions bumped, lockfile regenerated, not patched.@ai-sdk/anthropic3.0.111 did not reach the nested copy undergoogle-vertexuntil a clean install; the vertex wire test is what caught it. CI installs clean, so it sees the same tree.bun upstream:portand were committed by it.Tested
test/provider/transform.test.ts: 542 pass, including upstream's new wire tests for direct Anthropic, Vertex, and Bedrock. Provider + processor suites: 586 pass after a cleanbun install --frozen-lockfile. Typecheck clean in redcode and core.bun upstream:statusnow lists 51.https://claude.ai/code/session_014XwJPDhq1ahcm3rd454WzQ
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.