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
opencode crashes on boot when models.dev is unreachable with no cache #35713
If models.dev is unreachable and there's no local cache yet (fresh install, or cache cleared), opencode crashes on boot instead of degrading gracefully. The server dies mid-bootstrap and the TUI just shows:
Error: Unexpected server error. Check server logs for details.
and exits. Nothing in the UI, no toast, no partial startup - it just closes.
Log on the server side stops dead right after the fetch fails, nothing after it:
timestamp=2026-07-07T11:32:22.844Z level=INFO run=c20bd434 message=init
timestamp=2026-07-07T11:32:22.9xxZ level=ERROR run=c20bd434 message="Failed to fetch models.dev" cause="Cause([Fail(HttpClientError: Transport error (GET .../api.json) (cause: Error: Unable to connect. Is the computer able to access the url?))])"
(process exits here, no further log lines)
Looks like populate() in packages/core/src/models-dev.ts pipes the fetch through Effect.orDie, so a plain network failure turns into an unrecoverable defect that kills the whole instance bootstrap rather than just failing to load the catalog.
There's a second related spot: currentModel() in packages/opencode/src/session/prompt.ts also does provider.defaultModel().pipe(Effect.orDie), so if you already have a project with a saved model selection and the catalog ends up empty for the same reason, sending a prompt dies the same way instead of surfacing a normal error.
Plugins
None
OpenCode version
1.17.14
Steps to reproduce
Make sure there's no cached catalog (rm ~/.cache/opencode/models.json or use a fresh XDG_CACHE_HOME)
Point the fetch at something unreachable, e.g. OPENCODE_MODELS_URL=http://127.0.0.1:1
Start opencode in a project directory
It boots, then dies within a couple seconds with the error above
Activity
github-actions commentedon Jul 7, 2026
This issue might be a duplicate of existing issues. Please check:
luiscga commentedon Jul 7, 2026
This is already fixed in PR-35171