Repository navigation
Commit e7a6408
fix: recognise real OpenCode Go keys, and correct the Go catalog
Two things in the opencode_go/ support were wrong, and both were wrong because
they were written from assumption rather than from the published behaviour. The
docs (opencode.ai/docs/go) and the OpenCode repo itself settle both.
**Go keys are `sk-`, not `oc_`.** The console's `Key.create` produces `sk-` plus
64 characters, and anomalyco/opencode#40343 describes a Go key as "sk-...
API key from the Zen console". `_is_opencode_go_key` only recognised `oc_`, so a
valid Go key saved in a profile was classified as foreign, discarded, and
replaced with a "set OPENCODE_GO_API_KEY" error -- meaning the profile route the
documentation recommends could never work. It appeared to work only because the
environment variable was set.
That fix exposes a design flaw underneath: the guard existed to stop a foreign
profile key reaching the gateway, but Go, OpenAI, Anthropic and DashScope keys
all start with `sk-`, so no prefix can separate them. The shape test is kept
(oc_ is still accepted, and it rejects obvious non-credentials) but it no longer
decides precedence. That is now stated flatly: an explicit
OPENCODE_GO_API_KEY wins, else a Go-shaped profile key, else a loud failure.
The trade-off is deliberate -- a wrongly rejected Go key blocks a working
setup, whereas a genuinely foreign key still produces the gateway's own
"Invalid API key.", which is self-explanatory now that the docs say a Go key
looks like an OpenAI one.
Two tests encoded the old premise (treating `sk-` as the foreign shape) and were
corrected rather than worked around; their docstrings record why, so the change
is not silently reverted. test_go_shaped_profile_key_is_kept is deleted as
redundant: under the flat precedence its scenario is covered in both directions
by the new tests.
**The model lists had drifted.** The Qwen ids were generated with
`range(5, 9)` over `qwen3.{n}-{plus,max}`, which invented models that do not
exist (qwen3.5-plus, qwen3.6-max, qwen3.8-plus) while depending on the range
happening to line up. They are now explicit, transcribed from the endpoint
table: messages = minimax-m2.5/2.7/m3 and qwen3.6-plus, qwen3.7-{plus,max},
qwen3.8-{flash,max}; responses = grok-4.6/4.7, gpt-5.6-luna, gpt-6-luna,
muse-spark-1.2/1.3-contributor. A test asserts the three lists partition the
catalog and that no model appears in two, and every documented chat-completions
model is parametrised through load() so one wrongly classified as unsupported
fails here rather than at request time.
**Vision was a silent downgrade.** LiteLLM has no entry for the
`openai/<go-model>` spelling, so its vision probe reports False for every Go
model, and OI renders images to text descriptions instead of sending them -- no
error to notice. `deepseek-v4-flash-vision-exp` is now answered for explicitly.
The list is one entry because only "vision" in the published name marks a model
as multimodal; claiming vision for a text-only model would just move the failure.
Docs updated: the profile-key path, the `sk-` ambiguity and what to check on
`Invalid API key.`, the corrected endpoint families, and where the live catalog
lives. Suite unchanged at the known baseline of 14.1 parent 717cf2b commit e7a6408
3 files changed
Lines changed: 284 additions & 53 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
247 | 251 | | |
248 | 252 | | |
249 | 253 | | |
| |||
258 | 262 | | |
259 | 263 | | |
260 | 264 | | |
| 265 | + | |
261 | 266 | | |
262 | 267 | | |
263 | 268 | | |
| |||
267 | 272 | | |
268 | 273 | | |
269 | 274 | | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
274 | 287 | | |
275 | 288 | | |
276 | 289 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
78 | 85 | | |
79 | 86 | | |
80 | 87 | | |
81 | 88 | | |
82 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
83 | 93 | | |
84 | | - | |
| 94 | + | |
85 | 95 | | |
86 | 96 | | |
87 | 97 | | |
| |||
94 | 104 | | |
95 | 105 | | |
96 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
97 | 117 | | |
98 | 118 | | |
99 | 119 | | |
| |||
117 | 137 | | |
118 | 138 | | |
119 | 139 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
125 | 156 | | |
126 | | - | |
| 157 | + | |
127 | 158 | | |
128 | 159 | | |
129 | 160 | | |
| |||
865 | 896 | | |
866 | 897 | | |
867 | 898 | | |
868 | | - | |
869 | | - | |
870 | | - | |
871 | | - | |
872 | | - | |
873 | | - | |
874 | | - | |
875 | | - | |
876 | | - | |
877 | | - | |
878 | | - | |
879 | | - | |
880 | | - | |
881 | | - | |
882 | | - | |
883 | | - | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
884 | 916 | | |
885 | 917 | | |
886 | 918 | | |
| |||
894 | 926 | | |
895 | 927 | | |
896 | 928 | | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
897 | 935 | | |
898 | 936 | | |
899 | 937 | | |
| |||
0 commit comments