Introduction¶
DeepSeek Harness (DSH) extends model support through plugins. OpenCode Go and Zen models usually require specific provider routing. This plugin registers the opencode-go (subscription) and opencode-zen (free) routes, making the DSH model selector look like the official client.
Core Features¶
- Route registration: Registers two provider routes:
opencode-go(subscription) andopencode-zen(free). - Dynamic model list: Fetches the public endpoint
https://opencode.ai/zen/go/v1/modelsin real time and automatically syncs newly added or delisted models; falls back to a built-in snapshot if the endpoint is unreachable. - Zero-configuration keys: Automatically discovers the subscription key from DeepSeek Harness itself, supporting environment variables, credential files, and key pool.
- Raw error passthrough: Displays the raw message returned by the gateway (such as a 403 error) in the GUI.
- Interface adaptation: Implements the new DSH adapter interface (
prepareCall) and is compatible withdsh-llm0.1.0-rc.6 ~ 0.1.1-rc.x.
Installation and Activation¶
Run the following command in the terminal to install the plugin:
dsh plugin --profile web add github:Yuanloss/dsh-opencode-go-sub
After installation, restart dsh web. Two groups will appear in the model selector: OpenCode Go (subscription) and OpenCode Zen (free).
Key Configuration¶
The plugin supports three key sources, in descending priority: environment variables > ~/.dsh/.credentials.yaml > key pool.
It is recommended to enter the API key once in the DSH credential interface. DSH writes the credential to ~/.dsh/.credentials.yaml, and the plugin reads this file at startup. If using environment variables, set OPENCODE_GO_API_KEY before restarting dsh web.
If using a key pool, configure keys under pools.opencode-go in pool-config.json.
Important Notes¶
- Avoid manually adding a provider with the same name: Do not manually add a custom model provider named
opencode-go. The plugin has already registered this route internally, and manual addition will trigger aDUPLICATE_ADAPTERconflict. - Check for built-in conflicts: The built-in pi-ai in DSH ships with an
opencode-goprovider. If it is enabled on the Models settings page, it will cause the entire batch registration to fail. Delete the provider with the same name (or delete the entirellm-pi-ai.providers.opencode-gosection insettings.yaml). - Session header handling: The gateway requires each inference request to carry a stable per-conversation id (the
x-opencode-sessionheader). The plugin automatically reads the session id injected by the DSH agent-loop and sends it; no manual configuration is needed. - Image attachments: The current version does not forward image attachments; image blocks are ignored.
- Regional restrictions: Access to the GPT / Grok models from mainland China returns 403; for the new DeepSeek version, enable “Enable models hosted in China” in the opencode.ai console.
Known Limitations¶
- gpt-5.6-luna / grok-4.5: These models use the Responses API. From mainland China, they are rejected by the upstream (403) and require system-level TUN mode (browser-level proxying does not work for the dsh web process).
- qwen3.7-max: The upstream uses the Anthropic
/messagesdialect. Calls through chat/completions may fail in the current version; consider using qwen3.8-max or qwen3.7-plus. - DSH version compatibility: The adapter contract is compatible under
dsh-llm0.1.0-rc.6 ~ 0.1.1-rc.x.
Summary¶
This plugin solves the cumbersome issue of managing OpenCode Go and Zen models in DSH by registering specific routes and automatically discovering keys. After installation, DSH has model catalog display capabilities consistent with the official opencode client, while also automatically handling details such as session headers.