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
cli: opencode models prints empty list with exit 0 on a cold server #53724
opencode models silently prints nothing (empty list, exit code 0) when run against a freshly spawned server. Model/provider lists load asynchronously, and the command queries before loading finishes, so it always reports zero models on a cold server.
Environment
opencode version: 2.0.24
OS: Linux x86_64, kernel 6.8.0-110-generic (Ubuntu)
Install/channel: npm global @opencode/cli via nvm-managed Node v25.3.0, channel=latest
Active plugins: none
Reproduction
Disable the shared background service: opencode service set disabled true (or just use --standalone below)
Run opencode models --standalone
Observe: no output at all, exit code 0 (reproduced 3/3 times)
Contrast: start opencode serve --port <port>, wait ~2 minutes, then run opencode models --server http://localhost:<port> — the full model list prints instantly
On the fresh server, GET /api/model returns {"data":[]} right after boot and the complete list a couple of minutes later; /api/provider likewise shows only built-in integrations at first
Expected Behavior
opencode models waits for the initial provider/model load (bounded by a timeout), or prints a warning when the resulting list is empty, instead of silently succeeding with no output.
Actual Behavior
Prints nothing and exits 0. Looks like "no models configured" even though the config is valid.
~/.config/opencode/service.json contains {"disabled": true}, so every CLI invocation spawns a private stdio server and hits the cold-start path. The TUI in the same directory works fine because it stays connected and models finish loading in the background. Slow model-list fetching (network latency) makes the race essentially deterministic here.
Thanks for the detailed report. I can reproduce this on v2.0.24 on Linux with no plugins and a custom @ai-sdk/openai-compatible provider declared in config:
opencode2 models --standalone prints nothing and exits 0 every time.
Against a freshly started opencode2 serve, GET /api/model returns {"data":[]} right after boot, and opencode2 models --server … likewise prints nothing with exit 0.
A few seconds later both return the full list, custom models included.
In my environment the catalog finished loading in about 6 seconds rather than ~2 minutes, likely because of network differences, but it's the same race: the command reads the model list once, before the initial load has finished, and treats an empty result as success. The server-side part (catalog endpoints not waiting for readiness) is also tracked in #36117.
Thanks for the report. We're tracking cold-start model and provider reads returning incomplete catalogs in #36117, so I'm closing this as a duplicate. Please follow that issue for updates.
Activity
github-actions commentedon Oct 7, 2026
This issue might be a duplicate of existing issues. Please check:
opencode models --standaloneinvocation printed no models and exited 0./api/modeland/api/providercan return incomplete catalogs before asynchronous providers and models finish loading.opencode-agent commentedon Oct 7, 2026
Thanks for the detailed report. I can reproduce this on v2.0.24 on Linux with no plugins and a custom
@ai-sdk/openai-compatibleprovider declared in config:opencode2 models --standaloneprints nothing and exits 0 every time.opencode2 serve,GET /api/modelreturns{"data":[]}right after boot, andopencode2 models --server …likewise prints nothing with exit 0.In my environment the catalog finished loading in about 6 seconds rather than ~2 minutes, likely because of network differences, but it's the same race: the command reads the model list once, before the initial load has finished, and treats an empty result as success. The server-side part (catalog endpoints not waiting for readiness) is also tracked in #36117.
fix: support OpenCode v2 alongside v1 (#274)
chore: release v0.48.0 (#278)
neriousy commentedon Oct 20, 2026
Thanks for the report. We're tracking cold-start model and provider reads returning incomplete catalogs in #36117, so I'm closing this as a duplicate. Please follow that issue for updates.