Send x-opencode-session header on API requests (required by OpenCode Go from 09/05)
Hi — we operate the OpenCode Go managed-inference API, and 1685 of your users' orgs call it through GitHub Copilot Chat (UA GitHubCopilotChat/0.63.0).
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. Copilot Chat doesn't send it in any version we've seen.
Ask: include x-opencode-session: <stable-id-per-conversation> on all outbound inference HTTP requests. Any stable UUID per conversation works. Happy to confirm from our telemetry once a build ships it. Thanks!
Now I'm totally stucked because of this new requirement when using GitHub Copilot CLI and VS Code 😥
????????????????????????????????????????
opencode is such a shit model provider!!! You completely break down service BEFORE solving this issue??? What's the problem with you???
so bad, I also meet this error
Now I'm totally stucked because of this new requirement when using GitHub Copilot CLI and VS Code 😥
You may use my extension. I have already fixed it.
I think the best solution will be that Anomaly dev team develop official opencode provider for the vscode chat like Ollama already did.
@thdxr You should compute your own routing ids by computing a (sparse) hash over the user prompts. Your current approach is lazy, because it puts all the burden on agent developers when you could have done it yourself.
you could use X-Interaction-Id from request header as session ID. @thdxr you lazy dumb axxhole. stxpid retxrded piece of thing!!! fix this IMMEDIATELY!!! I have paied for your stxpid service!!!
This is horrible. I am so stuck with it. Can you please fix it ASAP?
Can't use my Opencode GO sub in VSCode because of this. Isn't VSCode one of the most common places outside opencode-cli to use the subscription? I wonder why they apply the change knowing they will break other platforms compatibility...
@sandy081 could you please fix this ASAP?
I love everything about this.
Opencode itself has had support for X-Session-Id https://github.com/anomalyco/opencode/issues/12930 and x-session-affinity https://github.com/anomalyco/opencode/pull/20744 added, then removed under unknown circumstances, then added again not even 3 weeks ago https://github.com/anomalyco/opencode/issues/42694 https://github.com/anomalyco/opencode/pull/43188
And now here we see a request to add custom headers with the tool name to an entirely different harness. x-opencode-session, really?
Since there's about as much chance of vscode adding a competitor's custom header like this as hell freezing over, you can just add the header as a static entry like this to your individual model config and continue using opencode in vscode:
"requestHeaders": { "x-opencode-session": "ARE YOU KIDDING ME DAX" }
Do note that this might be problematic when using the same model from two chats at once. But then you could just do the reasonable thing and cancel your subscription, which is what I'll be doing.
So long and thanks for all the fish.
According to official VS Code docs in https://code.visualstudio.com/docs/agent-customization/language-models#_add-a-custom-endpoint-model you can temporarily add by yourself the requested header by OpenCode, just edit in chatLanguageModels.json > yourCustomEndpoint > models > modelYouWantToUse and add requestHeaders like the example below.
{
"name": "OpenCode Anthropic",
"vendor": "customendpoint",
"apiKey": "${input:chat.lm.secret.-####}",
"apiType": "messages",
"models": [
{
"id": "qwen3.7-plus",
"name": "Qwen3.7 Plus",
"url": "https://opencode.ai/zen/go/v1/messages",
"toolCalling": true,
"vision": true,
"maxInputTokens": 1000000,
"maxOutputTokens": 131072,
"requestHeaders": {
"x-opencode-session": "ses_b5s4af482as55"
}
}
]
}
Infuriating! OpenCode’s API design is constantly changing and fails to adhere to standard, broadly applicable design principles, effectively shifting the burden of its own internal problems onto the entire ecosystem. For Copilot, requiring custom request headers for every third-party inference provider is simply not a sensible approach. OpenCode’s attitude comes across as excessively arrogant and discourteous.
so bad @thdxr
Thanks @wbsch and @tianrodez for the requestHeaders workaround.
Integrated it for OpenCode Go models in: https://github.com/shibadogcap/opencode-copilot-chat This is a fork of https://github.com/Pikacnu/opencode-copilot-chat.
shifting your own architectural needs to everyone else's problem is insane
If you can correctly identify UA GitHubCopilotChat/0.63.0, then you should be able to identify X-Interaction-Id just as easily. That’s the model provider’s responsibility!
@vritant24 Could you take a look at this issue? Thank you!
Tried the new GitHub Copilot desktop app yesterday. Ran into the same issue with OpenCode Go. Shame.
There's already a community extension, OpenCode for Copilot Chat, that implements this feature. It automatically sends the x-opencode-session header on all inference requests to the OpenCode gateway, providing the stable per-conversation ID you need.
However, I think Anomaly should provide this as an official LLM provider extension for Copilot Chat rather than relying on community contributions. An official implementation would be more reliable for routing and optimization, and would reach significantly more users through official channels.