barbarab82253/opencode2dsh ↗★ 0
opencode2dsh
免密钥接入并使用免费的 OpenCode Zen 模型 适合希望在 DSH 中免费调用 OpenCode Zen 模型且无需配置 API 密钥的用户。
同名套件的其他儲存庫
安裝
此插件尚未提供可驗證的 bundle,或相容性檢查未通過。請先閱讀倉庫說明。 閱讀完整 README ↗
說明文件
閱讀完整 README ↗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. |
allowedModels | [] | Model whitelist, adapter mode only — legacy sidecar ignores it (plugin 0.3.14+, issue #83): exact model ids DSH may show and call. Empty exposes every eligible free-lane model. Narrowing only — paid/deprecated/blocklist/probe rules still win, and a direct call to a non-whitelisted id fails fast with a tagged error before any network traffic. |
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. |
firstEventMs / bodyIdleMs / responsesBodyIdleMs | 30000 / 120000 / 300000 | Adapter only, plugin 0.3.7+: stream-liveness watchdogs, in ms (integers from 1 to 600000). Time to the first stream event, mid-response body silence, and the body-idle floor for Responses models (muse-spark-*). Increase firstEventMs for slow cold starts. Unset keeps the defaults; restart DSH after editing. |
Local OpenCode delegation (plugin 0.3.x, docs/delegation.md, ref #76) — opt-in fallback for the persistent 403 FreeTierError credential gate. Disabled by default; the anonymous path is unchanged unless you enable it:
delegation:
enabled: true # arm the delegate (default false)
# opencodePath: '' # explicit binary; else managed -> global -> npm
# minVersion: '1.18.0' # candidates below this are skipped
# memLimit: '96MiB' # GOMEMLIMIT for the child
# gcPercent: 30 # GOGC for the child
# trimIntervalMs: 60000 # Windows EmptyWorkingSet tick; 0 disables
# startTimeoutMs: 60000 # health-wait budget
Enabling it makes the plugin custody your opencode credential (only the opencode entry, seeded 0600 into an isolated XDG root, never logged) and run a managed local opencode serve when — and only when — the anonymous lane and its sibling retry both refuse with the credential gate. Read docs/delegation.md §2 before enabling.