FishBottle7/opencode2dsh
DSH plugin — free OpenCode Zen models for DeepSeek Harness (DSH). Free LLM API, no API key needed. 在 DSH 中使用 OpenCode Zen 免费模型,无需 API key
Project Overview项目介绍
opencode2dsh is a Cordis plugin for DSH (DeepSeek Harness) that registers a native LlmAdapter connecting to OpenCode Zen's anonymous free lane, exposing Zen models under the opencode2dsh provider without an API key or account. Use it to access Zen models in DSH with zero setup. Note: the anonymous lane is quota-per-IP, so heavy use may trigger rate limits.
opencode2dsh 是面向 DSH(DeepSeek Harness)的 Cordis 插件,以原生 LlmAdapter 形式接入 OpenCode Zen 的匿名免费通道,无需 API Key 或注册即可在 DSH 模型列表中以 opencode2dsh 提供方调用 Zen 全量模型。适用于希望零配置使用 OpenCode Zen 模型的 DSH 用户;注意匿名通道按 IP 配额限速,频繁请求可能触发限流。
请帮我了解并安装插件:【opencode2dsh】【https://github.com/FishBottle7/opencode2dsh】
Send this message to DSH in your current session. CLI install commands may not be accurate across systems — DSH will figure it out for you.把上面这条消息直接发给当前会话里的 DSH,让它帮你了解并安装。安装命令不一定准确,发给 DSH 更稳。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add @opencode2dsh/dsh-plugin
把 FishBottle7/opencode2dsh 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
opencode2dsh
Free OpenCode Zen models, natively inside DSH (DeepSeek Harness).
No API key. No registration. No extra process.
English | 简体中文
opencode2dsh registers a native DSH LlmAdapter that streams directly from
OpenCode Zen's anonymous free lane — the same
models OpenCode's own CLI uses without an account, served to your DSH model
picker as a regular provider called opencode2dsh.
Requests leave your machine looking exactly like traffic from the OpenCode CLI (same user agent, same correlation headers), and the model catalog stays fresh through a three-tier fallback chain. There is nothing to log into and nothing to host.
Highlights
- Zero credential, zero setup — the anonymous lane needs no key; install, restart, chat
- Native adapter, no sidecar — one npm package, no child process, no binary, no local port (the legacy Go sidecar is not part of the published package; see
legacy/) - CLI-identical disguise — requests carry the OpenCode CLI user agent and its session/request/project header set, derived per conversation
- Live catalog with a fallback chain — live upstream list ∩ free-by-metadata, falling back to offline cache and a verified static list
- Self-healing — fast startup retries, periodic refresh, and a written health snapshot for diagnostics
- Proper error surfaces — upstream failures (rate limit, auth, timeout, transport) arrive in DSH as classified finish reasons, and retries stay owned by DSH
Install
From the plugin market (recommended, once this repo is listed there):
in DSH open Settings → Plugin Market, search opencode2dsh, one-click
install.
From npm:
dsh plugin --profile web add @opencode2dsh/dsh-plugin
From source (build the tarball yourself):
git clone https://github.com/FishBottle7/opencode2dsh.git
cd opencode2dsh/packages/plugin
pnpm install && pnpm pack
dsh plugin --profile web add ./opencode2dsh-dsh-plugin-<version>.tgz
Verify: restart dsh web, open the model picker, and pick a model from
the opencode2dsh group.
Requires DSH (DeepSeek Harness) with a web profile; Node.js ≥ 20 (already
present if DSH runs); outbound HTTPS to opencode.ai and models.dev.
Configuration
Defaults work out of the box. Override via the profile's cordis.patch.yml:
- id: opencode2dsh
name: '@opencode2dsh/dsh-plugin'
config:
mode: adapter # adapter (default) | sidecar
providerId: opencode2dsh
refreshSeconds: 300 # catalog refresh cadence
| Option | Default | Description |
|---|---|---|
mode |
adapter |
adapter: native LlmAdapter streaming straight from Zen. sidecar: legacy local-agent mode, not bundled — build the agent from legacy/agent and pass agentPath. |
providerId |
opencode2dsh |
Provider name shown in DSH. |
refreshSeconds |
300 |
Live catalog refresh interval. Pricing metadata refreshes every 24 h. |
agentPath |
auto-resolved | Sidecar only: path to the agent binary. |
agentArgs |
— | Sidecar only: extra CLI args for the agent. |
restartDelayMs / restartMaxDelayMs / maxConsecutiveCrashes |
1000 / 60000 / 5 |
Sidecar only: restart backoff and circuit breaker. |
How it works
DSH session
│ harness chunks (block-start / text-delta / usage / finish …)
▼
ZenAdapter (registered LlmAdapter)
│ pi-ai openai-completions stream
▼
https://opencode.ai/zen/v1 ← Authorization: Bearer public
with CLI-identical headers:
user-agent: opencode/…
x-opencode-client, x-opencode-session, x-session-affinity,
X-Session-Id, x-opencode-request, x-opencode-project
- Session correlation — session/project ids are SHA-256 derived from the conversation's first user turn (stable per conversation, non-reversible), and each request gets a fresh random id, mirroring the CLI.
- Catalog fallback chain — S1: live
GET /v1/models; S2: models.dev pricing metadata decides "free"; S3: a compile-time verified static list. A disk cache (~7-day TTL) covers upstream outages. - Resilience — the adapter registers immediately at startup; if the first catalog fetch races your network (VPN/TUN reconnects, DNS), the plugin retries on a short cadence (~1 min) before settling into the periodic refresh.
- Sidecar mode (
mode: sidecar, legacy) — spawns a local Go agent (a single-tenant port of opencode2api) on127.0.0.1:<random>, token-authenticated, and registers a standardllm-pi-airoute. Not part of the published package; build it fromlegacy/agent(go build ./cmd/agent) and pointagentPathat the binary.
Health & troubleshooting
The plugin writes a health snapshot after every refresh round:
~/.opencode2dsh/adapter-status.json
{
"status": "ready",
"total": 64,
"exposed": 9,
"lastError": "",
"writtenAt": "2026-08-29T07:01:54.915Z"
}
| Symptom | Likely cause & fix |
|---|---|
Boot screen shows Failed to load plugins … list slot "settings.plugin.item" requires options.id |
Your DSH is too old (≤ 0.1.0-rc.6): the settings-slot contract predates the plugin 0.3.0 browser half. Upgrade DSH to ≥ 0.1.0-rc.7 (latest recommended). Plugin ≥ 0.3.1 registers in either slot shape, so on old DSH you lose at most the settings card — model routing is unaffected. |
| Only 3 models | Startup fetch raced your network; retries land within ~1 min. Check adapter-status.json for lastError. |
lastError: "fetch failed" persisting |
Outbound HTTPS to opencode.ai blocked; check proxy/VPN rules. |
| Rate-limit errors in chat | The anonymous lane is quota-per-IP; switch network node or wait. |
Connection error to 127.0.0.1:* |
A stale sidecar route shadows the adapter; plugin ≥ 0.2.1 removes it at startup. |
Install fails with ERR_PNPM_IGNORED_BUILDS |
A transitive dependency of pi-ai (@google/genai, protobufjs) has build scripts that are not needed at runtime. Approve-or-decline them via the plugin market, or set both to false under allowBuilds: in the profile's pnpm-workspace.yaml. |
Security
- No secrets involved: the anonymous lane's key is the literal string
public; nothing is stored, nothing telemetry. - Install paths restricted to
lib/only; no build scripts run from dependencies. - All requests go directly from your machine to
opencode.ai/models.dev.
Development
git clone https://github.com/FishBottle7/opencode2dsh.git
cd opencode2dsh/packages/plugin
pnpm install
pnpm typecheck && pnpm test # 44 unit tests
pnpm build # bundle to lib/
The legacy Go sidecar lives in legacy/agent (go test ./...). Architecture
notes and the porting record live in docs/.
Releasing: pnpm pack in packages/plugin (prepack builds and syncs docs).
Acknowledgments
- opencode2api by
@jasonxu114514 — the legacy Go sidecar
in
legacy/agentis a port of its anonymous-lane implementation, and the catalog fallback chain and request-disguise details are derived from it. This project stands on its shoulders. - OpenCode — for running the free anonymous Zen lane.
- @earendil-works/pi-ai — the wire layer used by adapter mode.
- DeepSeek Harness and the dsh-market community.
Friends
LinuxDo — 新的理想型社区 / a new ideal community
License
MIT © FishBottle7
Hilbert-beinghappy/seektty
weijiafu14/pi2dsh
Totoro-qaq/dsh-plugin-bridge
Renzic-Stone/DSH-EasyRewrite
xiajiajun516/dsh-config-manager
baihejiangnan/deepseek-harness-desktop
MichengAI/dsh-codex-ui
LX2000WASD/dsh-web-plugin-manager