Repository navigation
ECONNRESET: The socket connection was closed unexpectedly. For more information, pass verbose: true in the second argument to fetch() #53829
Description
Activity
Thanks for the report! To look into this we need a bit more detail:
- Provider and model used in the affected session (e.g. OpenCode Zen/Go, Anthropic, OpenAI, or a custom/OpenAI-compatible endpoint, plus any proxy or VPN in between).
- When the error appears: on every message in that session, right after a specific action (reading files, a tool call, an MCP server), or only once the session got long? Does a new session with the same model and project work?
- About how large is the affected session (number of messages, or the context usage shown in the app)?
- Logs from around the time of the error, if you can get them (on macOS:
~/.local/share/opencode/log/), or a screenshot of the error in the app.
You can reply here with the details or edit the issue. If you edit it, please also leave a comment saying you've updated it so we know you're done.
These issues might be related, ordered from most to least likely to be relevant:
- When connecting to an independently deployed model, some projects will continue to report ECONNRESET errors even for new sessions #46088: ECONNRESET that keeps happening in one project/session once files are read into context (custom model)
- ECONNRESET when using Custom Provider: socket connection closed unexpectedly and custom server not detected correctly #51537: ECONNRESET with a custom OpenAI-compatible provider after a few turns
- OpenCode Go: "socket connection was closed unexpectedly" / "unknown certificate verification error" on all models #42479: "socket connection was closed unexpectedly" with OpenCode Go models
- ECONNRESET: #53176: same error message, closed because it lacked details
1
opencode zen
muse spark 1.32
the last message of specific session
can't get past it
tried different models and providers and thinking types3
relatively large
still in context
about 100 messages
at 400k tokens[(tried to upload file)
](url)
its 30mb
tried different log (original)
app error
attached screen shots
Thanks for the details and screenshots! This one is hard to reproduce without a real provider and your session. The connection gets reset while the request for that one long session (about 100 messages, about 400k tokens) is being sent, and it happens no matter which provider or model you pick. That suggests the size or content of the session is the problem, not your network. Our test environment uses a simulated model, so it can't trigger this, and a maintainer with provider access will need to look into it.
Things that would help, if you can:
- An export of the affected session (e.g.
opencode export <sessionID>from the CLI). Remove anything private first. If it's too big to attach, a gist or a zipped file works, or let us know roughly how big it is. - Whether the session contains any very large attachments or tool outputs (big files, images, long command output).
Two things that might get you going again: try compacting/summarizing the session (
/compact), or start a new session and paste in a short summary of where you were. Related reports: #46088 and #51537 (ECONNRESET once a session's requests get large).- An export of the affected session (e.g.
if it also helps
most my plugins are also bugged as of this
I fixed it
by going back a few messages
and forking it
and then hitting compress
it uses a lot of images and tool calls
Description
dunno what this means
ive flushed my dns cache
pinned it to ipv4 pinned it to ipv6
deleted a few things
also bricked most my plugins
only happens on 1 sessions
Plugins
No response
OpenCode version
v2.0.24
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
macis 27
Terminal
opencode desktop gui