mathangler/dsh-opencode-session-header
Puts a per-conversation x-opencode-session header on every request an opencode-go route makes, so OpenCode's Go/Zen gateway stops answering 400 MissingSessionID.
DSH already knows the per-conversation id and hands it to the provider layer, which then drops it; the gateway requires it and rejects the request without it. The plugin attaches the id as a header only for the opencode-go prefix, so each conversation gets its own cache bucket and prompt-cache locality is preserved per conversation rather than per deployment. It is a targeted fix for one 400 rather than a general header-injection facility, and it stays reversible by unloading the plugin.
Install
dsh plugin --profile web add github:mathangler/dsh-opencode-session-headerThe GitHub line from the README's install instructions. The README describes the plugin as a replacement for its earlier deployment-wide patch script: no file is patched, the installed dsh-llm-pi-ai bundle stays byte-for-byte pristine, no global fetch/undici hook is installed, and nothing needs re-applying after a dsh upgrade because the next boot loads the plugin again.
Compatibility
Scope is one fixed prefix — opencode-go and any sibling route under it, such as opencode-go-custom — and the README states no configuration can widen it. The plugin re-attaches the session id at the last point where the request's header map is still an argument, and unloading it restores every object it touched. The README explains why the dsh layers cannot do this themselves: a static settings.yaml headers map would collapse every conversation onto one cache bucket, and pi-ai's own session-affinity switch is gated behind a compat flag dsh classifies as withheld.
Details
- Repo: mathangler/dsh-opencode-session-header
- Category: Models & Providers
- Stars: 1
- Version: installed from the repo's default branch
Alternatives
GooDAnDReaDY/dsh-opencode-provider · A42Null/dsh-opencode-zen-plugin · mirelconstantin/dsh-opencode-router