posit-dev / posit-dev/positron

Assistant: support for OpenCode Go provider

Open
#15,976 2 comments 0 reactions 1 assignee View on GitHub

@wch is already working on this.

Since Sep 9, 2026.

area: assistant enhancement support
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

  1. Configure a custom OpenAI-compatible provider in Posit Assistant using an OpenCode Go endpoint such as https://opencode.ai/zen/go/v1.
  2. Select an OpenCode Go model.
  3. Send a prompt.
  4. The request fails with HTTP 400 and the missing x-opencode-session message.

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:

Related Positron OpenCode Go custom-provider reports:

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.