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

  1. Route registration: Registers two provider routes: opencode-go (subscription) and opencode-zen (free).
  2. Dynamic model list: Fetches the public endpoint https://opencode.ai/zen/go/v1/models in real time and automatically syncs newly added or delisted models; falls back to a built-in snapshot if the endpoint is unreachable.
  3. Zero-configuration keys: Automatically discovers the subscription key from DeepSeek Harness itself, supporting environment variables, credential files, and key pool.
  4. Raw error passthrough: Displays the raw message returned by the gateway (such as a 403 error) in the GUI.
  5. Interface adaptation: Implements the new DSH adapter interface (prepareCall) and is compatible with dsh-llm 0.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

  1. 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 a DUPLICATE_ADAPTER conflict.
  2. Check for built-in conflicts: The built-in pi-ai in DSH ships with an opencode-go provider. 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 entire llm-pi-ai.providers.opencode-go section in settings.yaml).
  3. Session header handling: The gateway requires each inference request to carry a stable per-conversation id (the x-opencode-session header). The plugin automatically reads the session id injected by the DSH agent-loop and sends it; no manual configuration is needed.
  4. Image attachments: The current version does not forward image attachments; image blocks are ignored.
  5. 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

  1. 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).
  2. qwen3.7-max: The upstream uses the Anthropic /messages dialect. Calls through chat/completions may fail in the current version; consider using qwen3.8-max or qwen3.7-plus.
  3. DSH version compatibility: The adapter contract is compatible under dsh-llm 0.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.