DeepSeek Harness Plugin Hub

发布与管理完整 Harness Profiles,发现适合你的插件。

探索

插件目录环境预设文档中心动态

社区

发布插件联系我们报告问题

相关链接

Plugin Hub GitHubDeepSeek Harness 官方项目系统状态隐私说明
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

独立、非官方社区项目,与 DeepSeek 官方无隶属、授权或背书关系。

Opencode Session — DeepSeek Harness 插件(DSH Plugin)
← Plugins

dsh-opencode-session

Opencode Session

DeepSeek Harness 插件:自动为 OpenCode / OpenCode Go 提供商请求添加稳定的、按会话区分的 x-opencode-session 请求头——修复 400 MissingSessionID,并保持 OpenCode 的会话亲和性 / 提示词缓存路由正常工作。

插件会安装到这里;不确定时保持 web。

npx -y @deepseek-ai/dsh plugin --profile web add dsh-opencode-session@0.1.1
README兼容性版本

兼容性与来源证明

Opencode Session 以 dsh-opencode-session 发布,当前版本为 0.1.1。Plugin Hub 会校验它的 manifest,并保存精确安装来源,便于复现安装结果。

DSH 兼容范围
*
运行环境
any
发布来源
npm
Registry 更新时间
2026/9/20

版本

0.1.1stable
2026/9/11

相关插件

正在加载相关插件…

最新版
0.1.1
DSH
*
HMR
重启进程
Tree shaking
未声明可安全裁剪
解包体积
15.7 kB
文件数
4
Surface
any
许可证
MIT
发布源
npm
GitHub
★ 0
周下载
1,245
安全扫描
✓ v0.1.1 扫描通过
最近提交
2026/9/11
查看源码 ↗
README Badge

点击下方 Badge 复制 Markdown,粘贴到 README 即可。

这是你的 Plugin?认领权益 · 优先安全扫描

验证 package.json 声明的 GitHub 仓库,即可管理这个公开页面。认领后,Hub 会优先安排当前版本的安全扫描,并在通过后公开展示结果。

认领这个 Plugin →
报告问题
DeepSeek Harness Plugin Hub
ProfilesPlugins分类动态文档登录管理 Profiles
ProfilesPlugins分类动态文档登录

相关插件

继续浏览 memory-context 分类下经过校验的插件。

Memory Plugin@openviking/dsh-memory-plugin适用于 DeepSeek Harness 的 OpenViking 记忆与上下文套件Contextdsh-context用于上下文洞察和管理的 DeepSeek Harness 插件,提供上下文仪表板和上下文命令,帮助了解上下文的构成及其演变过程。Weknora@wxg-prc-cpg/dsh-weknora适用于 DeepSeek Harness (dsh) 的 WeKnora 知识检索工具:通过自有知识库进行语义搜索、文档阅读以及 RAG/代理回答。Memsearch Dsh@zilliz/memsearch-dsh适用于 DeepSeek Harness 的 MemSearch 插件:在多个代理之间共享 Markdown 记忆,支持捕获、步骤前上下文注入、记忆召回技能和技能候选审核面板。

README

dsh-opencode-session

A DeepSeek Harness (DSH) plugin that automatically sends the x-opencode-session request header on model calls routed to OpenCode / OpenCode Go providers — one stable session id per DSH conversation.

Why

Since 2026-09-05 OpenCode's relay requires an x-opencode-session header on API requests (tracked upstream in deepseek-harness discussion #5495); without it, requests fail with 400 MissingSessionID-style errors. Requests that share the same header value are pinned to the same upstream backend, which is also what keeps OpenCode's prompt cache warm across the turns of one conversation.

This plugin:

  • fixes the 400 by always attaching the header to OpenCode(Go) requests,
  • keeps the cache/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),
  • leaves every other provider, and every request that already carries the header, untouched.

Install

From the npm registry (once published):

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

From a local checkout:

dsh plugin --profile web add ./path/to/dsh-opencode-session

Then fully restart your dsh profile (bundle layers are read at startup). The startup log shows:

[opencode-go-session-header] active for providers [opencode, opencode-go] with mode session-id

If you run DSH from a source checkout instead, load it as an overlay: pnpm dsh web --patch ./cordis.patch.yml.

Configuration

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 ids opencode and opencode-go; add your own route key when you serve OpenCode through a custom provider name.
  • mode
    • session-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 via ctx.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).

How it works

  1. Listens on the llm/stream waterfall. A call whose options.provider names a configured OpenCode route and which carries a sessionId is driven through an AsyncLocalStorage store holding the header value.
  2. globalThis.fetch is patched once. While such a store is active, the outgoing request receives x-opencode-session: <value> (unless it already carries the header — an existing value always wins).
  3. Both registrations are fiber-scoped ctx effects: stopping / updating / unloading the plugin restores the original fetch and removes the listener.

Non-OpenCode providers, requests without a sessionId (some auxiliary hand-built calls), and model discovery requests pass through untouched.

Notes / limitations

  • The header is attached to chat/streaming requests inside an llm/stream call. The one-shot model listing used by the Models page (GET <baseURL>/models) is a separate flow and does not receive the header; if your OpenCode endpoint also rejects that listing, open an issue.
  • The plugin relies on DSH outbound LLM requests going through the Node global fetch. If a future DSH version swaps its network stack, the plugin stops injecting (symptom: the 400 comes back) — uninstall then.

Development

node --check lib/index.js
npm test        # local behavior tests against an echo server

Publishing (for maintainers)

The package is plain ESM JavaScript with zero dependencies; npm test runs automatically via prepublishOnly.

npm login                       # once, with your npm account
npm pack --dry-run              # preview exactly what lands in the tarball
npm publish                     # files = lib/, cordis.patch.yml, README.md

Before publishing, double-check the name is free on the npm registry and fill in author, homepage, and repository in package.json if you like.

License

MIT