dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
Full OpenCode Go subscription + OpenCode Zen free-tier model catalog directly in DeepSeek Harness — same experience as the official opencode client.
Server-side plugin that registers two provider routes: opencode-go (subscription) and opencode-zen (free).
listModels() fetches https://opencode.ai/zen/go/v1/models in real time (same source as the opencode client's /models). Models added/removed upstream sync automatically; if the endpoint is unreachable it falls back to a built-in snapshot, so the list is never empty.without inject). Resolution chain:
OPENCODE_GO_API_KEY / OPENCODE_ZEN_API_KEY / OPENCODE_API_KEY (env wins, matching the DSH credentials layer);~/.dsh/.credentials.yaml — the DSH credentials file. Enter the key once inside DSH and you're done; no opencode client, no terminal env vars needed;pool-config.json (keys under pools.opencode-go / pools.opencode).
On startup the plugin logs the key source (e.g. key resolved from dsh-credentials:OPENCODE_GO_API_KEY) so you can confirm.reasoning_content passthrough, tool calls, token usage (incl. cache hits), 429/5xx auto-retry.prepareCall), compatible with dsh-llm 0.1.0-rc.6 through 0.1.1-rc.x (works on both older and newer DeepSeek Harness releases).From GitHub:
dsh plugin --profile web add github:Yuanloss/dsh-opencode-go-sub
From a local clone:
dsh plugin --profile web add file:/path/to/your/clone/dsh-opencode-go-sub
After a restart of dsh web, the model picker shows two groups: OpenCode Go(订阅) (subscription) and OpenCode Zen(免费) (free), with models addressed as opencode-go/<model> and opencode-zen/<model>.
As long as you enter the key once anywhere inside DSH, the plugin reads it automatically — no manual file editing needed.
An API key entered in the DSH settings/credentials UI is written by the DSH credentials service into ~/.dsh/.credentials.yaml; the plugin reads that file directly (key name OPENCODE_GO_API_KEY). Any of the three entry points below works — they all end up the same way:
~/.dsh/.credentials.yaml):
OPENCODE_GO_API_KEY: sk-your-go-subscription-key
Get the key at opencode.ai console → your workspace → OpenCode Go.dsh web):
OPENCODE_GO_API_KEY=sk-your-go-subscription-key
pools.opencode-go.keys in its pool-config.json.Resolution priority: env vars >
~/.dsh/.credentials.yaml> key pool. The plugin reads the credentials file directly and does not depend on any cordis service injection.
⚠️ Important — configuring the key vs. adding a provider route:
- Configuring the key: entering the key in any UI / credential setting is fine; the plugin picks it up automatically.
- Adding a provider route: do not manually add a custom provider named
opencode-goin Settings → Models. The plugin already registers theopencode-go(subscription) andopencode-zen(free) routes; a same-named entry triggers aDUPLICATE_ADAPTERconflict and can prevent the plugin from loading.- DSH's built-in pi-ai ships a same-named catalog entry (the common trap): DSH's built-in multi-provider adapter pi-ai itself ships a provider whose id is
opencode-go, and the Models page offers it as a one-click "installed provider". Enabling it writes anopencode-goentry (usually onlyapiKeyEnv) underllm-pi-ai.providersin~/.dsh/settings.yaml— colliding with this plugin'sopencode-goroute. Because llm-pi-ai registers all of its providers (e.g. the Volcano Engine (Agent Plan) / SiliconFlow providers you added) in one all-or-nothing batch, one duplicateopencode-gomakes the whole batch fail — your other added model providers silently disappear from the picker. Fix: delete that same-namedopencode-goprovider on the Models page (or remove the wholellm-pi-ai.providers.opencode-goblock fromsettings.yaml, keepingOPENCODE_GO_API_KEYin.credentials.yaml). The plugin scans for this conflict at startup and prints deletion guidance; pi-ai re-registers automatically on save, no restart needed.- The plugin ships both groups — no manual provider entry needed. If you do want to reach another OpenAI-compatible endpoint, use a different route name (e.g.
ocgo,my-gateway).
The picker shows two groups by provider (matching the official opencode client):
public, no subscription required), marked "(免费)".The subscription list syncs the live gateway catalog (/zen/go/v1/models); known models render in the built-in order, newly appearing models append to the end of the group; offline fallback to the snapshot.
/v1/responses. Both are hosted by OpenAI / xAI and are blocked from mainland China (403 unsupported_country_region_territory) — you need an exit in a supported region (the VPN must be system-wide TUN mode; a browser-only proxy does not affect the dsh web process)./messages dialect and may fail via chat/completions in this version — extend the MESSAGES_ONLY logic yourself, or use qwen3.8-max / qwen3.7-plus instead.x-opencode-session header (mandatory for OpenCode Go since 2026-09-05): the gateway requires a stable per-conversation id on every inference request; missing it returns 400 MissingSessionID. The plugin automatically reads the conversation id DSH's agent-loop injects (GenerateOptions.sessionId, shaped like session-<uuid>), normalizes it to the bare UUID, and sends it on every request; non-conversation direct calls fall back to a process-stable UUID, so no configuration is needed. If you reach opencode-go through DSH's built-in pi-ai route instead of this plugin, discussion #5495 offers a sessionHeader: x-opencode-session profile option.The adapter contract is verified against the real registries of dsh-llm 0.1.2-rc.1 and 0.1.5-rc.1:
npm test # contract + conflict + session-header + real-registry integration
node test-integration.mjs "<path to dsh-llm package>" # regress a candidate version
registerAdapter (incl. DUPLICATE_ADAPTER semantics), listProviders, imageRequestPricing, listModels, prepareCall.imageRequestPricing must be implemented: dsh-token-meter's measure() calls it unconditionally, and dsh-compaction-basic's prepareCompaction() reaches it — so a missing method throws TypeError: adapter.imageRequestPricing is not a function and breaks context compaction. Adapters extending dsh-llm's abstract class inherit a default; this zero-dependency plugin declares it explicitly (returning undefined = no image pricing declared). Fixed in v0.1.10.xxx is not a function or INVALID_* means the contract drifted and the adapter needs updating.x-opencode-session fix yet — opencode-go working depends on this plugin's implementation, not on the DSH version.