OpenCode Go: add x-opencode-session header (required from Sep 6, 2026)
Summary
OpenCode (opencode.ai) emailed OpenCode Go subscribers that requests missing the x-opencode-session header will start erroring on 2026-09-06. Forge's OpenCode Go integration does not send this header.
From the OpenCode Go docs:
To ensure your account does not get flagged, make sure the tool you're using
- does not generate abusive traffic
- properly identifies itself (no broad user agents)
- includes the
x-opencode-sessionheader so we can optimize prompt caching
The email states the Forge user agent is not recognized and asks maintainers to add x-opencode-session (one stable ID per conversation).
Current state
- Confirmed against latest
main: no occurrence ofx-opencode-sessionanywhere in the repo. crates/forge_repo/src/provider/provider.json(opencode_go) has no headers set, andProvider::custom_headersis a static map — insufficient here since the value must be a stable per-conversation ID.- Reproduced with forge 2.13.21 logged into
opencode_go.
Suggested fix
Attach x-opencode-session: <conversation-id> (e.g. the existing conversation/session UUID) to requests routed to the opencode_go provider (and likely opencode_zen as well — same gateway, https://opencode.ai/zen/go).
A static header won't work; the value should be one stable ID per conversation so OpenCode can optimize prompt caching.
Environment
- forge 2.13.21 (latest), macOS arm64
- provider: opencode_go, model: deepseek-v4-flash
Source: tailcallhq/forgecode