English | 简体中文
The usage panel and the quota capsule in the web client. The quota and the counters in the image are sample data.
A DeepSeek Harness (DSH) plugin that serves OpenCode Go (https://opencode.ai/zen/go/v1) as a native DSH model provider.
The plugin implements OpenCode Go's three wire formats itself: it translates harness messages, tools, and reasoning into each protocol's request, and translates the streamed response back into DSH StreamChunk values.
- insert:
- id: opencode-go
name: dsh-llm-opencode-go
config:
apiKeyEnv: OPENCODE_GO_API_KEYThat is the whole configuration a deployment may want to write; every key in it is optional because these are the defaults. apiKeyEnv names a credential reference, not the key itself: the key value never enters the config file, and the plugin resolves the reference through the harness credential seam on every request, so a key written by the web Models page reaches the next call with no restart.
| Provider route | opencode-go (configurable) |
| Protocols | OpenAI Responses, OpenAI-compatible Chat Completions, Anthropic Messages |
| Model discovery | GET /models: each model's name, description, limits, modalities, reasoning ladder and preferred protocol, cached in memory and on disk |
| Session affinity | x-opencode-session, one stable id per conversation |
| Tool calling | Full round trip for every dispatched call: definitions, fragmented arguments, tool results, follow-up turn |
| Reasoning | Per-model effort ladders from the service, per-protocol translation, including Anthropic thinking budgets |
| Streaming | SSE → StreamChunk, with usage, finish reason, and an idle watchdog |
| Failures | Stable provider-neutral codes (AUTH, RATE_LIMIT, QUOTA, CONTEXT_WINDOW_EXCEEDED, MODEL_DEPRECATED, MODEL_UNAVAILABLE, …) |
| Configuration UI | One page in the web client, with a row in Settings' own navigation and a Configure control on the plugin's row: API key, credential reference, model visibility and variants, fetching the model list, usage |
| Fast entries | A quota capsule at the sidebar's foot (one ring per window — 5H / Wk / Mo — with what is left of each), a usage panel of its own (from that row, or the keyboard), and a usage page under Settings; the capsule has an on/off switch in the configuration page |
| Runtime | Node.js ≥ 20; no runtime dependencies |
dsh plugin add dsh-llm-opencode-goThen fully restart the profile: bundle layers are read at startup. The startup log should carry:
dsh-llm-opencode-go: provider "opencode-go" ready at https://opencode.ai/zen/go/v1 (credential OPENCODE_GO_API_KEY, models discover)
Either export OPENCODE_GO_API_KEY in the environment that launches DSH, or store it through the credentials seam — the web Models page writes it. The plugin resolves the reference per request, so both work and neither requires a restart.
Usage has three entries, all reading the same facts:
| Entry | Where |
|---|---|
| The quota capsule at the sidebar's foot | Beside Settings. One row, three groups — ◉ 5H 92% │ ◉ Wk 58% │ ◉ Mo 9% — visible without a click; that row opens the usage panel, and the gear beside it opens the plugin's configuration page. |
| The usage panel | From that row, or the keyboard (desktop Ctrl/Cmd+U): the subscription's three windows first, this route's counters under them, and a header that stays on screen as they scroll — the way to the plugin's configuration page, and an × back to the conversation. |
| Settings → Built-in plugins | A tab carrying the same content as the panel. |
All three need the web client; a deployment without one has none of them and is otherwise unchanged. The capsule can be switched off from the configuration page (showQuotaCapsule, on by default): hiding that row leaves the other two entries in place. See Configuration.
Every key in the config block above is optional: these are the defaults. The full field table, catalog shaping, and image input live in Configuration.
Point it at another credential reference, if you would rather the plugin read a differently-named variable:
config:
apiKeyEnv: OC_KEYThe value is never read from the config file itself, only the variable name.
Or configure it from the web client. Settings carries an OpenCode Go row of its own, beside the pages the shell ships, and the same page is behind the sidebar's Plugins page: the dsh-llm-opencode-go bundle's opencode-go row has a Configure control. Either door opens the plugin's own page: the API key, the credential reference it is stored under, one switch per catalog model for what the picker offers, the model variants, whether the sidebar capsule shows, a control that re-reads the service's model list, and what this route has spent. The key is written to the credential store, never to cordis.patch.yml, and the page is mounted only by a deployment that serves the web client. See Configuration.
Details live under docs/; start with what you need:
- Models — the live model facts, protocol preference and fallbacks, training-data gate, capacity snapshot, text/image split
- Configuration — full field table, shaping the catalog, image input, the graphical and fast entries
- Wire protocol — endpoints and auth,
x-opencode-session, reasoning and tool-calling translations - Reliability — stable failure codes and limits
- Development — project status, verification suites, re-measure probes, architecture
MIT
