DeepSeek Harness Plugin Hub

Publish and manage complete Harness Profiles. Discover Plugins for your next setup.

Explore

PluginsPresetsDocsNews

Community

Publish a pluginContactReport an issue

Resources

Plugin Hub on GitHubDeepSeek HarnessSystem statusPrivacy notice
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

Independent and unofficial. Not affiliated with, authorized by, or endorsed by DeepSeek.

DeepSeek Harness Plugin Hub
ProfilesPluginsCategoriesNewsDocsSign inManage Profiles
ProfilesPluginsCategoriesNewsDocsSign in
← Plugins

dsh-opencode-session-fallback

Opencode Session Fallback

DeepSeek Harness plugin: give session-less LLM requests on OpenCode routes a fallback session id, so auto-review stops failing with 400 MissingSessionID.

The plugin will be installed here. Keep web if you are unsure.

npx -y @deepseek-ai/dsh plugin --profile web add dsh-opencode-session-fallback@0.1.0
READMECompatibilityVersions

Compatibility and provenance

Opencode Session Fallback is published as dsh-opencode-session-fallback and currently resolves to version 0.1.0. The Hub verifies its manifest and preserves the exact installation source for reproducible installs.

DSH compatibility
*
Runtime surfaces
any
Release source
npm
Registry updated
10/28/2026

Versions

0.1.0stable
10/28/2026

Related plugins

Loading related plugins…

Latest
0.1.0
DSH
*
HMR
Process restart
Tree shaking
Safe tree shaking not declared
Unpacked size
13.6 kB
Files
5
Surface
any
License
MIT
Source
npm
GitHub
★ 0
Weekly downloads
0
Last push
10/28/2026
View source ↗
README badge

Click the badge to copy Markdown for your README.

Do you maintain this Plugin?Claim benefit · Priority security scan

Verify the GitHub repository declared in package.json to manage this listing. After you claim it, Hub will prioritize a security scan of the current version and publish the result when it passes.

Claim this Plugin →
Report an issue

Related plugins

More verified plugins in memory-context.

Hindsight Coding Agents@vectorize-io/hindsight-coding-agentsReflect-only Hindsight long-term memory for coding agents (harness-pluggable: opencode, …), with automatic background ingestion (no setup CLI).Contextdsh-contextA DeepSeek Harness plugin for context insight and management, with context dashboard and context command, for understanding how the context is made of, and how it evolves.Memory Plugin@openviking/dsh-memory-pluginOpenViking memory and context bundle for DeepSeek HarnessMnemondsh-mnemonComposable, view-based context for DeepSeek Harness. Pluggable sources and strategies, with layered memory and self-evolving skills out of the box.

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