Skip to content

OpenCode Go: "socket connection was closed unexpectedly" / "unknown certificate verification error" on all models #42479

Closed as not planned

Description

@AlexPrincipal

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

  1. Open OpenCode 1.18.18.
  2. Use the OpenCode Go provider.
  3. Select any available model (tested with deepseek-v4-flash and gpt-5.6-luna).
  4. Send any prompt.
  5. The request fails with:
    "Cannot connect to API: The socket connection was closed unexpectedly"
  6. Retrying eventually produces:
    "unknown certificate verification error"

Screenshot and/or share link

No response

Operating System

macOS (Apple Silicon)

Terminal

vsc extension

Activity

  1. github-actions commented on Aug 14, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If your issue is distinct (e.g., specific to a particular model or a regression in a specific version), please add details that differentiate it from the above.

  2. AlexPrincipal commented on Aug 14, 2026

    @AlexPrincipal
    Author

    Thanks for the references. I can confirm this is happening on OpenCode v1.18.18 with the OpenCode Go provider and affects multiple models, including deepseek-v4-flash and gpt-5.6-luna.

    The two errors I consistently see are:

    1. Cannot connect to API: The socket connection was closed unexpectedly
    2. unknown certificate verification error

    I also verified that there are no proxy environment variables configured, and a direct HTTPS request to https://opencode.ai succeeds with HTTP/2 200 from Cloudflare.

    Relevant log:

    providerID=opencode-go
    modelID=gpt-5.6-luna
    error="Error: unknown certificate verification error"

    and:

    providerID=opencode-go
    modelID=deepseek-v4-flash
    error="AI_APICallError: Cannot connect to API: The socket connection was closed unexpectedly..."

    I'm happy to provide any additional logs or diagnostics needed. Thanks!

  3. AlexPrincipal commented on Aug 14, 2026

    @AlexPrincipal
    Author

    Could this be caused by high demand or capacity issues on the OpenCode Go backend?
    I just tested MiniMax M3 through the same opencode-go provider and it works fine, while DeepSeek V4 Flash and GPT-5.6 Luna consistently fail with the socket/certificate errors.

    Is there currently any known increased traffic, capacity issue, or degradation affecting these models?

  4. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions