Description
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
Screenshot and/or share link
No response
Operating System
macOS
Terminal
No response
Description
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:
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:
(process exits here, no further log lines)
Looks like
populate()inpackages/core/src/models-dev.tspipes the fetch throughEffect.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()inpackages/opencode/src/session/prompt.tsalso doesprovider.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
rm ~/.cache/opencode/models.jsonor use a freshXDG_CACHE_HOME)OPENCODE_MODELS_URL=http://127.0.0.1:1Screenshot and/or share link
No response
Operating System
macOS
Terminal
No response