barbarab82253/opencode2dsh ↗★ 0

opencode2dsh

免密钥接入并使用免费的 OpenCode Zen 模型 适合希望在 DSH 中免费调用 OpenCode Zen 模型且无需配置 API 密钥的用户。

包名
opencode2dsh
兼容性
待验证
版本
0.1.28
许可证
NOASSERTION
最近更新
2026年10月19日

同名包的其他仓库

安装

此插件尚未提供可验证的 bundle,或兼容性检查未通过。请先阅读仓库说明。 阅读完整 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
OptionDefaultDescription
modeadapteradapter: native LlmAdapter streaming straight from Zen. sidecar: legacy local-agent mode, not bundled — build the agent from legacy/agent and pass agentPath.
providerIdopencode2dshProvider name shown in DSH.
refreshSeconds300Live 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.
agentPathauto-resolvedSidecar only: path to the agent binary.
agentArgs—Sidecar only: extra CLI args for the agent.
restartDelayMs / restartMaxDelayMs / maxConsecutiveCrashes1000 / 60000 / 5Sidecar only: restart backoff and circuit breaker.
firstEventMs / bodyIdleMs / responsesBodyIdleMs30000 / 120000 / 300000Adapter 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.