Introduction¶
DeepSeek Harness (DSH) facilitates model integration through plugin-based extensions: select a provider, configure a profile, and switch within the model list. If you wish to use the free models listed in the OpenCode Zen documentation, the standard approach involves installing the OpenCode CLI separately, starting a service, or layering an additional proxy. For those who simply want to run agents within Harness without maintaining an extra runtime, this path is somewhat heavy.
Below is an introduction to the community plugin dsh-opencode-free (maintainer x5427876): it calls the Zen inference endpoint via native HTTP within DSH. Models appear in the OpenCode Zen Free group within the selector, defaulting to anonymous access, with an optional Zen API Key. The plugin is categorized as “Model Inference” in the SkillHub directory; source code and instructions are available on GitHub. The directory site has no official affiliation with DeepSeek or High-Flyer, and the plugin itself declares no affiliation with OpenCode or DeepSeek.
What is this¶
dsh-opencode-free is the npm package dsh-opencode-free (the README example currently shows version 0.3.6, MIT License). It registers the opencode-zen-free provider, requests https://opencode.ai/inference/v1 directly via DSH’s PiAiAdapter and the pi-ai transport layer, while tool execution remains on the DSH host side. It does not require installing OpenCode, a login flow, a standalone server, containers, or LiteLLM.
Anonymous is the default authentication method; configuring config.apiKey or the environment variable OPENCODE_API_KEY switches to Key authentication. However, this does not automatically switch to paid models, nor does it guarantee that models previously unavailable will suddenly become available.
Core Features¶
Integration capabilities specified in the README include:
- Native Model Selector Display: Streaming output, reasoning, tool calls, usage, and cancellation, aligned with DSH-side capabilities.
- Automatic Catalog Sync: Metadata follows models.dev and the Zen online directory; individual models can be hidden on the plugin details page.
- Availability Probing: View probe results and latency on the details page; quota exhaustion or gate rejection will not cause the model to be removed from the list (the conclusion may be inconclusive).
- Caching and Fallback: Retain the cached list if refresh fails; fallback to the built-in pi-ai model list if there is no cache.
Key Priority: config.apiKey → OPENCODE_API_KEY → Anonymous public.
Installation and Activation¶
Environment Requirements¶
| Dependency | Version |
|---|---|
| DeepSeek Harness | 0.2.1-rc.2 (Must match exactly; each plugin release supports only one DSH version) |
| Node.js | ^22.19.0 or >=24.0.0 |
Do not ignore peer dependency warnings; the README states that all four runtime peers are required.
Installation Commands¶
First, confirm the DSH version, then install the pinned version package according to your profile (replace web with your target profile):
dsh --version
dsh plugin --profile web add dsh-opencode-free@0.3.6
If already installed, use update instead of adding again.
Verify the package and merged configuration:
dsh plugin --profile web list dsh-opencode-free --depth 0
dsh --profile web --dump-config
The dsh-opencode-free package and the opencode-free plugin entry should each appear once. After restarting DSH (or waiting for HMR), select a model under OpenCode Zen Free in the model selector.
Update and Removal:
dsh plugin --profile web update dsh-opencode-free
dsh plugin --profile web remove dsh-opencode-free
Profile Limitation: The details page routing depends on the webServer service; the built-in headless profile does not provide this service, so the related UI is unavailable.
Typical Usage¶
Model Selection and Catalog Behavior¶
The model selector displays the current catalog snapshot rather than a fixed, hardcoded list. Context length, image support, and reasoning levels are derived from public metadata for each model. For details on refresh intervals, probe result interpretation, cache recovery, and Key validation, see the repository’s usage guide.
On the plugin details page, you can enable or hide models and use Probe now to check availability. Reading the model list also triggers a local check once per day. Probing sends real inference requests and consumes quota, testing only one enabled model at a time; results are retained across restarts.
Models are only removed if the catalog retracts them or explicitly marks them as unavailable; gate rejections, quota exhaustion, invalid Keys, and network failures are considered inconclusive. See catalogue decision rules for details.
Optional API Key (Desktop Example)¶
For Desktop scenarios, it is recommended to configure the Key in the profile’s cordis.patch.yml rather than relying on the shell environment:
- id: opencode-free
name: dsh-opencode-free
config:
apiKey: <your Zen key>
Reload DSH after modifying the configuration. Do not write Keys and configuration into issues or public logs.
Implementation Details (Anonymous Requests)¶
The plugin is implemented based on the maintainer’s analysis of the OpenCode CLI source code and request validation. Anonymous requests carry OpenCode CLI format identity headers, time-encoded session IDs, streaming parameters, and read / bash tool declarations for admission (without actual execution capability; calls to missing tools will be rejected before entering host dispatch). Keyed requests retain the caller’s original tools and prompts.
Adaptations specific to the anonymous path include: presenting DSH’s pwsh as bash on Windows and restoring it upon return; supplementing admission declarations when tools are missing; and replacing eligible tool-less compaction requests with an OpenCode-style summary system prompt. Switching between anonymous and Key changes the request prefix; compaction is a separate request.
For protocol details and evidence boundaries, see protocol notes.
Scenarios and Notes¶
Who it is for: Developers already using DSH 0.2.1-rc.2 who wish to try OpenCode Zen free-tier models and accept the risks of unofficial integration and upstream changes.
Must-read before installation:
- Permissions and Interception: The plugin runs with the current DSH process permissions; it performs process-level wrapping on
globalThis.fetchandnode:http(s)request/get, acting only on the/inference/v1path of the Zen inference origin over HTTPS. If other plugins in the same process also call this endpoint, they will also have identity headers added. You should read the source code and DSH SAFETY.md before installation. - Anonymous Access Limitations: Identity fields are sent by this plugin, not the official CLI; there is no third-party availability guarantee, and upstream changes may cause failure at any time. Anonymous quota is shared by egress IP.
- Debug Logs:
DSH_OPENCODE_FREE_DEBUG=1will output diagnostic information containing sensitive fragments such as Authorization prefixes; do not expose raw logs. - Troubleshooting: If the plugin fails to load, check the exact DSH version, peers, profile, and
webServer. A403 FreeTierError … only be used from within OpenCodeindicates upstream admission rejection; appearing alone cannot distinguish between IP, Key, or model delisting; reinstalling cannot resolve gate issues. A grey “not measured” on the details page indicates an inconclusive probe, not that the model has disappeared.
The maintainer has recorded anonymous L0 acceptance for some models in compat reports, but Web, Desktop, compaction, etc., are still marked as not fully verified; refer to the README’s Security and limitations for the definitive source.
Conclusion¶
dsh-opencode-free integrates OpenCode Zen free models into the DSH model selector, eliminating the need to deploy a separate OpenCode runtime. The trade-offs include unofficial protocol adaptation, process-level HTTP wrapping, and shared anonymous quota constraints. Align DSH and plugin versions before use, and track release notes on the directory page or GitHub.
- Directory Page: https://www.skillhub.cn/plugins/x5427876/dsh-opencode-free
- GitHub: https://github.com/x5427876/dsh-opencode-free