You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0306f2b
Browse filesBrowse the repository at this point in the historyBrowse files
fix(opencode-go): fetch models unconditionally — the /models endpoint is public (#437)
* 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.
* test: update ClineProvider.spec.ts assertions for unconditional opencode-go fetch
Mirror changes already made in webviewMessageHandler.spec.ts:
- successful responses: expect opencode-go call, assert mockModels
- individual provider failures: add mockResolvedValueOnce for opencode-go
- skips LiteLLM: assert mockModels instead of empty object
* add refresh button and update coverage
---------
Co-authored-by: Armando Vaquera <[email protected]>
Co-authored-by: Naved Merchant <[email protected]>
0 commit comments