nobu121/dsh-opencode-session

Adds the x-opencode-session header to OpenCode and OpenCode Go calls, fixing 400 MissingSessionID errors on the relay.

This plugin automatically sends the x-opencode-session request header on model calls routed to OpenCode and OpenCode Go providers, using one stable session id per DSH conversation. It does two things at once, and the README is careful about the difference: it fixes the 400 by always attaching the header, and it keeps the cache and affinity benefit by using a value that is unique per conversation and stable across that conversation's turns, by default the DSH session id itself, the same identity the official DeepSeek adapter already sends as x-deepseek-harness-session-id. Because requests sharing a header value are pinned to the same upstream backend, this is what keeps OpenCode's prompt cache warm across turns rather than starting cold on each one.

Models & Providers ★ 14
View on GitHub ↗

Install

dsh plugin --profile web add dsh-opencode-session

The npm line, which the README gives first. A local-checkout form (dsh plugin --profile web add ./path/to/dsh-opencode-session) is also documented but is not shipped here. The README says to fully restart the profile afterwards, because bundle layers are read at startup. Configuration can be overridden per profile by adding a row with the same id to that profile's own cordis.patch.yml, which replaces the bundled row.

Compatibility

Exists because of an upstream change: the README states that since 2026-09-05 OpenCode's relay requires an x-opencode-session header on API requests, tracked in deepseek-harness discussion 5495, and that without it requests fail with 400 MissingSessionID-style errors.

Details

Alternatives

kyomufs/dsh-opencode-zen · mathangler/dsh-opencode-session-header · mubaid/dsh-opencode-freeaccess

More plugins in Models & Providers

Browse more in Models & Providers

Guides for Models & Providers plugins