Skip to content

opencode run hangs after 'event connected' — no model request ever made (DeepSeek, Linux) #44782

Description

@hunamy-git

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.json apiKey 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

  1. Install opencode 1.18.21 (official installer).
  2. Configure DeepSeek provider (or use DEEPSEEK_API_KEY env).
  3. Run: opencode run 'Respond with exactly: OK'
  4. 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/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).

Activity

github-actions commented on Aug 24, 2026

@github-actions
Contributor

This issue might be a duplicate of or related to existing issues. Please check:

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.

z80690 commented on Aug 31, 2026

@z80690

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions