anomalyco / anomalyco/opencode

Windows: TLS ClientHello never sent (0 bytes even to localhost), all threads deadlock — opencode hangs forever

Open
#39,977 1 comment 0 reactions 1 assignee View on GitHub

@Hona is already working on this.

Since Jul 31, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Bug: On Windows, TLS ClientHello is never sent — process deadlocks (0 bytes even to localhost)

Environment
  • OS: Windows (Git Bash shell)
  • opencode version: 1.18.10 (also tested: 1.18.9, opencode-windows-x64-baseline@1.18.9 — all fail identically)
  • Installed via npm i -g opencode-ai
  • Provider: opencode-go (API key valid — direct curl works in 0.2s)
Symptom

Both TUI and CLI hang forever with no response and no error:

$ opencode run --model opencode-go/deepseek-v4-flash "hi"
> build · deepseek-v4-flash
   (hangs forever)

Log (~/.local/share/opencode/log/opencode.log) stops after llm runtime selected with no error:

message=loop ... step=0
message=stream providerID=opencode-go modelID=deepseek-v4-flash ... agent=title mode=primary
message="llm runtime selected" llm.runtime=ai-sdk llm.provider=opencode-go llm.model=deepseek-v4-flash
(no further log lines)
Evidence
  1. TCP connects, but TLS never starts (0 bytes). While hung, netstat shows 4 ESTABLISHED connections from opencode to Cloudflare IPv6 2606:4700:78::90:0:140-143:443. A CONNECT proxy in between logs the tunnel established, then 0 bytes in both directions — not even a TLS ClientHello.
  2. Same with a local HTTPS server. Pointing the provider baseURL to https://127.0.0.1:8443 (a Python HTTPS server on the same machine, self-signed cert): curl to it works (HTTP 200, request logged), but opencode connects and the server receives zero bytes — ClientHello never sent even to localhost.
  3. Threads deadlock. While hung, all 30 threads are Waiting and CPU increases only ~0.08s over 3s — waiting on an event that never fires, not busy-looping.
  4. Same bun version works standalone. opencode.exe embeds Bun 1.3.14 (extracted from the binary) — same as the system bun 1.3.14. With that bun, plain fetch AND import('undici').fetch to https://opencode.ai/zen/v1/models both return HTTP 200 instantly.
  5. curl / node work. curl (IPv4, IPv6, direct, via proxy) and node fetch to the same endpoints all return HTTP 200 in <0.3s.
Already ruled out
  • No proxy env vars; Windows system proxy disabled (ProxyEnable=0); WinHTTP direct.
  • No antivirus process found; loaded DLLs are all standard system DLLs.
  • API key valid (direct API call works). Config valid (opencode-go/deepseek-v4-flash).
  • Not version-specific: 1.18.10, 1.18.9, and baseline build all behave identically.
Hypothesis

The AI SDK's async TLS handshake never gets scheduled — opencode's event loop is waiting on something internally (deadlock), so the TCP connect completes (synchronous) but the TLS handshake (async) never runs. This looks like a Bun/undici/ai-sdk interaction issue specific to some Windows environments.

Steps to reproduce
npm i -g opencode-ai
opencode auth login   # any provider
opencode run --model opencode-go/deepseek-v4-flash "hi"

Hangs forever, no output, no error.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.