dsh session IDs for opencode
gausszhou/dsh-opencode-session-id · productivity
dsh session IDs for opencode, zero config.
★ 4GitHub stars
1Forks
2026-09-08Last updated
JavaScriptLanguage
MITLicense
Key features
- A DeepSeek Harness (dsh) pluginwhen 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.
- The opencode gateway branch uses x-opencode-session to carry the session id
- verify.mjs fires a real opencode-go request through the pi-ai bundled with the dsh CLI, asserting that the wire request headers really 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- (the session- prefix is excluded) into an alphanumeric nanoid(8) before it goes on the wire.
Requirements
- The session id comes from options.sessionId (agent-loop fills it in per session)
- without a session context, the fallback chain is sessionIdEnv DSH_SESSION_ID (the process's startup session in web deployments) an in-process random id.
Install command
dsh plugin --profile web add github:gausszhou/dsh-opencode-session-id