Introduction¶
DeepSeek Harness (DSH) allows functionality to be extended through plugins. If you need to use OpenCode Go subscription models, manually configuring protocols, context length, and maximum output tokens can be cumbersome. The dsh-opencode-go plugin solves this problem by automatically handling session request headers, reading the gateway model catalog, and displaying subscription usage.
What It Is¶
dsh-opencode-go is a plugin maintained by Duskriver and licensed under the MIT License. It enables DSH to call OpenCode Go subscription models seamlessly, supporting streaming responses, tool calling, and image input. The plugin automatically adds the session request headers required by OpenCode Go, eliminating the need for users to manually configure the model’s base protocol and parameters.
Core Features¶
- Session request headers: Each request includes the Harness User-Agent and
x-opencode-session. The same session keeps a stable ID, supporting gateway routing and prompt caching optimization. - Streaming and history: Supports streaming output, tool calling, and history replay.
- Image input: Supports models that declare image capabilities in the catalog.
- Model capacity overrides: Context window and maximum output can be overridden per model; empty values inherit from the online catalog.
- Per-model switches: Each model independently controls its display state in sessions. Regular models are enabled by default, while deprecated models are disabled by default.
- Network proxy: Supports HTTP(S) or SOCKS5 proxies for conversations, model catalog updates, and subscription usage queries.
- Prompts and caching: The plugin does not add hidden system prompts; the session ID is used for gateway routing.
Installation and Enablement¶
The plugin supports DSH 0.1.5-rc.1 and later versions. Before installing, make sure the corresponding version of DSH is installed.
Install in the DSH Interface (Recommended)¶
- Open the Plugins page in DSH and click Add Plugin in the top-right corner.
- Enter
dsh-opencode-goand click Install. - After installation succeeds, click Enable Now.
- Open Settings → OpenCode Go, enter your API Key, and save.
Command-Line Installation¶
If DSH does not have an “Add Plugin” entry, run the following command in a terminal:
dsh plugin --profile web add dsh-opencode-go
After installation, start or restart dsh web, then repeat the configuration steps above.
Headless Mode Installation¶
Headless users should replace web with headless:
dsh plugin --profile headless add dsh-opencode-go
Configuration and Usage¶
After successful installation, configure the plugin in Settings → OpenCode Go.
Network Proxy¶
Open Settings → OpenCode Go → Advanced Settings → Proxy Address and enter a proxy URL.
Supported formats include:
- http://127.0.0.1:7890
- socks5://127.0.0.1:1080
- http://username:password@host:port (URL encoding required)
Proxy connections are initiated by the machine running DSH. Proxy settings take effect immediately after saving, without requiring a restart.
Model Switches¶
In Settings → OpenCode Go, the switch on the right side of each model determines whether it appears in the session model selector. Regular models are enabled by default, while deprecated models are disabled by default. You can individually enable any deprecated model, or disable regular models.
Headless Configuration¶
Headless users can save the following content as headless.patch.yml to select a default model:
- id: agent-default-model
config:
provider: dsh-opencode-go
model: deepseek-v4.1-flash
Then load the API Key and run a task in Bash or Zsh:
export OPENCODE_API_KEY
dsh --profile headless --patch ./headless.patch.yml "你好"
Account Management (Multiple Keys)¶
For Headless or manual configuration, specify accounts in the plugin’s config:
apiKeyEnv: OPENCODE_API_KEY
accounts:
- id: primary
name: 主账号
apiKeyEnv: OPENCODE_API_KEY
- id: backup
name: 备用账号
apiKeyEnv: OPENCODE_GO_BACKUP_KEY
The plugin tries accounts from top to bottom and supports automatic fallback.
Image Count Limit¶
Set maxImages in Settings → OpenCode Go → Advanced Settings.
By default, the number of images is unrestricted. After setting it, the full history carried in a single request (including images in tool outputs) will be subject to this limit. For example, if set to 30, sending the 31st image will unload the oldest image’s content.
Notes¶
- Version compatibility: The plugin no longer includes installation scripts for
@google/genaiandprotobufjs. No special setup is required for a fresh installation. If you need to retry after a failed installation in an older version, uninstall it first and then retry. - Headless proxy: In Headless mode, proxy settings can also be specified in the plugin’s
configusingproxyURL. - Debugging: If you encounter an error, set the environment variable
DSH_OPENCODE_GO_DEBUG_DIRin the terminal where DSH is started, then restart and view debug logs in the specified directory. - Coexistence: Starting from 0.1.17, the plugin uses a dedicated
dsh-opencode-goprovider. Existing sessions may need to switch the provider fromopencode-gotodsh-opencode-go.
Summary¶
dsh-opencode-go makes using OpenCode Go subscription models in DeepSeek Harness simple and controllable through automated configuration and fine-grained controls (such as per-model switches, proxy support, and image limit control). It provides consistent support for both Web interface interactions and Headless script tasks.
- Catalog page: dsh-opencode-go - SkillHub
- GitHub repository: Duskriver/dsh-opencode-go