Skip to content

OpenCode Go gateway returns 500 on POST /zen/go/v1/chat/completions (all models, all keys) #40453

Closed as not planned

Description

@FLMArnold

问题描述

OpenCode Go (opencode-go provider) 的所有模型调用都会失败:POST https://opencode.ai/zen/go/v1/chat/completions 稳定返回 HTTP 500 "Internal server error",而 GET /zen/go/v1/models 正常返回 200 和完整模型列表。受影响模型包括 deepseek-v4-flash、glm-5.1、qwen3.7-plus 等(逐一验证均 500)。

OpenCode 客户端中表现为"子代理超时、无报错":日志显示请求挂起约 78 秒后静默退出并返回空文本。

复现步骤(Windows 11, opencode 1.18.3)

  1. opencode auth 已有 opencode-go API key
  2. 用任意 HTTP 客户端 POST 到 https://opencode.ai/zen/go/v1/chat/completions,body:{"model":"deepseek-v4-flash","messages":[{"role":"user","content":"pong"}],"max_tokens":5}
  3. 观察响应

测试证据

测试 结果
GET /zen/go/v1/models (直连真实 IP + 系统 DNS) 200,模型列表完整
POST /zen/go/v1/chat/completions 有效 key 500, ~1-2s
POST 无效 key (sk-invalid-key-xyz) 500(正常应 401)
换模型 glm-5.1 / qwen3.7-plus 500
stream: true 模式 500
浏览器 UA 500
不存在的模型 ID 500
走本地 HTTP 代理 (127.0.0.1:7892) 时通时断,通时 500
直连真实 IP (curl --resolve opencode.ai:443:172.65.90.20) 500,响应头 Server: cloudflare

响应体:{"type":"error","error":{"type":"error","message":"Internal server error"}}
响应头:HTTP/1.1 500 Server: cloudflare CF-RAY: ... Cf-Placement: remote-ORD

关键判断

  • 500 由 Cloudflare 层返回(Server: cloudflare + CF-RAY),POST 请求未真正到达上游模型服务端
  • 无效 key 返回 500 而非 401,说明网关层对 POST 的处理有异常
  • 排除本地网络/VPN 因素:直连真实 IP 和走代理结果一致,VPN 开/关无影响

影响

  • opencode-go/* 全部模型不可用
  • OpenCode 客户端无错误提示,只显示"超时",难以定位

Activity

  1. github-actions commented on Aug 4, 2026

    @github-actions
    Contributor

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

    If your issue is distinct (e.g. the 500 is consistently reproducible now rather than intermittent, or persists after those issues are resolved), please note that in the issue.

  2. VOE9 commented on Aug 31, 2026

    @VOE9

    Additional reproduction from Kali Linux — muse-spark-1.2-contributor

    Confirming this on opencode-go/muse-spark-1.2-contributor. Same signature as the
    original report: GET /zen/go/v1/models returns 200, but every POST to
    /chat/completions returns 500 at the Cloudflare edge.

    Environment

    • OS: Kali Linux
    • opencode: v1.18.25
    • Provider/model: opencode-go / muse-spark-1.2-contributor (free)
    • Region: Iraq

    Direct curl reproduction

    Valid API key, explicit reasoning.effort: "medium" — instant HTTP 500:

    curl -i -X POST https://opencode.ai/zen/go/v1/chat/completions \
      -H "Authorization: Bearer sk-***" \
      -H "Content-Type: application/json" \
      -d '{"model":"muse-spark-1.2-contributor","messages":[{"role":"user","content":"hi"}],"reasoning":{"effort":"medium"}}'

    Response:

    HTTP/2 500
    date: Mon, 31 Aug 2026 15:09:03 GMT
    content-type: text/plain;charset=UTF-8
    server: cloudflare
    cf-ray: a33cf442afea7a8c-CLT
    
    {"type":"error","error":{"type":"error","message":"Internal server error"}}

    Note the content-type: text/plain on a JSON body — consistent with the edge
    generating this response rather than the upstream model service.

    Ruled out locally

    • Auth token valid; network path healthy.
    • Disabled local MCP servers (kali, kali-tools) — no change.

    Client-side symptom

    In the TUI the request hangs with the spinner running, then flips to
    interrupted with no error surfaced, while local context is still consumed.
    This matches the "sub-agent timeout, no error" behaviour described in the
    original report, and is likely amplified by the unbounded 5xx retry policy
    tracked in #25041.

    Separate finding (possibly unrelated to the 500)

    From ~/.local/share/opencode/log/, the background title generator sends
    reasoning.effort: "none", which this model rejects with a 400:

    [invalid_request_error] "reasoning.effort" does not support "none" with this model.
    

    Filing here for visibility since it also affects muse-*, but it is a distinct
    failure class from the gateway 500 above. Happy to open it separately if
    preferred.

    Question

    Is the 500 region-gated? muse-spark-1.2-contributor is documented as
    "available in select regions", and #43692 shows a RegionError for
    unsupported countries. If the gateway is collapsing that check into a generic
    500, a clearer error would save a lot of debugging time.

  3. 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