Repository navigation
Commit 95d0fca
committed
fix(opencode-go): fetch models unconditionally — the /models endpoint is public
The Opencode Go model fetch in `requestRouterModels` was gated behind
`if (opencodeGoApiKey)` on the assumption that its `/models` endpoint requires
auth. It does not: the endpoint returns the full model list (HTTP 200) with no
Authorization header. Gating meant `routerModels["opencode-go"]` stayed `{}`
whenever the key wasn't present in `apiConfiguration` at fetch time, so the
model picker showed an empty list, fell back to the hardcoded default
(`glm-5.1`), and offered no model to select.
Fetch Opencode Go unconditionally like the other public routers
(`openrouter`, `vercel-ai-gateway`), forwarding the API key when present and
still flushing the cache when a new key is supplied. Updates the affected
`requestRouterModels` tests and adds a regression test for the keyless path.1 parent f1f7cb4 commit 95d0fca
2 files changed
Lines changed: 48 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
| 360 | + | |
| 361 | + | |
360 | 362 | | |
361 | 363 | | |
362 | 364 | | |
| |||
371 | 373 | | |
372 | 374 | | |
373 | 375 | | |
374 | | - | |
| 376 | + | |
375 | 377 | | |
376 | 378 | | |
377 | 379 | | |
378 | 380 | | |
379 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
380 | 411 | | |
381 | 412 | | |
382 | 413 | | |
| |||
458 | 489 | | |
459 | 490 | | |
460 | 491 | | |
461 | | - | |
| 492 | + | |
462 | 493 | | |
463 | 494 | | |
464 | 495 | | |
| |||
481 | 512 | | |
482 | 513 | | |
483 | 514 | | |
| 515 | + | |
484 | 516 | | |
485 | 517 | | |
486 | 518 | | |
| |||
514 | 546 | | |
515 | 547 | | |
516 | 548 | | |
517 | | - | |
| 549 | + | |
518 | 550 | | |
519 | 551 | | |
520 | 552 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1013 | 1013 | | |
1014 | 1014 | | |
1015 | 1015 | | |
1016 | | - | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
1017 | 1021 | | |
1018 | 1022 | | |
1019 | | - | |
1020 | | - | |
1021 | | - | |
1022 | | - | |
1023 | | - | |
1024 | | - | |
1025 | | - | |
1026 | | - | |
1027 | | - | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
1028 | 1026 | | |
1029 | 1027 | | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
1030 | 1033 | | |
1031 | 1034 | | |
1032 | 1035 | | |
| |||
0 commit comments