anomalyco / anomalyco/opencode
When connecting to an independently deployed model, some projects will continue to report ECONNRESET errors even for new sessions
@rekram1-node is already working on this.
Since Aug 29, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
A new session with a custom model starts successfully, but after reading a few files it consistently reports an ECONNRESET error, regardless of the question asked.
The context size is configured at 200,000 tokens, and the total size of the files read is far below this context limit, so the context window should not be the cause. The error persists even after the initial file reading phase, affecting every subsequent turn.
It can be confirmed that some projects can also be successfully used in contexts exceeding 190000, so the backend VLLM can be determined to be a normal 200000 configuration. Currently, in my environment, only one project is not working, even if it cannot be used every time a new meeting is held. The other projects are normal, and if needed, I can provide the package for that project.
Key observations:
✅ Session initially succeeds; failure only appears after reading files.
❌ Once triggered, the ECONNRESET error is consistent and reproducible with any question.
✅ Switching to another official model with the same 200,000 context size works successfully.
❌ The custom model consistently fails.
This strongly suggests the issue is specific to the custom model (or its serving/provider path), not the context size or the general session configuration. The ECONNRESET appears to be a transport-layer reset triggered during the custom model's response/streaming, which either is classified as a non-retryable hard error or is not recovered by the session retry path, causing the assistant turn to end in error.
This is a different layer from #21893 (provider/stream-layer stream_read_error and wrapped rate-limit errors) and from #20822 (a broader "retry UnknownError by default" strategy). This issue is specifically about consistent transport/socket-level (ECONNRESET) failures occurring with a custom model after file reading.
Plugins
None
OpenCode version
1.18.25
Steps to reproduce
Configure the context size to 200,000 tokens.
Start a new session using the custom model (the session initially works).
Read a few files whose total size is far below the 200,000-token context limit.
Ask any question to the assistant.
Observe that a consistent ECONNRESET error is reported.
Try different questions — verify the error persists regardless of the question.
Switch to an official model with the same 200,000 context size and repeat — confirm it works successfully.
Switch back to the custom model — confirm the error returns.
Screenshot and/or share link
No response
Operating System
Windows 11
node 22/24/26 all tried
Terminal
opencode-desktop and opencode cli
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.