anomalyco / anomalyco/opencode
OpenCode Go: "socket connection was closed unexpectedly" / "unknown certificate verification error" on all models
@fwang is already working on this.
Since Aug 14, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
I'm currently unable to use any model through the OpenCode Go provider.
The issue affects multiple models, not just DeepSeek. For example:
- deepseek-v4-flash → socket connection was closed unexpectedly
- gpt-5.6-luna → socket connection was closed unexpectedly
- gpt-5.6-luna also intermittently returns "unknown certificate verification error"
The relevant error from the OpenCode log is:
AI_APICallError: Cannot connect to API: The socket connection was closed unexpectedly. For more information, pass verbose: true in the second argument to fetch()
I also got this more specific error:
Error: unknown certificate verification error
This happens consistently with the opencode-go provider.
I tested HTTPS connectivity to opencode.ai directly using curl, and the connection succeeds with HTTP/2 200, so general HTTPS/TLS connectivity from my Mac appears to be working.
There are also no proxy-related environment variables configured.
Plugins
None
OpenCode version
1.18.18
Steps to reproduce
- Open OpenCode 1.18.18.
- Use the OpenCode Go provider.
- Select any available model (tested with deepseek-v4-flash and gpt-5.6-luna).
- Send any prompt.
- The request fails with:
"Cannot connect to API: The socket connection was closed unexpectedly" - Retrying eventually produces:
"unknown certificate verification error"
Screenshot and/or share link
No response
Operating System
macOS (Apple Silicon)
Terminal
vsc extension
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.