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.

Opencode Session — DSH Plugin for DeepSeek Harness
← Plugins

dsh-opencode-session

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.

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

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

Compatibility and provenance

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

DSH compatibility
*
Runtime surfaces
any
Release source
npm
Registry updated
9/20/2026

Versions

0.1.1stable
9/11/2026

Related plugins

Loading related plugins…

Latest
0.1.1
DSH
*
HMR
Process restart
Tree shaking
Safe tree shaking not declared
Unpacked size
15.7 kB
Files
4
Surface
any
License
MIT
Source
npm
GitHub
★ 0
Weekly downloads
1,245
Security scan
✓ v0.1.1 scan passed
Last push
9/11/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
DeepSeek Harness Plugin Hub
ProfilesPluginsCategoriesNewsDocsSign inManage Profiles
ProfilesPluginsCategoriesNewsDocsSign in

Related plugins

More verified plugins in memory-context.

Memory Plugin@openviking/dsh-memory-pluginOpenViking memory and context bundle for DeepSeek HarnessContextdsh-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.Weknora@wxg-prc-cpg/dsh-weknoraWeKnora knowledge retrieval tools for DeepSeek Harness (dsh): semantic search, document reading and RAG/agent answers over your own knowledge bases.Memsearch Dsh@zilliz/memsearch-dshMemSearch plugin for DeepSeek Harness: shared markdown memory across agents, with capture, pre-step context injection, memory-recall skill, and a skill-candidate review panel.

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