You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Send x-opencode-session header on API requests (required by OpenCode Go from 09/05) #492
Hi — we operate the OpenCode Go managed-inference API, and a large share of your users call it through ZCode (UA ZCode/3.x, ~33k orgs in the last week).
Starting 09/05, requests without an x-opencode-session header will error on our side — we need a stable per-conversation ID for routing/optimization. We measured all current ZCode builds (incl. 3.10.2) at ~0% header presence, so every ZCode user on Go will break unless the client sends it.
Ask: include x-opencode-session: <stable-id-per-conversation> on all outbound inference HTTP requests. Any stable UUID per conversation works; it just needs to be consistent across requests in the same session.
Happy to confirm the fix from our telemetry once a build ships with it. Thanks!
Reacted by Adam Durrani, dkx, surtweig, PiotrZurawskiLDN, Maximilian Scholz, Junger, sunliqiang, nattiini45, The Zealot, Daniel and 60 more
Reacted by yuki and YD-233
Reacted by Liushabao, Arián Covacevich, Linxuan Fang, jiandanhuoduanqiao95, Pablo Pereira, icrefin, atsuto0525, McCoy-Moe, MaLinSeYa, tisicstry and 2 more
{"type":"error","error":{"type":"MissingSessionID","message":"Error from provider (Console Go): Request is missing x-opencode-session and cannot be routed efficiently. Please see https://opencode.ai/docs/go/#where-can-i-use-it"}}
curl 对照实验
同一请求体、同一 API key,直接打 https://opencode.ai/zen/go/v1/chat/completions:
请求
结果
不带 x-opencode-session(复现测试按钮)
400 MissingSessionID
带 x-opencode-session: sess-xxx
200,模型正常回复
说明 key、模型、provider 配置本身都没有问题,纯粹是测试路径缺会话头。
建议
testModelConnectivity 这条探测路径也发送与主链路一致的会话标识(x-opencode-session,或 ZCode 原生会话头),让「测试」结果反映真实可用性——目前测试结果和实际可用性完全相反,对 OpenCode Go 用户有很强误导性
顺带:测试请求的 User-Agent 是字面量 ZCode/unknown,建议带上真实版本号(OpenCode Go 也要求客户端以自有 UA 自报身份,而不是 unknown)
TL;DR for the OpenCode folks watching this issue: on ZCode 3.11.2, real inference traffic works fine (the fix or native-header recognition is effective on the main path), but the model-management "test" button sends a bare probe with no session header (UA literally ZCode/unknown) and gets 400 MissingSessionID for every model. Worth accounting for when correlating telemetry — those test-button failures don't mean the client is broken.
Reacted by TheRedpanda, e8tg001, deltacat, 椰格, HChengH, hendy-bs and 大山
opencode go订阅在zcode desktop app v 3.11.2 中无法接入出现调用异常的问题仍然没有解决.
The issue of a call exception when OpenCode Go subscription cannot be integrated in ZCode desktop app v 3.11.2 remains unresolved.
opencode go订阅在zcode desktop app v 3.11.2 中无法接入出现调用异常的问题仍然没有解决. The issue of a call exception when OpenCode Go subscription cannot be integrated in ZCode desktop app v 3.11.2 remains unresolved.
opencode go订阅在zcode desktop app v 3.11.2 中无法接入出现调用异常的问题仍然没有解决. The issue of a call exception when OpenCode Go subscription cannot be integrated in ZCode desktop app v 3.11.2 remains unresolved. @thdxr@liushidai@2574862764@wangjianjq@tomsun28
opencode go订阅在zcode desktop app v 3.11.2 中无法接入出现调用异常的问题仍然没有解决. The issue of a call exception when OpenCode Go subscription cannot be integrated in ZCode desktop app v 3.11.2 remains unresolved. @thdxr@liushidai@2574862764@wangjianjq@tomsun28
opencode go订阅在zcode desktop app v 3.11.2 中无法接入出现调用异常的问题仍然没有解决. The issue of a call exception when OpenCode Go subscription cannot be integrated in ZCode desktop app v 3.11.2 remains unresolved. @thdxr@liushidai@2574862764@wangjianjq@tomsun28
I am still getting this error today when trying to use my Opencode Go API key within ZCode: Connection failed: Error from provider (Console Go): Request is missing x-opencode-session and cannot be routed efficiently. Please see https://opencode.ai/docs/go/#where-can-i-use-it
Activity
github-actions commentedon Sep 3, 2026
👋 感谢你的反馈,我们已经收到。
status: 待评估,你可以随时补充信息。needs: 更多信息标签并 @ 你。👋 Thanks — we've received your issue.
status: 待评估(Triage); feel free to add context.needs: 更多信息and ping you.liushidai commentedon Sep 7, 2026
搞快点,磨磨唧唧
wangjianjq commentedon Sep 8, 2026
补充一个 3.11.2 的实测情况:主链路对话已正常,但「模型管理 → 测试」按钮发出的请求仍然不带会话头,OpenCode Go 用户点测试会全部误报失败。
环境
https://opencode.ai/zen/go/v1现象
zcode-agent-service用 glm-5.3-flash 跑会话,无报错)原因(日志实锤)
testModelConnectivity发出的探测请求(见~/.zcode/v2/logs/)头信息只有这些,没有任何会话标识:网关响应(HTTP 400,9 个模型逐一测试全部相同):
{"type":"error","error":{"type":"MissingSessionID","message":"Error from provider (Console Go): Request is missing x-opencode-session and cannot be routed efficiently. Please see https://opencode.ai/docs/go/#where-can-i-use-it"}}curl 对照实验
同一请求体、同一 API key,直接打
https://opencode.ai/zen/go/v1/chat/completions:x-opencode-session(复现测试按钮)400 MissingSessionIDx-opencode-session: sess-xxx200,模型正常回复说明 key、模型、provider 配置本身都没有问题,纯粹是测试路径缺会话头。
建议
testModelConnectivity这条探测路径也发送与主链路一致的会话标识(x-opencode-session,或 ZCode 原生会话头),让「测试」结果反映真实可用性——目前测试结果和实际可用性完全相反,对 OpenCode Go 用户有很强误导性User-Agent是字面量ZCode/unknown,建议带上真实版本号(OpenCode Go 也要求客户端以自有 UA 自报身份,而不是 unknown)TL;DR for the OpenCode folks watching this issue: on ZCode 3.11.2, real inference traffic works fine (the fix or native-header recognition is effective on the main path), but the model-management "test" button sends a bare probe with no session header (UA literally
ZCode/unknown) and gets400 MissingSessionIDfor every model. Worth accounting for when correlating telemetry — those test-button failures don't mean the client is broken.2574862764 commentedon Sep 8, 2026
所以这个问题怎么解决啊
bisslot commentedon Sep 9, 2026
opencode go订阅在zcode desktop app v 3.11.2 中无法接入出现调用异常的问题仍然没有解决.
The issue of a call exception when OpenCode Go subscription cannot be integrated in ZCode desktop app v 3.11.2 remains unresolved.
@thdxr @liushidai @2574862764 @wangjianjq @tomsun28
liushidai commentedon Sep 9, 2026
换其他工具吧,zcode太封闭了,很明显glm有做A/的想法,暂时还没有做A/的实力
官网文档:https://zcode.z.ai/cn/docs/configuration
younguis commentedon Sep 9, 2026
有必要乱搞这些吗,典型的API中转站要各个Agent软件厂来适配它,有点搞笑了
deltacat commentedon Sep 9, 2026
其实可以用, @wangjianjq 描述了,测试不通过,但是实际上会话中是可以使用的。
另外同意 @younguis ,opencode 搞的这个事情不是zcode的锅。
bisslot commentedon Sep 11, 2026
至目前GO订阅GLM-5.3-FLASH在zcode 中会话仍然不支持, 其它GLM-5.2 都正常.
hushenghao commentedon Sep 11, 2026
检查你的配置信息,这两个模型都是可以在zcode上使用的
daihaowxg commentedon Sep 14, 2026
已验证,2026-09-14 09:40,测试端点不通过,但实际在会话中使用时是可以正常对话的。
Takina610 commentedon Sep 15, 2026
虽然接入失败,但是可以正常对话,2026-09-15 09:43
Josephur commentedon Sep 15, 2026
I am still getting this error today when trying to use my Opencode Go API key within ZCode: Connection failed: Error from provider (Console Go): Request is missing x-opencode-session and cannot be routed efficiently. Please see https://opencode.ai/docs/go/#where-can-i-use-it
According to https://opencode.ai/docs/go/#where-can-i-use-it the x-opencode-session header is no longer needed anymore, but it sounds to me like it is and ZCode is not passing it?
Dr3ladwyn commentedon Sep 16, 2026
This problem is still unsolved
xuyuan7101 commentedon Nov 8, 2026
Still entangled with this problem.