Repository navigation
Commit a7dd239
fix(models): give toggle-kind models a thinking control in the CLI
GLM, Kimi and Qwen models had no way to turn thinking on or off from the CLI,
while the web app and workspace handled them correctly. The recorded conclusion
was that fixing it needed an upstream change or a 16th overlay patch. That was
wrong, and the wrong note is why it sat for a day.
Upstream's reasoningToggle handles only @ai-sdk/alibaba and @ai-sdk/cohere and
returns {} for everything else, openai-compatible included
(transform.ts:1707-1715). An empty variant set falls back to the id heuristics
in variants(), which blocklist glm, kimi and qwen outright (:781-793). So
declaring `toggle` honestly is worse than declaring nothing at all: it routes
straight into a blocklist.
reasoningVariants takes the `effort` arm before the toggle arm (:1662), and
effort IS implemented for openai-compatible. A toggle is two states, so it is
now declared as effort with values [null, "high"]. Upstream maps null to its
"none" variant; Fylun's gateway maps "none" to thinking-off at translate.ts:275
— checked before any effort normalisation — and anything else to on. Verified
against the pinned upstream ProviderTransform: all eight toggle models now
yield {none:{reasoningEffort:"none"}, high:{reasoningEffort:"high"}}.
The registry still says toggle, which is true. Only the advertised wire
vocabulary changed, to the one upstream can act on.
The comment that blocked this claimed nulls could not be emitted because the
gateway "would normalise UP to the strongest level rather than off". False —
explicitlyOff short-circuits first. Replaced with what actually happens.
Budget-kind models still fall to the heuristics and get low/medium/high instead
of their declared min/max. Controllable, so a fidelity gap rather than a
missing control; noted in the README rather than worked around.
Upstream: anomalyco/opencode#42793 is open against v1.18.18, the version pinned
here, and a one-line PR #44064 was closed unmerged by a bot on a template
technicality. The hole affects 634 models across 88 providers, so it is worth
commenting on — but nothing here waits on it now.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01CfMxUBzUH4UP3reJ71j59K1 parent e41940c commit a7dd239
4 files changed
Lines changed: 158 additions & 82 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
99 | 126 | | |
100 | 127 | | |
101 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | | - | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
285 | 289 | | |
286 | 290 | | |
287 | 291 | | |
| |||
317 | 321 | | |
318 | 322 | | |
319 | 323 | | |
320 | | - | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
321 | 329 | | |
322 | 330 | | |
323 | 331 | | |
| |||
846 | 854 | | |
847 | 855 | | |
848 | 856 | | |
849 | | - | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
850 | 862 | | |
851 | 863 | | |
852 | 864 | | |
| |||
877 | 889 | | |
878 | 890 | | |
879 | 891 | | |
880 | | - | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
881 | 897 | | |
882 | 898 | | |
883 | 899 | | |
| |||
908 | 924 | | |
909 | 925 | | |
910 | 926 | | |
911 | | - | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
912 | 932 | | |
913 | 933 | | |
914 | 934 | | |
| |||
939 | 959 | | |
940 | 960 | | |
941 | 961 | | |
942 | | - | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
943 | 967 | | |
944 | 968 | | |
945 | 969 | | |
| |||
1058 | 1082 | | |
1059 | 1083 | | |
1060 | 1084 | | |
1061 | | - | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
1062 | 1090 | | |
1063 | 1091 | | |
1064 | 1092 | | |
| |||
1089 | 1117 | | |
1090 | 1118 | | |
1091 | 1119 | | |
1092 | | - | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
1093 | 1125 | | |
1094 | 1126 | | |
1095 | 1127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | | - | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
285 | 289 | | |
286 | 290 | | |
287 | 291 | | |
| |||
317 | 321 | | |
318 | 322 | | |
319 | 323 | | |
320 | | - | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
321 | 329 | | |
322 | 330 | | |
323 | 331 | | |
| |||
846 | 854 | | |
847 | 855 | | |
848 | 856 | | |
849 | | - | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
850 | 862 | | |
851 | 863 | | |
852 | 864 | | |
| |||
877 | 889 | | |
878 | 890 | | |
879 | 891 | | |
880 | | - | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
881 | 897 | | |
882 | 898 | | |
883 | 899 | | |
| |||
908 | 924 | | |
909 | 925 | | |
910 | 926 | | |
911 | | - | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
912 | 932 | | |
913 | 933 | | |
914 | 934 | | |
| |||
939 | 959 | | |
940 | 960 | | |
941 | 961 | | |
942 | | - | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
943 | 967 | | |
944 | 968 | | |
945 | 969 | | |
| |||
1058 | 1082 | | |
1059 | 1083 | | |
1060 | 1084 | | |
1061 | | - | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
1062 | 1090 | | |
1063 | 1091 | | |
1064 | 1092 | | |
| |||
1089 | 1117 | | |
1090 | 1118 | | |
1091 | 1119 | | |
1092 | | - | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
1093 | 1125 | | |
1094 | 1126 | | |
1095 | 1127 | | |
| |||
20009 | 20041 | | |
20010 | 20042 | | |
20011 | 20043 | | |
20012 | | - | |
20013 | | - | |
20014 | | - | |
| 20044 | + | |
| 20045 | + | |
| 20046 | + | |
20015 | 20047 | | |
20016 | 20048 | | |
20017 | 20049 | | |
| |||
21686 | 21718 | | |
21687 | 21719 | | |
21688 | 21720 | | |
21689 | | - | |
21690 | | - | |
21691 | | - | |
| 21721 | + | |
| 21722 | + | |
| 21723 | + | |
21692 | 21724 | | |
21693 | 21725 | | |
21694 | 21726 | | |
| |||
21730 | 21762 | | |
21731 | 21763 | | |
21732 | 21764 | | |
21733 | | - | |
21734 | | - | |
21735 | | - | |
| 21765 | + | |
| 21766 | + | |
| 21767 | + | |
21736 | 21768 | | |
21737 | 21769 | | |
21738 | 21770 | | |
| |||
21774 | 21806 | | |
21775 | 21807 | | |
21776 | 21808 | | |
21777 | | - | |
| 21809 | + | |
21778 | 21810 | | |
21779 | 21811 | | |
21780 | | - | |
21781 | | - | |
21782 | | - | |
| 21812 | + | |
| 21813 | + | |
| 21814 | + | |
21783 | 21815 | | |
21784 | 21816 | | |
21785 | 21817 | | |
| |||
22108 | 22140 | | |
22109 | 22141 | | |
22110 | 22142 | | |
22111 | | - | |
22112 | | - | |
22113 | | - | |
| 22143 | + | |
| 22144 | + | |
| 22145 | + | |
22114 | 22146 | | |
22115 | 22147 | | |
22116 | 22148 | | |
| |||
30915 | 30947 | | |
30916 | 30948 | | |
30917 | 30949 | | |
30918 | | - | |
| 30950 | + | |
30919 | 30951 | | |
30920 | 30952 | | |
30921 | 30953 | | |
30922 | 30954 | | |
30923 | | - | |
| 30955 | + | |
30924 | 30956 | | |
30925 | 30957 | | |
30926 | 30958 | | |
| |||
33350 | 33382 | | |
33351 | 33383 | | |
33352 | 33384 | | |
33353 | | - | |
| 33385 | + | |
33354 | 33386 | | |
33355 | 33387 | | |
33356 | 33388 | | |
33357 | 33389 | | |
33358 | 33390 | | |
33359 | 33391 | | |
33360 | 33392 | | |
33361 | | - | |
33362 | | - | |
33363 | | - | |
33364 | | - | |
33365 | | - | |
33366 | | - | |
33367 | | - | |
33368 | | - | |
33369 | | - | |
33370 | | - | |
33371 | | - | |
33372 | | - | |
33373 | | - | |
33374 | | - | |
33375 | | - | |
33376 | | - | |
33377 | | - | |
33378 | | - | |
33379 | | - | |
33380 | | - | |
33381 | | - | |
33382 | | - | |
33383 | | - | |
33384 | | - | |
33385 | | - | |
33386 | | - | |
33387 | | - | |
33388 | | - | |
33389 | | - | |
33390 | | - | |
33391 | | - | |
33392 | 33393 | | |
33393 | 33394 | | |
33394 | 33395 | | |
| |||
33412 | 33413 | | |
33413 | 33414 | | |
33414 | 33415 | | |
33415 | | - | |
| 33416 | + | |
33416 | 33417 | | |
33417 | 33418 | | |
33418 | 33419 | | |
| |||
0 commit comments