Repository navigation
Description
Description
opencode run returns an opaque server error when the configured default model becomes deprecated.
OpenCode documentation directs users to models.dev for built-in provider and model IDs. I selected x-preview-f-free from the OpenCode Zen provider page and configured it using the documented provider_id/model_id format:
"model": "opencode/x-preview-f-free"This model worked previously. It is still displayed on the models.dev OpenCode Zen provider page with no visible deprecation warning, but its current API entry contains:
"status": "deprecated"After the model became deprecated, opencode run began failing with:
Error: {
"name": "UnknownError",
"data": {
"message": "Unexpected server error. Check server logs for details.",
"ref": "err_1024fb4c"
}
}
Expected behavior
OpenCode should validate the configured model against the refreshed catalog before creating the session.
If the model is deprecated or unavailable, the CLI should return a specific error such as:
Configured model opencode/x-preview-f-free is deprecated or unavailable. Select another model with opencode models.
It should not return an internal HTTP 500 or direct CLI users to unspecified server logs.
OpenCode should not silently select another model because that could unexpectedly use a paid model.
The models.dev OpenCode Zen provider page also displays this model without showing its deprecated status. Because OpenCode documentation directs users to models.dev for model IDs, provider pages should clearly label deprecated models. I placed the resulting model ID in ~/.config/opencode/opencode.jsonc.
Environment
- OpenCode 1.18.25
- Fish 4.8.1
- Provider: OpenCode Zen
- Model:
opencode/x-preview-f-free - Catalog page: https://models.dev/providers/opencode/
Related issues
- opencode run exits with "unexpected server error" #33766
- [BUG] "Model x-preview-f-free is not supported" #45395
- Hy3 outdated availability in opencode zen models.dev#3850
Plugins
Local oc-supermemory-redux (.js bundle), local WakaTime (.js bundle)
OpenCode version
1.18.25
Steps to reproduce
Reproduction
Add the following to ~/.config/opencode/opencode.jsonc:
{
"$schema": "https://opencode.ai/config.json",
"model": "opencode/x-preview-f-free" \\or any deprecated model
}Then run:
opencode models --refresh
opencode run "test"CLI impact
I normally call opencode run through this Fish function:
function ? --wraps='opencode run' --description 'alias ?=opencode run'
opencode run $argv
endA previously working command such as this now fails:
? 'test'The wrapper is not the cause. It directly passes its string arguments to opencode run. properly encapsulated in single quotations for fish shell compatibility.
This also affects scripts and other noninteractive uses of the CLI because the error does not identify the configured model as the problem.
Screenshot and/or share link
https://opncd.ai/share/fgqcdZ1l
Operating System
Garuda Linux x86_64 (Arch-based)
Terminal
Yakuake 26.08.0 with Fish 4.8.1
Activity
github-actions commentedon Sep 2, 2026
This issue might be a duplicate of an existing issue. Please check:
Drewlius commentedon Sep 2, 2026
This is related to #46425, but the affected entrypoint and recovery path are different.
#46425 occurs in the interactive TUI, where the user can switch models and continue the session. This issue affects the noninteractive
opencode runcommand. The process exits immediately, returns control to the shell, and provides no actionable explanation.The available workarounds are to override the model on every invocation:
opencode run --model provider/model "prompt"or edit the default model in opencode.jsonc.
This affects shell functions, scripts, and automation using opencode run. A fix limited to model switching or error handling inside the TUI would not fix the CLI path. The CLI needs to validate the configured model and return a clear error before attempting the request.
lancy69 commentedon Sep 2, 2026
I'd like to work on this. My understanding is that the CLI should validate the configured default model against the refreshed catalog before creating the session, and return a specific "model is deprecated or unavailable" error instead of an opaque 500, without silently falling back to another model. Validation would be a repro with a deprecated model in
opencode.jsoncplus tests for the new error path.One question first: should this be fixed alongside #46425 with a shared validation/error path, or is the noninteractive
opencode runentrypoint enough for a first PR?Drewlius commentedon Sep 6, 2026
I would like the see the PR merged from @Woolgathererer if it is reviewed and approved by maintainers and compliance with anomalyco/opencode standards.
thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊
Drewlius commentedon Oct 11, 2026
Yeah I did upgrade a week or so ago. Haven't seen this specific issue resurface but if I do I will make another report. Thanks for helping maintain this tool. I appreciate y'all's hard work and dedication to the project and FOSS in general.