dsh-deep-opencode: Access OpenCode Free Models in DSH without an API Key

Preface

DeepSeek Harness (DSH) reads providers such as opencode and opencode-go from the shared models.dev directory, and these work normally when an OpenCode API Key is available. If you rely solely on OpenCode’s free-tier models, the gateway will reject non-OpenCode clients, with a common error message:

OpenCode's free tier can only be used from within OpenCode

To use the same set of free models within Harness without disguising requests as “coming from OpenCode”, you need to actually run the OpenCode process locally and have it initiate the inference requests on your behalf. The following introduces the community plugin dsh-deep-opencode (maintainer temidayoxyz) and how it provides an independent opencode-free route and resolves these models without requiring an API Key configuration.

What Is This

dsh-deep-opencode is a model inference plugin for DSH: it launches a local opencode serve process and delegates each conversation turn to that process for execution, so that requests are identified as coming from OpenCode on the gateway side, thereby using the free-tier models currently provided by OpenCode. The implementation approach is similar to OpenChamber.

Core Features

Standalone Provider: opencode-free

The Harness’s original opencode / opencode-go still follow the key-requiring path; this plugin adds opencode-free. The model list comes from the running OpenCode service and is not hardcoded by the plugin—when OpenCode adds or removes free models, the list changes accordingly.

The README notes: at OpenCode v2.0.18, the free tier includes Big Pickle, Ling 3.0 Flash Fin Free, LongCat 2.5 Preview Free, MiMo-V2.6-Flash Free, Muse Spark 1.3 Free, Nemotron 3.5 Lightning Free, Nemotron 3 Ultra Free, Space Bunny Free, etc. (subject to the OpenCode version installed on your machine).

Locally Hosted OpenCode Service

The plugin manages a one-time opencode serve instance: binding address, port, startup and single-turn timeouts, etc. can all be configured via cordis.yml (see below). By default it listens on the loopback address, and port 0 means the operating system assigns a free port.

Session and Tool Bridging

  • reuseSessions (default true): A single Harness session corresponds to one OpenCode session, allowing multi-turn conversations to continue context; setting it to false reverts to “one Provider session per request”.
  • bridgeHarnessTools (default true): The DSH tool schema of the current request enters the main turn; on the OpenCode side, Harness tools are called via dsh_call / dsh_list, without needing separate MCP configuration.
  • forwardHarnessContext (default false): Whether to append a summary of capability names in the system prompt; Harness instructions and context are still forwarded via companion.

A single Harness request follows the complete OpenCode Agent execution (including tool call steps); cancelling the Harness request interrupts the Agent on the Provider side, not just closing the event stream.

Extension Events (Host Plugin)

Other Host plugins can subscribe to Cordis events, e.g. deep-opencode/event (native events), deep-opencode/permission, deep-opencode/form (permissions and forms require a Handler or use DSH’s existing approval UI).

Installation and Activation

Prerequisites

OpenCode v2 CLI must be installed on the system PATH; you can verify first:

opencode --version

Installing the Plugin

After npm publication, install from the registry:

dsh plugin add dsh-deep-opencode

Install from GitHub (the repository has committed build artifacts, no local build needed):

dsh plugin add https://github.com/temidayoxyz/deep-opencode

You can also declare it in the profile’s cordis.patch.yml:

- name: dsh-deep-opencode

Windows legacy upgrade: If ERR_PNPM_EPERM occurs during updates, you can disable this plugin first and fully restart Harness, update while the plugin is disabled, then enable and restart again after the update completes. Newer versions watch a temporary copy instead of the plugin installation directory.

The plugin runs with the current dsh process privileges; please review the source code and MIT license before installation.

Typical Usage

  1. Complete installation and restart Harness (if the documentation or your environment requires a restart).
  2. Select opencode-free as the Provider in the model selector.
  3. Choose a free model currently offered by OpenCode from the list and chat as usual.

When you need to change the OpenCode executable path, timeouts, or session policy, add a config for the plugin in cordis.yml, e.g.:

- name: dsh-deep-opencode
  config:
    opencodeCommand: opencode
    turnTimeoutMs: 1200000

Common configuration options (see the README for the full table):

Field Default Meaning
opencodeCommand opencode Executable name or path
cwd harness working directory Project directory and model directory read location when no project session exists
host 127.0.0.1 Bound address of the hosted service
port 0 Listening port, 0 means automatic selection
startupTimeoutMs 120000 Maximum time to wait for the service to be ready
turnTimeoutMs 900000 Upper limit for single-turn delegation, 0 means no limit
reuseSessions true Whether to reuse OpenCode sessions per Harness session
logDiagnostics true Output service version and discovered models at load time
bridgeHarnessTools true Whether to bridge DSH tools to OpenCode

Diagnostic reports are written by default to deep-opencode/diagnostics.json in the Harness home directory (the diagnosticsPath field can be changed).

Use Cases and Notes

Suitable for: Those already using DSH for agents or automation who want to try OpenCode’s free-tier models without applying for or maintaining an OpenCode API Key; machines that can install and run OpenCode v2 CLI locally.

Notes:

  • The list of free models and gateway policies are determined by OpenCode; the plugin is only responsible for initiating requests “from within OpenCode”.
  • Single-turn duration is constrained by turnTimeoutMs; adjust it as needed for long Agent tasks.
  • Relies on the local opencode serve; ensure the CLI version and network environment meet OpenCode’s own requirements.
  • The DSH ecosystem philosophy is “everything is a plugin”; this plugin comes from a community maintainer, please read the source code and license before use, and understand its behavior of starting external processes locally.

Conclusion

dsh-deep-opencode connects OpenCode’s free-tier models into DeepSeek Harness through a local opencode serve and the opencode-free Provider, bypassing the limitation that “non-OpenCode clients cannot use the free tier”, without requiring an API Key. For more information, see the community directory skillhub.cn/plugins/temidayoxyz/deep-opencode and the GitHub repository temidayoxyz/deep-opencode.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye