Repository navigation
Commit d9932a1
fix(opencode): let config opt out of Anthropic thinking blockBinding
type is "adaptive" or "enabled", on the premise that "models that do not run the
check accept the field, so it is safe on every Claude".
That premise does not hold. Since 1.18.26 shipped, anomalyco#46729 collects the same
failure on three independent surfaces -- AWS Bedrock, Google Vertex, and
Anthropic-compatible proxy endpoints -- all returning:
thinking.adaptive.block_binding: Extra inputs are not permitted
Probing an Anthropic-compatible endpoint directly with curl (no opencode in the
path) narrows it further:
thinking {"type":"adaptive"} -> OK
thinking {"type":"adaptive"} + block_binding -> rejected
thinking {"type":"adaptive"} + block_binding + beta header -> rejected
thinking {"type":"enabled",budget_tokens} + block_binding -> OK
So the field is refused specifically under thinking.adaptive, and sending
thinking-binding-controls-2026-08-01 does not change that.
Because the injection is unconditional there is no way out: affected users must
pin 1.18.25. That is worse on managed installs, where a root-owned config wins
the merge, so overriding options.thinking.type or registering a corrected
provider both fail.
Honour an explicit blockBinding in config instead of always overwriting it:
blockBinding: false -> omit the field entirely
blockBinding: {...} -> use the caller's value
absent (unchanged default) -> inject ANTHROPIC_BLOCK_BINDING as today
Default behaviour is untouched, so deployments that accept the field keep it.
Applies to @ai-sdk/anthropic, @ai-sdk/google-vertex/anthropic, and the bedrock
reasoningConfig path alike.
Tests: 4 added covering opt-out on adaptive, opt-out on a think-by-default model,
preserving an explicit value, and the bedrock path. Verified red/green --
440 pass / 4 fail without the source change, 444 pass / 0 fail with it.1 parent ef27925 commit d9932a1
2 files changed
Lines changed: 52 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
705 | 705 | | |
706 | 706 | | |
707 | 707 | | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
708 | 721 | | |
709 | 722 | | |
710 | 723 | | |
711 | 724 | | |
712 | 725 | | |
713 | 726 | | |
714 | 727 | | |
715 | | - | |
| 728 | + | |
716 | 729 | | |
717 | 730 | | |
718 | 731 | | |
719 | 732 | | |
720 | | - | |
| 733 | + | |
721 | 734 | | |
722 | 735 | | |
723 | 736 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1048 | 1048 | | |
1049 | 1049 | | |
1050 | 1050 | | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
1051 | 1088 | | |
1052 | 1089 | | |
1053 | 1090 | | |
| |||
0 commit comments