gausszhou/dsh-opencode-session-id
dsh-opencode-session-id
dsh session IDs for opencode, zero config.
Install
npx @deepseek-ai/dsh plugin --profile web add "@gausszhou/dsh-opencode-session-id"Restart `dsh web` after install. Bundle APIs can change during the developer preview.
README badge
[](https://dshhub.dev/plugins/dsh-opencode-session-id)Paste this into your README. The star count updates with every catalog sync.
From the README
Excerpt from gausszhou/dsh-opencode-session-id, cleaned of badges and images.
dsh-opencode-session-id
dsh session IDs for opencode, zero config.
English | 简体中文
A DeepSeek Harness (dsh) plugin: when you use an opencode model (providers such as opencode / opencode-go that point at the opencode.ai gateway), it makes the actual outgoing HTTP requests carry a session id — the same way the opencode client itself does.
Usage
Add the plugin to a dsh profile (install by package name once published to npm):
dsh plugin --profile web add "@gausszhou/dsh-opencode-session-id"
After installing, restart dsh web (systemctl --user restart dsh-web) so the bundle takes effect. The default configuration works out of the box: requests to opencode.ai automatically get x-opencode-session (the session header used by the opencode gateway) plus x-session-affinity / x-client-request-id / x-session-id. The header value defaults to a pure-alphanumeric nanoid(8) derived from the uuid portion of the session id (e.g. 0RpJJnxJ — the session- prefix does not participate in the hash; the token is deterministically derived from the uuid via SHA-256). With verbose: true, the journal logs the mapping between the original id and the wire token:
journalctl --user -u dsh-web -f | grep opencode-session-id
How it works
The opencode gateway branch uses x-opencode-session to carry the session id; this plugin listens on the llm/stream scope, wraps fetch, and adds that header at the wire layer. By default it hashes the uuid portion of session-<uuid> (the session- prefix is excluded) into an alphanumeric nanoid(8) before it goes on the wire. Only request headers are touched — the request body, URL, method, and everything else pass through unchanged. See docs/design.md for the full design rationale.
Configuration
Zero configuration needed by default (the install command above is all you need). To enable injection logging through the patch layer:
- id: opencode-session-id
config:
verbose: true
All options (each optional, defaults shown):
…
