anomalyco / anomalyco/opencode
Windows: TLS ClientHello never sent (0 bytes even to localhost), all threads deadlock — opencode hangs forever
Open
@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
- TCP connects, but TLS never starts (0 bytes). While hung,
netstatshows 4 ESTABLISHED connections from opencode to Cloudflare IPv62606: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. - Same with a local HTTPS server. Pointing the provider
baseURLtohttps://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. - Threads deadlock. While hung, all 30 threads are
Waitingand CPU increases only ~0.08s over 3s — waiting on an event that never fires, not busy-looping. - Same bun version works standalone.
opencode.exeembeds Bun1.3.14(extracted from the binary) — same as the systembun 1.3.14. With that bun, plainfetchANDimport('undici').fetchtohttps://opencode.ai/zen/v1/modelsboth return HTTP 200 instantly. - curl / node work.
curl(IPv4, IPv6, direct, via proxy) andnode fetchto 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
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.