Introduction¶
The built-in web_search tool in DeepSeek Harness (DSH) calls Anthropic-compatible Messages endpoints. When the provider points to OpenCode Go / Zen, the gateway requires requests to include the x-opencode-session header. Missing this header causes the request to be rejected and returns a MissingSessionID error.
dsh-web-search-opencode-go is a plugin that fixes routing issues with DSH’s built-in web_search on OpenCode Go / Zen by automatically injecting the required routing headers.
What It Is¶
This is a Drop-in patched fork designed to allow DSH’s web_search tool to work correctly through the OpenCode Go / Zen gateway without modifying the official DSH installation.
- Owner: leeyoung1
- License: MIT
Core Features¶
- Automatic header injection: Automatically adds the
x-opencode-sessionandx-opencode-client: dshheaders. - Routing issue fix: Resolves OpenCode Go / Zen rejecting requests due to a missing session ID.
- Installation modes: Supports DSH Bundle (recommended) and Drop-in copy installation modes.
- Configurable headers: Supports custom headers by configuring
headersandsessionId. - Plug-and-play: No modification to the official DSH installation is required. After installation, restart
dsh webto use it.
Installation and Enablement¶
Bundle mode installation is recommended.
- Run the installation command:
dsh plugin --profile web add github:leeyoung1/dsh-web-search-opencode-go
The installation command adds the plugin to `dsh.profile.bundles` and automatically handles the patch configuration.
- Restart the
dsh webprocess to load the new plugin.
Typical Usage¶
After installing and restarting dsh web, configure baseURL and set the API Key environment.
- Configure the provider to point to OpenCode Go in
~/.dsh/settings.yaml:
web-search-deepseek:
baseURL: https://opencode.ai/zen/go/v1
apiKeyEnv: DEEPSEEK_API_KEY
(Note: `apiKeyEnv` can also be set to `OPENCODE_GO_API_KEY`)
- Search using natural language in the conversation, or invoke the tool directly:
web_search: DeepSeek Harness GitHub
Configuration Details¶
In addition to the basic baseURL and apiKeyEnv, optional headers and sessionId can be configured.
Optional Configuration Items¶
web-search-deepseek:
baseURL: https://opencode.ai/zen/go/v1
# 自定义 x-opencode-session 头部
headers:
x-opencode-session: my-fixed-session
# 显式指定会话 ID
sessionId: my-fixed-session
Header Priority¶
If not explicitly configured, the plugin determines the session ID in the following order:
1. Explicitly configured headers['x-opencode-session']
2. Explicitly configured sessionId
3. Current DSH agent session ID
4. Provider-level UUID (used for non-agent calls)
Notes¶
- Runtime environment: Requires Node.js 20+ or pnpm.
- Restart mechanism:
dsh webmust be restarted after installation for changes to take effect. - Platform support: Supports macOS, Linux, and Windows.
- Official package protection: The plugin works as a Drop-in copy or Bundle and does not modify the official profile package in the DSH installation directory.
Summary¶
This plugin resolves routing errors when DSH uses OpenCode Go / Zen as the search provider. By using the standard installation command and configuration file changes, the normal functionality of the web_search tool can be restored.