DeepSeek Harness Plugin Hub

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

探索

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

社区

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

相关链接

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

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

DeepSeek Harness Plugin Hub
ProfilesPlugins分类动态文档登录管理 Profiles
ProfilesPlugins分类动态文档登录
← Plugins

dsh-opencode-session-fallback

Opencode Session Fallback

DeepSeek Harness 插件:为 OpenCode 路由上不带会话的 LLM 请求提供备用会话 ID,避免自动审查因 400 MissingSessionID 而失败。

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

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

兼容性与来源证明

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

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

版本

0.1.0stable
2026/10/28

相关插件

正在加载相关插件…

最新版
0.1.0
DSH
*
HMR
重启进程
Tree shaking
未声明可安全裁剪
解包体积
13.6 kB
文件数
5
Surface
any
许可证
MIT
发布源
npm
GitHub
★ 0
周下载
0
最近提交
2026/10/28
查看源码 ↗
README Badge

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

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

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

认领这个 Plugin →
报告问题

相关插件

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

Experimental Session Search@deepseek-ai/dsh-experimental-session-search为 Agents 提供搜索和读取当前工作区早期会话的工具。Hindsight Coding Agents@vectorize-io/hindsight-coding-agents面向编程代理的仅反思式 Hindsight 长期记忆(可插拔支持多种运行框架:opencode、……),自动在后台导入(无需设置 CLI)。Contextdsh-context用于上下文洞察和管理的 DeepSeek Harness 插件,提供上下文仪表板和上下文命令,帮助了解上下文的构成及其演变过程。Memory Plugin@openviking/dsh-memory-plugin适用于 DeepSeek Harness 的 OpenViking 记忆与上下文套件

README

dsh-opencode-session-fallback

A small DeepSeek Harness (DSH) plugin that gives session-less LLM requests on OpenCode routes a fallback sessionId, so auto permission presets stop failing every tool call with 400 MissingSessionID.

No global fetch patching, no provider config changes, no official package overrides.

The problem

OpenCode / OpenCode Go reject inference requests that do not carry an x-opencode-session header:

400 {"type":"error","error":{"type":"MissingSessionID","message":"Request is missing x-opencode-session ..."}}

DSH's @deepseek-ai/dsh-llm-pi-ai adapter only lets pi-ai add that header when the request carries a sessionId. Main conversation calls do carry one — but @deepseek-ai/dsh-experimental-auto-review builds its reviewer request by hand without a sessionId.

So with the auto permission preset on an opencode-go route:

  1. every tool call is first sent to the reviewer model,
  2. that request has no session header → gateway 400,
  3. the review fails → DSH fails closed → the tool body never runs:
Auto review of tool "pwsh" failed; its body was not executed:
auto-review: reviewer ended with error INVALID_REQUEST: 400: {"type":"MissingSessionID", ...}

The fix

Wrap ctx.llm.stream once at startup. Requests that already carry a sessionId, or that target a provider outside the configured list, pass through untouched. Only session-less requests on OpenCode routes (in practice: the auto-review reviewer call) get the configured fallback id; pi-ai then adds x-opencode-session on its own.

ctx.llm.stream(options)
  ├─ options.sessionId present .......... pass through (main chat, subagents, compaction, titles)
  ├─ provider not opencode/opencode-go .. pass through (official DeepSeek etc. untouched)
  └─ session-less + OpenCode route ...... { ...options, sessionId: <fallback> }

Why not patch globalThis.fetch (what some other plugins do)? Because replacing the global fetch wraps every outbound call of the host — including the app's own networking — and can take the whole UI down with connection errors. This plugin only touches the LLM service method.

Behavior guarantees

  • Existing sessionIds are never replaced → per-conversation routing / prompt-cache affinity is preserved.
  • Other providers (for example the official deepseek provider) are not affected at all.
  • Options objects passed by callers are never mutated (a copy is used, so frozen options are fine).
  • Uninstalling restores the original ctx.llm.stream automatically.
  • If the service shape changes in a future DSH release, the plugin logs a warning and stays inert instead of breaking the boot.

Install

Plugins are assembled at DSH startup — restart DSH after installing.

From npm

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

Or use the GUI: Settings → Plugins → install, package name dsh-opencode-session-fallback.

From this Git repository

dsh plugin --profile web add git+https://github.com/zlxlsy666/dsh-opencode-session-fallback.git

From a local checkout

dsh plugin --profile web add "file:C:\path\to\dsh-opencode-session-fallback"

The desktop application manages its own desktop profile: use its Plugin Manager UI for that profile instead of the CLI.

After a successful start the log shows:

[opencode-session-fallback] active for providers [opencode, opencode-go], fallback session id "dsh-opencode-session-fallback"

Configuration (optional)

Override with the same entry id in the profile's cordis.patch.yml:

- id: opencode-session-fallback
  name: dsh-opencode-session-fallback
  config:
    providers: [opencode, opencode-go]    # routes that need a session id
    fallbackSessionId: my-stable-id       # value used when the request has none
    debug: false                          # log every injection

Uninstall

dsh plugin --profile web remove dsh-opencode-session-fallback

Restart DSH afterwards.

Compatibility

  • Built and verified against DSH 0.2.1-rc.2 (desktop) with opencode-go + deepseek-v4.1-flash, where it fixed the failure end-to-end (auto preset, tools execute, reviewer returns normal allow/deny decisions).
  • Requires ctx.llm.stream to exist (inject: ['llm']); otherwise the plugin logs a warning and does nothing.
  • Pairs well with any DSH version that ships the pi-ai OpenCode providers.

Development

node --check lib/index.js
node test/smoke.mjs   # 5 assertions, no DSH runtime required

License

MIT


中文说明

解决的问题

OpenCode / OpenCode Go 要求每个推理请求都带 x-opencode-session 头,缺失会返回 400 MissingSessionID。DSH 的 dsh-llm-pi-ai 只在请求带 sessionId 时才让 pi-ai 补这个头,而 @deepseek-ai/dsh-experimental-auto-review 的 reviewer 请求是手工拼的、没有 sessionId。

结果:在 opencode-go 路由 + auto 权限预设下,每次工具调用先过 reviewer → reviewer 请求 400 → 审查失败 → fail-closed → 工具全部无法执行。

修复方式

启动时包一层 ctx.llm.stream:

  • 已有 sessionId 的请求(主对话、子代理、压缩、会话标题)原样透传;
  • 其他 provider(例如官方 deepseek)完全不受影响;
  • 只有「缺 sessionId 且命中 OpenCode 路由」的请求(实际就是 reviewer)补一个兜底 id, pi-ai 随后自动加上 x-opencode-session。

不接管全局 fetch(那会把宿主自身的出网调用一起包住,可能直接让 UI 报 connection error), 也不修改 provider 配置、不覆盖任何官方包。

安装

插件在 DSH 启动时装配,装完必须重启 DSH。

  • npm:dsh plugin --profile web add dsh-opencode-session-fallback
  • GUI:设置 → 插件 → 安装,填包名
  • Git:dsh plugin --profile web add git+https://github.com/zlxlsy666/dsh-opencode-session-fallback.git
  • 本地目录:dsh plugin --profile web add "file:C:\path\to\dsh-opencode-session-fallback"

桌面版的 desktop profile 由应用自己管理,请在应用的插件管理器里安装。

启动日志应出现:

[opencode-session-fallback] active for providers [opencode, opencode-go], fallback session id "dsh-opencode-session-fallback"

可选配置

在 profile 的 cordis.patch.yml 用同 id 覆盖:

- id: opencode-session-fallback
  name: dsh-opencode-session-fallback
  config:
    providers: [opencode, opencode-go]
    fallbackSessionId: my-stable-id
    debug: false

卸载

从插件管理器卸载(或 dsh plugin --profile web remove dsh-opencode-session-fallback)后重启 DSH, ctx.llm.stream 会自动恢复。

已验证环境

DSH 0.2.1-rc.2 桌面版 + opencode-go 路由 + deepseek-v4.1-flash:修复后 auto 预设下工具正常执行, reviewer 能正常返回 allow/deny 决策。

许可

MIT