Skip to content

Cannot connect to API: The socket connection was closed unexpectedly. For more information, pass verbose: true in the second argument to fetch() #21643

Closed as not planned

Description

@adamw199112

Question

Cannot connect to API: The socket connection was closed unexpectedly. For more information, pass verbose: true in the second argument to fetch()

Image

所有 opencode zen模型都连接不上,但是copilot的模型都可以。

linux系统
环境在qemu虚拟机中,请问是什么问题?

Activity

  1. github-actions commented on Apr 9, 2026

    @github-actions
    Contributor

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

    Please search through existing issues before opening a new one, and consider adding any new details to an existing thread if applicable.

  2. Hona commented on Apr 9, 2026

    @Hona
    Member

    what version of opencode?
    opencode -v

  3. adamw199112 commented on Apr 9, 2026

    @adamw199112
    Author

    OpenCode的哪个版本? opencode -v

    1.3.17

  4. Hona commented on Apr 9, 2026

    @Hona
    Member

    please run opencode upgrade first - we are on version v1.4.1

  5. hhding commented on Apr 9, 2026

    @hhding

    please run opencode upgrade first - we are on version v1.4.1

    same error on v1.4.1

  6. zsl83572348 commented on Apr 13, 2026

    @zsl83572348

    桌面端同样的问题,更新到最新版本也没解决,只是过了个周末就不能用了。楼主是在无网络限制的环境下出现这种情况的吗?

  7. zsl83572348 commented on Apr 14, 2026

    @zsl83572348

    我现在基本确定,应该是公司网络加了限制,api请求被拦截了。。。

  8. chixinwang commented on Apr 15, 2026

    @chixinwang

    @zsl83572348 相关问题原因已经找到了嘛,我也遇到了这个问题。目前怀疑是我使用的代理有问题

  9. anonymous-1-a commented on Apr 24, 2026

    @anonymous-1-a

    Same issue. I use vLLM and opencode version is 1.14.22.

  10. chixinwang commented on Apr 24, 2026

    @chixinwang

    @anonymous-1-a I have solved this problem. The way to do it is to open a new terminal. Although I don't know why this happened.

  11. fatihdogmus commented on May 11, 2026

    @fatihdogmus

    i'm getting the same problem on v1.14.48. it doesnt happen always, but it happened consistently for a task that I was trying to run. I've tried multiple providers and the result is the same.

  12. roboticarmgroup commented on May 11, 2026

    @roboticarmgroup

    it's a context problem. running /compact will fix it.

    if you're running a lot of terminal commands in your session, instruct the agent manually or with AGENTS.md to use a subagent and you'll see this error a lot less

  13. satarou1 commented on May 14, 2026

    @satarou1

    Мне помог перезаход в аккаунт/API

  14. 3L1AS commented on May 27, 2026

    @3L1AS

    Has this been fixed? Seeing it also in the latest Opencode version.

  15. yu-zou commented on Jun 4, 2026

    @yu-zou

    Same issue on v1.15.13

  16. furkanbr commented on Jun 20, 2026

    @furkanbr

    I am getting this exact problem with version 1.17.8 in last few days. Compacting the context, opening new terminal did not work. I am getting this problem with both CLI and Macos app. Any solutions?

  17. rekram1-node commented on Jun 23, 2026

    @rekram1-node
    Contributor

    Automated: closing question issues.

    GitHub Issues are for bug reports and feature requests only — questions / support are no longer tracked here.

    If this is a bug or feature request, please open a new issue with the appropriate template.

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