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 run hangs after 'event connected' — no model request ever made (DeepSeek, Linux) #44782
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.jsonapiKey and via DEEPSEEK_API_KEY env
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_KEY env).
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.
With --print-logs: nothing after "event connected" — no HTTP request is attempted.
Network verified: curl https://api.deepseek.com/v1/models returns 200 from the same host; models.dev and opencode.ai also 200.
The only successful run was the very first execution right after installation; every subsequent run hangs (even after deleting ~/.local/share/opencode and ~/.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.mjs to 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).
If your issue is distinct from these (your hang is post-event connected and post-session-creation, while #38723 stops before session creation), it may be a separate bug, but the overlap is close enough to be worth reviewing before proceeding.
Same issue on Windows. OpenCode 1.18.25 (also reproduced on 1.18.23 and 1.18.16): opencode run --pure --agent build -m opencode/mimo-v2.5-free "say OK" hangs right after init — ~62 seconds of zero output/error, no session/request to the model provider ever happens, then "cleanup prune=7.days" and the process stays alive until killed. Reproduced in both the project dir and a clean empty dir. TUI mode works fine; only headless run hangs. api.opencode.ai reachable (HTTP 200), 0 credentials in auth. Same as #38723 on this machine. Happy to run any diagnostic you suggest.
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.
Activity
github-actions commentedon Aug 24, 2026
This issue might be a duplicate of or related to existing issues. Please check:
opencode runintermittently hangs during init — no session created, no output, no error (~56% failure rate observed) #38723:opencode runintermittently hangs during init — same symptom of the process stopping with no model request ever sent, no error outputopencode run --agent planhangs at init, before any session is created #42779:opencode run --agent planhangs at init before any session is created — similar silent hang in the run path before a model request is madeIf your issue is distinct from these (your hang is post-
event connectedand post-session-creation, while #38723 stops before session creation), it may be a separate bug, but the overlap is close enough to be worth reviewing before proceeding.z80690 commentedon Aug 31, 2026
Same issue on Windows. OpenCode 1.18.25 (also reproduced on 1.18.23 and 1.18.16):
opencode run --pure --agent build -m opencode/mimo-v2.5-free "say OK"hangs right after init — ~62 seconds of zero output/error, no session/request to the model provider ever happens, then "cleanup prune=7.days" and the process stays alive until killed. Reproduced in both the project dir and a clean empty dir. TUI mode works fine; only headlessrunhangs. api.opencode.ai reachable (HTTP 200), 0 credentials in auth. Same as #38723 on this machine. Happy to run any diagnostic you suggest.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 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊