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
Bug]: Persistent ECONNRESET on Windows with VPN/Proxy and Telegram Bot integration (connection drops after initial response) #60642
Describe the bug
OpenCode consistently fails with a ECONNRESET error across all models. The connection appears to establish initially (the model starts generating a response), but the socket is suddenly closed unexpectedly. This happens both in the desktop UI and when using the Telegram bot integration (opencode-telegram.service).
The error message:
ECONNRESET: The socket connection was closed unexpectedly. For more information, pass 'verbose: true' in the second argument to fetch()
The app attempts to retry (e.g., "Attempt 2 — retrying") but ultimately fails.
Thanks for the report! ECONNRESET has several possible causes, and a lot of reports came in this week, so we need a few details to work out which one you're hitting:
Your OpenCode version (opencode --version, or the version shown in the desktop app), your Windows version, and how you installed OpenCode.
The provider and model you're using (for example the built-in free OpenCode Zen models, OpenCode Go, or your own API key with a provider).
VPN/proxy: does it fail with the VPN on, with it off, or both? Is HTTP_PROXY/HTTPS_PROXY set, or does the VPN route all traffic (TUN mode)? Roughly where in the world are you, and which ISP do you use?
When it drops: you said the model starts answering and then the connection closes. Does that happen within seconds, or only on longer responses or tasks? Does a short prompt like hi work?
Does it also happen in the plain TUI or with opencode run "hi", without the Telegram bot? (The Telegram integration looks like a third-party project, so it helps to rule it out.)
Any logs from around the failure, if you can get them.
You can reply here with the details or edit the issue. If you edit it, please also leave a short comment saying you've updated it, so we know you're done.
These existing issues may be related, ordered from most to least likely. Please check whether one of them already covers your problem:
We haven't heard back, so I'm closing this issue for now. We still needed your OpenCode version, the provider and model, whether it fails with the VPN/proxy on, off or both, and whether it also happens without the Telegram bot. Without those we can't tell which cause of ECONNRESET you're hitting.
If the connection fails before any response, on a network where a VPN makes it work, #60399 most likely covers it. You can follow that issue instead.
If it still happens and it's a different problem, please reply here with those details or open a new issue, and we'll take another look. Thanks!
Activity
opencodejr commentedon Oct 30, 2026
Thanks for the report!
ECONNRESEThas several possible causes, and a lot of reports came in this week, so we need a few details to work out which one you're hitting:opencode --version, or the version shown in the desktop app), your Windows version, and how you installed OpenCode.HTTP_PROXY/HTTPS_PROXYset, or does the VPN route all traffic (TUN mode)? Roughly where in the world are you, and which ISP do you use?hiwork?opencode run "hi", without the Telegram bot? (The Telegram integration looks like a third-party project, so it helps to rule it out.)You can reply here with the details or edit the issue. If you edit it, please also leave a short comment saying you've updated it, so we know you're done.
These existing issues may be related, ordered from most to least likely. Please check whether one of them already covers your problem:
ECONNRESETor hangs on some networks (mostly Russian ISPs, since Oct 29–30) because the TLS handshake is dropped; works with a VPN. In that case the connection fails before any response, though.ECONNRESETthat shows up mostly on complex or long-running tasks, after the model has been working for a while.ECONNRESETwithout a VPN, works with one (being handled as duplicates of cli: hangs before sending request on networks that drop fragmented TLS ClientHello (post-quantum key share) #60399).verbose: truein the second argument to fetch() #60620:ECONNRESETboth with and without a VPN, from Russia.d1m40fficial commentedon Oct 30, 2026
https://github.com/d1m40fficial/opencode-dpi-fix - Try this; it works for me.
opencodejr commentedon Nov 2, 2026
We haven't heard back, so I'm closing this issue for now. We still needed your OpenCode version, the provider and model, whether it fails with the VPN/proxy on, off or both, and whether it also happens without the Telegram bot. Without those we can't tell which cause of
ECONNRESETyou're hitting.If the connection fails before any response, on a network where a VPN makes it work, #60399 most likely covers it. You can follow that issue instead.
If it still happens and it's a different problem, please reply here with those details or open a new issue, and we'll take another look. Thanks!