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
opencode2: Model unavailable error for OpenAI-compatible provider despite working API #37531
opencode2 (next) reports "Model unavailable" for 9router provider models configured via aisdk:@ai-sdk/openai-compatible, despite the provider API being reachable and responding correctly.
Environment
opencode version: 0.0.0-next-15747 (next channel)
OS: Linux 6.17.0-1018-oracle aarch64 (Ubuntu 24.04)
Terminal: TERM_PROGRAM=tmux, TERM=tmux-256color
Shell: /bin/bash
Install/channel: next (via volta)
Active plugins: superpowers, oh-my-openagent
Reproduction
Configure 9router provider in ~/.config/opencode/opencode.json:
Run: opencode2 run --model 9router/balanced-fallback "hello"
Expected Behavior
opencode2 should use the model and return a response, since the 9router API is live and responds correctly to both model listing and chat completion requests.
Actual Behavior
Error: Model unavailable: 9router/balanced-fallback
Additional Context
Confirmed the 9router API works: GET /v1/models returns balanced-fallback in the model list, and POST /v1/chat/completions with model: "balanced-fallback" returns streaming completions.
Server logs show previous sessions successfully used 9router/balanced-fallback with llm.runtime=ai-sdk.
The opencode2 models 9router command also fails with ENOENT: no such file or directory, chdir '/home/ubuntu' -> 'models' — a separate bug where "9router" is treated as a directory path instead of a provider name.
The run subcommand in opencode2 does not accept a --model flag (unlike opencode v1), so the model must come from config or background server state.
Activity
github-actions commentedon Jul 17, 2026
This issue might be a duplicate of existing issues. Please check:
undefined/chat/completionsin opencode2 next — sameaisdk:@ai-sdk/openai-compatiblepackage, same next channel, same general failure pattern with custom OpenAI-compatible providersModelUnavailableErrorfor custom providers despite the provider appearing correctly in config — same error message and symptommrofisr commentedon Jul 17, 2026
This appears to be a duplicate of:
aisdk:@ai-sdk/openai-compatiblepackage, same next channel, custom OpenAI-compatible provider failure)ModelUnavailableErrorsymptom)Closing as duplicate. The MCP config and plugins config issues are tracked separately in #37532 and #37533.
mrofisr commentedon Jul 17, 2026
Closed as duplicate of #36834
Mahantor commentedon Oct 16, 2026
i have same problem