nobu121/dsh-opencode-session ↗★ 0
dsh-opencode-session
DeepSeek Harness plugin: automatically adds a stable per-conversation x-opencode-session header to OpenCode / OpenCode Go provider requests — fixes 400 MissingSessionID and keeps OpenCode's session affinity / prompt-cache routing working.
AI 분석
核心用途是解决 OpenCode 接口的会话丢失问题。适合使用 OpenCode 或 OpenCode Go 模型的用户。通过自动注入 x-opencode-session 头部来维持会话状态。
설치
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:nobu121/dsh-opencode-sessionConfiguration
The plugin row lives in the bundle's cordis.patch.yml; all keys are optional:
- insert:
- id: opencode-go-session-header
name: dsh-opencode-session
config:
providers: [opencode, opencode-go] # route keys to attach the header to
mode: session-id # 'session-id' | 'uuid'
debug: false
debugFile: null # optional absolute path
providers— provider route keys whose requests get the header. The defaults cover the pi-ai catalog idsopencodeandopencode-go; add your own route key when you serve OpenCode through a custom provider name.modesession-id(default) — header value = the DSH session id of the model call. Unique per conversation, stable across turns, compaction, retries and process restarts.uuid— a random UUID derived once per DSH session id (opaque; kept in memory, so it resets when the process restarts).
debug— log every streamed call that receives the header viactx.logger(the dsh process console).debugFile— optional absolute path. When set, every streamed call that receives the header appends one JSON line ({"ts","provider","model","session","header","value"}) to that file — handy when the dsh console is not visible.
To override configuration in a profile without editing the package, add a
row with the same id in the profile's own cordis.patch.yml (it replaces the
whole config, so restate every key).