r/opencode • • 28d ago

ECONNREFUSED: Unable to connect. - opencode-go issue

Post image

Does anyone had this issue?

When i start opencode and use go models i always get this error. It looks like i have connection problem. Free models from opencode just work fine, its only happend to opencode-go provider.

I fix this issue by open hermes and use an opencode-go model and send a chat to GO model, only after that, the connection issue gone automatically and opencode can continue.

I never had this issue with hermes.

13 Upvotes

13 comments sorted by

1

u/Unlucky-Ad-8571 28d ago

Same here. The site is inaccessible too.

1

u/Outrageous_Bus9018 28d ago

Do you use another CLI agent to solve like i did or you have different way?

2

u/MLGSW4G 28d ago

Not a Russian-IP block on OpenCode's side, I think. From a Rostelecom line right now, curl.exe to https://opencode.ai/inference/v1/models returns 200 while the browser can't load the site — so the connection dies inside the TLS handshake, before any HTTP request reaches the server. A geo-block would answer with an error, not reset the handshake.

Your case looks like a different failure though: ECONNREFUSED plus only Go models failing. Could you check four things?

  1. ISP and city?
  2. curl.exe -sS -o NUL -w "%{http_code}" https://api.opencode.ai/ — 200, or refused?
  3. Do you have HTTPS_PROXY / HTTP_PROXY set?
  4. When Go fails, do the free models still work in the same session?

The Hermes workaround is the interesting part — if another client reliably cures it, that smells like a token/auth refresh rather than the network.

1

u/Unlucky-Ad-8571 28d ago

I think OpenCode has started blocking access to Russian IP addresses.

3

u/YSX56 28d ago

confirmed, same error. But yeah u/MLGSW4G is right, opencode works like before with vpn without some 403 forbidden or access denied error so its RKN bullshit

1

u/MLGSW4G 28d ago

Your Hermes observation is the useful clue. Hermes is Python, so it uses OpenSSL with a classical ClientHello. OpenCode 2.x embeds Bun, which since 1.4.1 offers a post-quantum key share (~1.5 KB). On lines where the DPI drops that shape for opencode.ai, Hermes passes and OpenCode fails — that matches what you're seeing.

Whether Hermes actually fixes it is worth testing separately: leave Hermes alone and retry opencode every few minutes. If it recovers by itself, the filter is keeping some per-name state; if it stays broken until Hermes connects, that's a different mechanism.

Which opencode and Hermes versions are you on? And ISP/city? Also, what does curl.exe -sS -o NUL -w "%{http_code}" https://api.opencode.ai/ return — 200 or refused?

1

u/Outrageous_Bus9018 28d ago edited 28d ago
rjnat@TERMINATOR:~$ hermes --version
Hermes Agent v0.22.5 (2026.9.24) · stable · local bf0203a794a0
Install directory: /home/rjnat/.hermes/hermes-agent
Install method: git
Python: 3.14.9
OpenAI SDK: 2.24.0
Up to date

------------------------

rjnat@TERMINATOR:~$ opencode --version
opencode v2.2.2

------------------------

C:\Users\rjnat> curl.exe -sS -o NUL -w "%{http_code}" https://api.opencode.ai/
200

------------------------

City: Jakarta, Indonesia

1

u/MLGSW4G 28d ago

Thanks — that rules out the explanations above (Jakarta, and api.opencode.ai is 200 for you).

One confound though: your versions were checked in WSL, but the curl ran on Windows (C:\Users\rjnat>). Those are different network stacks, so that 200 doesn't prove WSL can reach it. Inside WSL, please run:

curl -sS -o /dev/null -w "%{http_code}\n" https://api.opencode.ai/
env | grep -i proxy
curl -6 -sS -o /dev/null -w "%{http_code}\n" https://api.opencode.ai/

Also run opencode with --print-logs and share the lines around the failure. Since free models work in the same client, the path to opencode.ai is fine — a Go-only ECONNREFUSED looks more like a preflight/auth request failing, or WSL resolving the host differently (IPv6, proxy variables).

Worth its own thread with those results; this doesn't look like the handshake drops other people in this thread are hitting.

1

u/DesignAlternative622 28d ago

It's not a geo-block. Works fine on RU VPN's. I think you have MTS, Rostelekom or other "mobile" provider, that sometimes includes whitelists (белые списки) for websites. Right now is one of these times.

1

u/MLGSW4G 28d ago

Whitelists filter by destination, so they can't produce this: same host, same second, curl returns 200 while Chrome and the CLI reset. I measured exactly that on a Rostelecom line. The split follows the TLS ClientHello — Chrome and Bun (embedded in OpenCode 2.x) offer a post-quantum key share, ~1.5 KB, while Windows curl sends ~440 B and passes. It works over a Russian VPN because the rule sits on the ISP path, not on the destination.

1

u/Capable_Candle514 28d ago

same here a ny solution

0

u/Ariquitaun 28d ago

It's not just you, the API has been glitchy for a few days with relatively frequent timeouts and random errors.