posit-dev / posit-dev/positron
Assistant: support for OpenCode Go provider
@wch is already working on this.
Since Sep 9, 2026.
- Dominant language
- TypeScript
- Stars
- 4.3k
- Forks
- 184
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 195
Description
System details
- Positron: 2026.09.1
- Posit Assistant extension: 1.3.1
- OS: Linux on WSL2
- Provider: Custom provider / OpenAI-compatible
- Endpoint:
https://opencode.ai/zen/go/v1
Describe the issue
Requests from Posit Assistant to OpenCode Go fail with HTTP 400:
Error from provider (Console Go): Request is missing x-opencode-session and cannot be routed efficiently.
This started after OpenCode Go began enforcing its session-affinity requirement around September 6, 2026. The same endpoint and credential work from clients that send the required header.
OpenCode Go documents that clients must send a stable session ID in x-opencode-session for each conversation. Posit Assistant currently does not appear to send this header. A static value in customHeaders would not be sufficient because the value must be stable within a conversation and distinct across conversations.
Steps to reproduce
- Configure a custom OpenAI-compatible provider in Posit Assistant using an OpenCode Go endpoint such as
https://opencode.ai/zen/go/v1. - Select an OpenCode Go model.
- Send a prompt.
- The request fails with HTTP 400 and the missing
x-opencode-sessionmessage.
Expected behavior
For requests routed to OpenCode Go, Posit Assistant should generate or reuse an opaque, stable session identifier and send:
x-opencode-session: <stable-id-for-this-conversation>
The same identifier should be used for all requests belonging to one conversation, including auxiliary requests such as compaction or summarization. A new conversation should receive a different identifier. The header should be limited to OpenCode routes and should not be sent to unrelated providers.
Actual behavior
The header is absent, and OpenCode Go rejects the request.
Related reports
OpenCode Go documentation:
Independent reports and fixes in other clients:
- AnythingLLM: https://github.com/Mintplex-Labs/anything-llm/issues/6283
- Bifrost gateway: https://github.com/maximhq/bifrost/issues/6815
- MiMo Code issue: https://github.com/XiaomiMiMo/MiMo-Code/issues/2317
- MiMo Code proposed fix: https://github.com/XiaomiMiMo/MiMo-Code/pull/2327
- CyberStrike: https://github.com/CyberStrikeus/CyberStrike/issues/139
- OpenCode for Copilot proposed fix: https://github.com/zelosleone/Opencode-Go-For-Copilot/pull/10
- Docker Agent proposed fix: https://github.com/docker/docker-agent/pull/4190
Related Positron OpenCode Go custom-provider reports:
- https://github.com/posit-dev/positron/issues/13662
- https://github.com/posit-dev/positron/issues/13789
- https://github.com/posit-dev/positron/issues/14906
Request
Please add dynamic per-conversation x-opencode-session support for OpenCode Go and OpenCode Zen routes, or document a supported configuration mechanism that can provide the required per-conversation value.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.