anomalyco / anomalyco/opencode
opencode run hangs after 'event connected' — no model request ever made (DeepSeek, Linux)
Open
@jlongster is already working on this.
Since Aug 24, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Summary
opencode run hangs indefinitely right after the session is created ("event connected" in the log) and no request is ever made to the model provider. The spinner shows the model (> build · deepseek-chat) but the run never completes, even with a valid API key and working network.
Environment
- OS: Linux ubuntu-docker-compose 6.8.0-138-generic x86_64 (Ubuntu)
- opencode: 1.18.21 (also reproduced with 1.17.12)
- node: v18.19.1 (for the 1.17 postinstall test)
- Provider: deepseek (deepseek-chat), API key via config
~/.config/opencode/opencode.jsonapiKeyand viaDEEPSEEK_API_KEYenv - Reproduction environments: (1) a Docker container (restricted, no capabilities) and (2) a bare-metal Ubuntu host — both hang identically
Steps to reproduce
- Install opencode 1.18.21 (official installer).
- Configure DeepSeek provider (or use
DEEPSEEK_API_KEYenv). - Run:
opencode run 'Respond with exactly: OK' - Observe: the command hangs forever; the log stops at
message="event connected".
Expected behavior
opencode run completes and prints the assistant response.
Actual behavior
- The process never exits (killed only by timeout).
- Log tail always ends at:
message=created id=ses_... version=1.18.21 ... model=undefined ...
message="event connected"
- With
--print-logs: nothing after "event connected" — no HTTP request is attempted. - Network verified:
curl https://api.deepseek.com/v1/modelsreturns 200 from the same host;models.devandopencode.aialso 200. - The only successful run was the very first execution right after installation; every subsequent run hangs (even after deleting
~/.local/share/opencodeand~/.cache/opencode).
Notes
- Same behaviour in the official npm binary (1.18.21, bun-compiled) and the 1.17.12 npm package (after running
postinstall.mjsto fetch the real binary). - No crash, no error output — just a silent hang after "event connected".
- This blocks all non-interactive/headless usage (CI, agent orchestration).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.