Repository navigation
Description
What happened
OpenCode Go inference requests sent by Maka omit the provider-required
x-opencode-session header. This affects both the normal AI SDK model path
and the direct Connection Test probe.
OpenCode Go's operator has announced that requests without this header may
start failing on September 5, 2026:
vercel/ai#20271
The value must be one stable opaque ID per conversation. Generating a fresh ID
per HTTP request would not satisfy the routing/affinity contract.
Maka already has the needed identities:
- main runs:
input.context.sessionId - title/recap/memory/goal auxiliary calls:
transportContextId - Connection Test: a stable connection-scoped probe identity can be derived
separately because it is not a conversation
Expected: every OpenCode Go inference request carries a stable
x-opencode-session, including streaming/non-streaming requests, later
turns, tool-loop steps, retries, history compaction, auxiliary calls, and
Connection Test probes. The header should be limited to OpenCode Go traffic,
contain no user data, and preserve an explicitly configured header.
How to reproduce
I reproduced this against the JavaScript packaged in the current Desktop
build, using an isolated mock fetch. No real API key was read and no
network request was sent.
- Import
getAIModelfrom the packaged@maka/runtime/model-factory. - Construct an
opencode-gomodel for
muse-spark-1.2-contributorwith a mock fetch. - Invoke
model.doGenerate(...)and inspect the resulting Request. - Call
testConnection(...)for the same provider/model with a mock fetch
and inspect that Request as well.
Sanitized result:
{
"inference": {
"url": "https://opencode.ai/zen/go/v1/responses",
"sessionHeader": null,
"userAgent": "ai-sdk/openai/4.0.44 ai-sdk/provider-utils/5.0.28 runtime/node.js/24"
},
"connectionTest": {
"url": "https://opencode.ai/zen/go/v1/responses",
"sessionHeader": null
}
}The current main source also contains no x-opencode-session
implementation:
packages/runtime/src/model-factory.tsapplies only stored
requestHeaders; its input has no per-session request identity.packages/runtime-host/src/server/execution-model-composition.tshas
input.context.sessionId, but does not add it to provider request headers.runHostAuxiliaryModelCall()hastransportContextId, but likewise
forwards only stored request headers.packages/runtime/src/test-connection.tssends its inference probes
directly, bypassing the model factory.
Environment
- Maka version:
0.2.0-dev.15.20260902 - Maka
maininspected at:91624f1f3ea14eef92b686c56f8fcd92034446b8 - OS: macOS 26.6.2 arm64
- Surface: Desktop / Runtime Host
- Node.js: 24.18.1
Logs, screenshots, or additional context
The public upstream report says AI SDK does not create or persist this
provider-specific conversation identity automatically; clients must pass the
header themselves. OpenCode's own request path sends its session ID as
x-opencode-session:
https://github.com/anomalyco/opencode/blob/dev/packages/opencode/src/session/llm/request.ts
OpenCode Go supports several wire protocols, so the safest boundary is a
provider-specific fetch/header policy shared by every adapter rather than
patching only one OpenAI-shaped request.
AI assistance
OpenAI Codex assisted with source inspection, the isolated packaged-runtime
probe, and drafting this issue. I reviewed the evidence and the final report.
Activity
Totoro-qaq commentedon Sep 3, 2026
take
fix(runtime): propagate OpenCode Go session identity (apache#4670)
fix(runtime): propagate OpenCode Go session identity (apache#4670)