Introduction¶
DeepSeek Harness (DSH) is a plugin-based framework. dsh-llm-opencode-go is a plugin that integrates OpenCode Go as a native DSH model provider. The plugin implements the three wire formats of OpenCode Go independently, mapping protocol requests, tool calls, and reasoning to DSH’s message structures, and converts streaming responses back into DSH StreamChunk values.
Core Features¶
- Protocol Support: Natively supports OpenAI Responses, OpenAI-compatible Chat Completions, and Anthropic Messages.
- Model Discovery: Supports the
GET /modelsendpoint and implements a hybrid memory and disk caching mechanism. - Tool Calls & Reasoning: Implements the full round-trip flow for tool calls (definition, arguments, results, subsequent turns) and supports mapping reasoning according to the protocol (including Anthropic’s thinking budgets).
- Session Affinity: Uses the
x-opencode-sessionheader to implement session affinity. - Streaming & Error Handling: Converts SSE to
StreamChunk, provides usage statistics and finish reasons; offers stable, provider-agnostic error codes (e.g., AUTH, RATE_LIMIT, QUOTA, CONTEXT_WINDOW_EXCEEDED). - UI Integration: Provides a single-page configuration interface in the DSH web client, with a quota capsule at the bottom of the sidebar.
Installation & Activation¶
Use the official installation command to add the plugin. A full profile restart is required after installation, as the bundle layer is read at startup.
dsh plugin add dsh-llm-opencode-go
The startup log should display the following:
dsh-llm-opencode-go: provider "opencode-go" ready at https://opencode.ai/zen/go/v1 (credential OPENCODE_GO_API_KEY, models discover)
Configuration¶
The plugin requires an API Key reference configuration. apiKeyEnv specifies the credential reference name, not the key itself.
Insert the following configuration into cordis.patch.yml:
- insert:
- id: opencode-go
name: dsh-llm-opencode-go
config:
apiKeyEnv: OPENCODE_GO_API_KEY
Usage & Monitoring¶
- Set API Key: Can be set via the environment variable
OPENCODE_GO_API_KEYor through the DSH credential seam (web Models page). The plugin resolves the reference on every request. - View Usage: The plugin provides a quota capsule at the bottom of the sidebar, displaying current session 5H/Week/Month usage; usage can also be viewed via the configuration page panel.
Notes¶
- Runtime Environment: Requires Node.js ≥ 20.
- Zero Runtime Dependencies: The plugin itself does not rely on external runtime libraries, but requires a Node.js environment.
- Web Client: Graphical configuration and quota capsule features depend on the DSH web client.