dsh-opencode-go 0.1.21 → 0.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/LICENSE +1 -0
  2. package/README.en.md +74 -194
  3. package/README.md +73 -184
  4. package/THIRD_PARTY_NOTICES.md +7 -1
  5. package/docs/advanced.en.md +137 -0
  6. package/docs/advanced.md +135 -0
  7. package/docs/assets/accounts.png +0 -0
  8. package/docs/assets/advanced-settings.png +0 -0
  9. package/docs/assets/model-settings.png +0 -0
  10. package/docs/assets/usage-panel.png +0 -0
  11. package/docs/development.md +65 -7
  12. package/docs/fork-review-2026-09-25.md +191 -0
  13. package/docs/independent-package.md +2 -2
  14. package/docs/verification.md +283 -0
  15. package/lib/build-info.json +8 -1
  16. package/lib/client.js +830 -635
  17. package/lib/index.js +52687 -856
  18. package/lib/types/account-manager.d.ts +25 -0
  19. package/lib/types/account-operations.d.ts +31 -0
  20. package/lib/types/account-policy.d.ts +16 -0
  21. package/lib/types/account-recovery.d.ts +2 -0
  22. package/lib/types/account-selection.d.ts +30 -0
  23. package/lib/types/account-service.d.ts +12 -0
  24. package/lib/types/accounts-contract.d.ts +38 -0
  25. package/lib/types/accounts.d.ts +8 -1
  26. package/lib/types/adapter.d.ts +33 -11
  27. package/lib/types/call-trace.d.ts +54 -0
  28. package/lib/types/catalog-manager.d.ts +20 -0
  29. package/lib/types/catalog.d.ts +6 -4
  30. package/lib/types/client/accounts-controller.d.ts +8 -17
  31. package/lib/types/client/hint-mark.d.ts +17 -0
  32. package/lib/types/client/host-compat.d.ts +7 -0
  33. package/lib/types/client/host-primitives.d.ts +11 -0
  34. package/lib/types/client/locales.d.ts +14 -3
  35. package/lib/types/client/section-controller.d.ts +11 -48
  36. package/lib/types/client/staged-form.d.ts +1 -3
  37. package/lib/types/client/usage.d.ts +1 -1
  38. package/lib/types/config-contract.d.ts +70 -0
  39. package/lib/types/config.d.ts +13 -54
  40. package/lib/types/conversion/context.d.ts +5 -1
  41. package/lib/types/conversion/image-pool.d.ts +24 -0
  42. package/lib/types/conversion/replay.d.ts +1 -1
  43. package/lib/types/conversion/stream.d.ts +1 -1
  44. package/lib/types/gateway-diagnostics.d.ts +22 -0
  45. package/lib/types/gateway-error.d.ts +2 -0
  46. package/lib/types/gateway-url.d.ts +7 -0
  47. package/lib/types/google-fetch.d.ts +6 -0
  48. package/lib/types/google-generative-ai.d.ts +3 -0
  49. package/lib/types/host-settings.d.ts +11 -0
  50. package/lib/types/index.d.ts +2 -2
  51. package/lib/types/model-metadata.d.ts +5 -3
  52. package/lib/types/models-contract.d.ts +7 -0
  53. package/lib/types/protocol-contract.d.ts +5 -0
  54. package/lib/types/protocol-policy.d.ts +4 -0
  55. package/lib/types/reasoning.d.ts +36 -6
  56. package/lib/types/request-control.d.ts +2 -0
  57. package/lib/types/sdk-types.d.ts +3156 -0
  58. package/lib/types/settings-bridge.d.ts +22 -0
  59. package/lib/vendor-licenses.txt +1861 -0
  60. package/package.json +7 -2
package/LICENSE CHANGED
@@ -1,6 +1,7 @@
1
1
  MIT License
2
2
 
3
3
  Copyright (c) 2026 DeepSeek
4
+ Copyright (c) 2026 dsh-opencode-go contributors
4
5
 
5
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
7
  of this software and associated documentation files (the "Software"), to deal
package/README.en.md CHANGED
@@ -1,256 +1,136 @@
1
1
  # dsh-opencode-go
2
2
 
3
- [中文](README.md)
3
+ [简体中文](README.md)
4
4
 
5
- Use OpenCode Go subscription models in [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness), with streaming replies, tool calls, and image input.
5
+ **OpenCode Go subscription usage and multiple-account management** for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness), with convenient access to quotas, reset times, and account switching.
6
6
 
7
- The plugin automatically adds the session headers required by OpenCode Go, reads the gateway model catalog, and displays subscription usage. There is no need to configure model protocols, modalities, context windows, or maximum output tokens manually.
7
+ DSH already supports OpenCode Go natively. This plugin focuses on usage inside conversations, managing multiple accounts, and dedicated model and settings controls.
8
8
 
9
- ## Features
9
+ - **Usage at a glance**: see usage beside the conversation input, then open the panel for five-hour, weekly, and monthly percentages and reset times.
10
+ - **Accounts in one place**: inspect each account's quota and key status, drag to reorder, switch inside a conversation, or enable automatic fallback.
11
+ - **Clearer model and settings controls**: search and filter models, adjust visibility, limits, and thinking budgets; advanced settings are grouped by purpose, with hints and a reset action.
10
12
 
11
- - **Session headers**: Every request includes the Harness User-Agent and `x-opencode-session`. A session keeps a stable ID to support gateway routing and prompt-cache optimization; actual cache hits depend on the upstream service.
12
- - **Streaming and history**: Supports streaming output, tool calls, and history replay through pi-ai.
13
- - **Image input**: Supports models that advertise image capability in the catalog.
14
- - **Model capacity overrides**: Override the context window and maximum output per model, with blank values inheriting the online catalog.
15
- - **Per-model switches**: Control which models appear in conversations, with changes applied immediately. Ordinary models default to on and deprecated models default to off; any model can be enabled individually.
16
- - **Prompt and caching**: The plugin does not add hidden system prompts; the session ID is used for gateway routing.
13
+ Supports Chinese and English, following DSH's interface language. The screenshots below show the Chinese interface.
17
14
 
18
- ## Installation and usage
15
+ ## View subscription usage
19
16
 
20
- Supports DSH `0.1.5-rc.1` and later, including alpha, rc, and stable releases. Compatibility will be maintained as new host versions are released.
17
+ Click the usage pill beside the conversation input to open the current account's subscription usage. Bars show the **percentage used**, turn amber near the limit, and red when exhausted. Each quota window shows its reset time.
21
18
 
22
- Verified versions: `0.1.5-rc.1`, `0.1.5-rc.2`, `0.1.6-alpha.1`, `0.1.6-alpha.2`, `0.1.7-alpha.1`, `0.1.7-alpha.2`, `0.1.7-rc.1`, `0.1.7-rc.2`, `0.2.0-rc.2`, and `0.2.1-alpha.1`.
19
+ ![Subscription usage: current account, three quota windows, and reset times](docs/assets/usage-panel.png)
23
20
 
24
- ### Install from DSH (recommended)
21
+ While visible, usage refreshes every minute. Periodic queries pause while the page is hidden and resume with a refresh when it becomes visible. Temporary failures show a warning; retained readings are marked as previous data. Click **Retry now** after a failure, or **Refresh accounts** in the Settings account card.
25
22
 
26
- 1. Open the **Plugins** page in DSH and click **Add plugin** in the top-right corner.
27
- 2. Enter `dsh-opencode-go` and click **Install**.
28
- 3. If prompted after installation, click **Enable now**.
29
-
30
- ![Add, install, and enable dsh-opencode-go from DSH (Chinese UI)](docs/assets/install-via-dsh.gif)
31
-
32
- Then open **Settings → OpenCode Go**, enter and save your API key, and select an OpenCode Go model in a conversation.
33
-
34
- The plugin can also be installed by entering this Git repository URL:
35
-
36
- ```text
37
- https://github.com/Duskriver/dsh-opencode-go
38
- ```
39
-
40
- The current default branch includes the compiled plugin. Installation needs neither a local build nor a plugin-specific `allowBuilds` entry. URLs pinned to older commits retain those commits' installation behavior; update them to the current branch.
23
+ Under **Settings → OpenCode Go → Advanced settings → Usage display**, choose:
41
24
 
42
- If your DSH version does not have an **Add plugin** entry, use the command-line method below.
25
+ | Mode | Behavior |
26
+ | --- | --- |
27
+ | Auto (default) | Show while a **DSH OpenCode Go** model is selected |
28
+ | Always | Also show configured OpenCode Go account usage while using other models |
29
+ | Off | Hide the conversation pill and stop its polling |
43
30
 
44
- ### Command-line installation (alternative)
31
+ ## Manage multiple accounts
45
32
 
46
- ```sh
47
- dsh plugin --profile web add dsh-opencode-go
48
- ```
33
+ Open **Settings → OpenCode Go → Accounts** to manage accounts:
49
34
 
50
- Start or restart `dsh web`, then:
35
+ ![Account management: ordering, usage details, key actions, and automatic fallback](docs/assets/accounts.png)
51
36
 
52
- 1. Open **Settings → OpenCode Go**.
53
- 2. Enter and save your OpenCode Go API key.
54
- 3. Select an OpenCode Go model from the conversation model picker.
37
+ - Add, rename, replace keys, or remove accounts; up to 20 accounts are supported.
38
+ - See key status, five-hour usage, and a reset countdown in each row; expand it for full usage and account actions.
39
+ - Drag a row's handle to reorder accounts. The first row becomes current, and the order determines automatic fallback priority.
40
+ - Click **Switch** in the conversation usage panel to move the selected account first for subsequent requests in this profile. The other accounts keep their relative order.
55
41
 
56
- ### Headless
42
+ With **Automatic fallback** enabled, an exhausted quota or unusable key causes the plugin to try other accounts in order before output begins. A fallback account that starts producing output moves first and becomes current, and the usage panel shows a switch notice. Requests that have already produced output, recorded token usage, or been canceled are not automatically resent through another account.
57
43
 
58
- Install the plugin into the Headless profile:
44
+ Keys are saved through DSH's credential service. Settings never displays an already saved key.
59
45
 
60
- ```sh
61
- dsh plugin --profile headless add dsh-opencode-go
62
- ```
46
+ ## Install and get started
63
47
 
64
- Save the following as `headless.patch.yml` to select a default model:
48
+ Requires DSH `0.1.5-rc.1` or later. See the [compatibility matrix](docs/development.md#installed-package-matrix) for verified host versions.
65
49
 
66
- ```yaml
67
- - id: agent-default-model
68
- config:
69
- provider: dsh-opencode-go
70
- model: deepseek-v4.1-flash
71
- ```
72
-
73
- Read the API key in Bash or Zsh, then run a task:
50
+ ### Install from DSH
74
51
 
75
- ```sh
76
- read -s OPENCODE_API_KEY
77
- export OPENCODE_API_KEY
78
- dsh --profile headless --patch ./headless.patch.yml "Hello"
79
- ```
52
+ 1. Open **Plugins → Add plugin**.
53
+ 2. Enter `dsh-opencode-go` and click **Install**.
54
+ 3. Click **Enable now** after installation.
80
55
 
81
- The model ID must be available in the current gateway catalog. Web and Headless use separate profiles, so install the plugin in each profile you use.
56
+ ![Install the plugin in DSH](docs/assets/install-via-dsh.gif)
82
57
 
83
- To build from source and install a local package:
58
+ You can also enter the repository URL:
84
59
 
85
- ```sh
86
- npm ci
87
- npm run compile
88
- npm pack
89
- dsh plugin --profile web add ./dsh-opencode-go-0.1.21.tgz
60
+ ```text
61
+ https://github.com/Duskriver/dsh-opencode-go
90
62
  ```
91
63
 
92
- Source development builds the plugin explicitly with `npm run compile`; `--legacy-peer-deps` is not required. Multi-version DSH compatibility tests use independent environments and are not installed during ordinary installation or builds. For Headless, replace `web` with `headless`.
93
-
94
- ### Development and verification
64
+ Command-line installation:
95
65
 
96
66
  ```sh
97
- npm run compile # Regenerate lib/ and commit it with source changes
98
- npm test # Core tests, rebuilding the plugin first
99
- npm run check:dist # Verify shipped artifacts match the source
100
- npm run test:compat # One tarball tested in 9 independent DSH environments
101
- npm run test:install # npm / pnpm Git installs without plugin build approval
102
- npm run verify # All of the above
103
- ```
104
-
105
- Compatibility and installation checks download dependencies, use system temporary directories, and clean up afterward. To check one host, run `npm run test:compat -- v017-rc2`. See the [development guide](docs/development.md) for maintaining host versions.
106
-
107
- ## Updating the plugin
108
-
109
- Update the plugin in the Web profile to the latest npm version:
110
-
111
- ```sh
112
- dsh plugin --profile web update dsh-opencode-go --latest
113
- ```
114
-
115
- Restart `dsh web` and refresh the browser afterwards. For Headless, replace `web` with `headless`; if both profiles have the plugin installed, update each one separately.
116
-
117
- After updating the desktop plugin, fully quit and reopen DeepSeek Harness to load the updated plugin code.
118
-
119
- ## Multiple accounts and switching
120
-
121
- Open **Settings → OpenCode Go → Accounts** to add up to 20 named API keys. Adding, renaming, replacing a key, removing, and selecting a preferred account take effect immediately. Model capacities and advanced fields still use Save. Existing `apiKeyEnv` configuration appears as the default account without re-entering its key.
122
-
123
- Each account shows its rolling, weekly, and monthly usage, reset times, and last successful update. Usage refreshes every minute while the settings page is visible. The conversation usage panel also lets you switch accounts; it immediately clears the old account's data and rejects late responses. Temporary failures retain data only for the same account and key.
124
-
125
- The preferred account is shared by conversations in the current profile and affects subsequent new requests. Requests already generating retain their resolved key. Account metadata and preference survive restart. Web and Headless profiles keep their own configuration. Save or discard a key draft before changing accounts; if another surface switches accounts, the draft remains addressed to the original account.
126
-
127
- Keys are stored through the host credential service and never returned to the page. Configuration contains account names, IDs, and credential references. Read-only environment keys can be selected but cannot be replaced in the UI. Removing accounts created here also removes their dedicated credential; existing external references are retained. Removing every account withdraws the provider until another account is added.
128
-
129
- **Automatic fallback** is off by default. When enabled, missing/rejected keys or exhausted quota can trigger attempts with the other accounts in list order, before any content or tool call is emitted and only when no token usage was reported. Each account is tried at most once per request. The preferred account stays selected; a successful fallback is reported in the usage panel with its reason and time. Partial responses, permission errors, ordinary rate limits, network errors, and server errors stay with host recovery. Cancellation stops further attempts. Quotas remain controlled by the upstream subscriptions.
130
-
131
- For Headless or manual configuration, put the following under the plugin's `config`:
132
-
133
- ```yaml
134
- apiKeyEnv: OPENCODE_API_KEY
135
- accounts:
136
- - id: primary
137
- name: Primary
138
- apiKeyEnv: OPENCODE_API_KEY
139
- - id: backup
140
- name: Backup
141
- apiKeyEnv: OPENCODE_GO_BACKUP_KEY
142
- autoSwitch: false
67
+ dsh plugin --profile web add dsh-opencode-go
143
68
  ```
144
69
 
145
- Supply both keys through the credential service or environment variables. `apiKeyEnv` selects the preferred account. Omitting `accounts` preserves legacy single-key behavior; `accounts: []` explicitly removes every account.
70
+ Start or restart `dsh web` after command-line installation. Web and Headless use separate profiles; install and update each individually.
146
71
 
147
- The Accounts card folds: collapsed, it reports the account count, the preferred account, how many accounts are ready, and the one refresh stamp every row shares (the clock time on the day it happened, the full date and time on hover). Expanded, each account takes one row showing its key state, a wide rolling-quota bar (12px, full row width, quarter marks at 25/50/75%, amber from 80% and red once spent), and its reset countdown; the columns are fixed (handle, name, key state, bar, reading, reset, disclosure), and a name too long for its column ellipsises with the full value in its title, so names of different lengths never move the columns after them; the row's chevron opens the weekly and monthly windows and the rename, replace-key, and remove actions. Drag a row's handle — or focus it and press ↑ / ↓ — to reorder. The list reads top to bottom: the first row is the preferred account and becomes preferred on drop, and automatic fallback follows the same order.
72
+ ### Get started
148
73
 
149
- ## Network proxy
74
+ 1. Open **Settings → OpenCode Go**, enter your OpenCode Go subscription API key and save, or add an account in **Accounts**.
75
+ 2. Select a model under **DSH OpenCode Go** in the conversation model picker.
76
+ 3. Start chatting and check usage beside the input. With multiple accounts, open the panel to switch.
150
77
 
151
- Open **Settings → OpenCode Go → Advanced settings → Proxy address**, enter a proxy URL and click **Save**. For example:
78
+ The plugin registers its own **DSH OpenCode Go** model provider. Selecting a native DSH provider does not automatically use this plugin's account switching. **Always** mode can still show usage for accounts configured in this plugin.
152
79
 
153
- ```text
154
- http://127.0.0.1:7890
155
- socks5://127.0.0.1:1080
156
- ```
80
+ ## Models and settings
157
81
 
158
- HTTPS proxies and authenticated URLs such as `http://username:password@host:port` or `socks5://username:password@host:port` are also supported. URL-encode special characters in the username and password.
82
+ ### Select models and adjust parameters
159
83
 
160
- The next conversation, model listing, metadata download and usage query use the saved proxy without a restart. Save a blank address to use the default network settings; **Reset** restores the inherited configuration value. A failed proxy connection reports an error rather than falling back to a direct connection.
84
+ Search **Available models** by name or ID, or filter by **New in 7 days**, **Customized**, or **Deprecated**. Click **Refresh** to check the latest catalog.
161
85
 
162
- Connections originate from the machine running DSH. On a remote deployment, `127.0.0.1` refers to that server. Headless profiles can set `proxyURL` in the plugin configuration as well.
86
+ ![Model settings: search, filters, visibility switches, and parameter editing](docs/assets/model-settings.png)
163
87
 
164
- ## Subscription usage display
88
+ - Each model's switch controls its visibility in the conversation picker and takes effect immediately.
89
+ - Select a model to inspect its catalog context window, maximum output, and input modalities. Save limit overrides to apply them; empty values use defaults.
90
+ - Reasoning models offer the applicable switch, effort, or token budget options. Budget-based models also accept custom budgets that become available after saving.
165
91
 
166
- Under **Settings → OpenCode Go → Advanced settings → Usage display**, choose a mode and save: **Auto (default)** shows the pill only for this plugin's DSH OpenCode Go models; **Always** keeps it visible with other models, including the built-in `opencode-go` provider; **Off** hides it and stops polling. Disabling OpenCode Go hides the pill in every mode. Click the pill to open the usage panel: its first row is the account in use (state dot, name, Preferred tag, Switch), and Switch turns the card's body into the account list — the current account ticked, reachable with ↑ / ↓ or a click, Escape stepping back. That choice decides which account spends now; the consumption order stays the one this page sets. The three windows take one row each (label, bar, reading) with the reset stamp beneath, and the refresh stamp sits in the card's foot.
92
+ Streaming, reasoning, tool calls, and image input depend on model capabilities. Input modalities shown in Settings come from online model metadata; this plugin currently converts and forwards only image attachments.
167
93
 
168
- Usage refreshes every minute. Temporary network or service errors retain the last reading for the same account, with a failure notice, timestamp, and reason; the usage panel offers an immediate retry. Initial and authentication failures do not show old usage. Catalog, metadata, and usage JSON requests retry a transient connection reset once within the original timeout budget; this cannot guarantee recovery while the network is failing.
94
+ ### Grouped advanced settings
169
95
 
170
- ![OpenCode Go usage display](image.png)
96
+ Advanced settings are grouped into **Usage and protocol**, **Connection**, **Cache and timeouts**, and **Image handling**. Hover over a question mark for help. **Reset all to defaults** clears the card's custom overrides; save to apply the reset. The current account selection is preserved.
171
97
 
172
- ## Interface language
98
+ ![Advanced settings: grouped controls, hints, and a shared reset action](docs/assets/advanced-settings.png)
173
99
 
174
- The plugin follows Harness and supplies Chinese and English copy without storing a separate language preference. With no explicit choice, the Web client matches the browser's preferred languages (usually inherited from the system); native shells with a system-language bridge supply their operating-system languages. English is used when no supported language matches.
100
+ HTTP, HTTPS, and SOCKS5 proxies are supported. After saving, subsequent conversations, catalog updates, and usage queries use the proxy. Connections originate from the machine running DSH; on a remote deployment, `127.0.0.1` refers to that server.
175
101
 
176
- A language explicitly selected in Harness takes precedence and updates the plugin immediately without discarding form drafts. Model names and IDs stay unchanged; usage dates and capacity numbers follow the active interface language. Automatic language detection runs at startup: reload the Web page after changing browser languages, or restart desktop Harness after changing system languages.
102
+ The DeepSeek V4.1 Flash Responses option is experimental, applies only to new requests, and does not promise lower latency. See the [advanced guide](docs/advanced.en.md) for full configuration and usage instructions.
177
103
 
178
- ## Model switches
104
+ Screenshots illustrate the interface. Actual models, quotas, and timestamps depend on your account and the current online catalog.
179
105
 
180
- In **Settings → OpenCode Go**, the switch beside each model controls whether it appears in conversation model pickers. Switch changes are saved immediately; capacity and API key edits still require **Save**. Ordinary models default to on and deprecated models default to off. You can enable a deprecated model individually or disable an ordinary model. Newly discovered models follow the same defaults unless configured individually.
106
+ ## Updates and common questions
181
107
 
182
- For manual configuration, add `modelVisibility` under the plugin's `config`, replacing the example placeholders with actual model IDs:
108
+ Update to the latest npm release:
183
109
 
184
- ```yaml
185
- modelVisibility:
186
- your-model-id: false
187
- your-deprecated-model-id: true
110
+ ```sh
111
+ dsh plugin --profile web update dsh-opencode-go --latest
188
112
  ```
189
113
 
190
- Only the listed IDs receive explicit overrides. Switches affect model pickers only: existing conversations can still call hidden models served by the gateway, and Settings retains the complete model list.
191
-
192
- The older `showDeprecatedModels` and `visibleModelIds` fields no longer control visibility. Use the individual switches or `modelVisibility`; retaining old fields does not prevent the plugin from loading.
193
-
194
- ## Image count cap
195
-
196
- Under **Settings → OpenCode Go → Advanced settings**, set `maxImages` to a positive integer and save; no restart is needed. It is unset by default, with no image-count cap. Clearing or resetting removes the user override and inherits the base configuration; if the base has no cap either, the count is unlimited.
197
-
198
- The count covers the full history sent in one request, including tool-result images. Repeated occurrences of the same attachment count separately. With a cap of `30`, 30 images pass through; 31 images cause the oldest occurrence to be offloaded before the request continues. Offloading replaces image content with a text placeholder and keeps the original attachment, but the model cannot see the offloaded image content in that request.
199
-
200
- DSH 0.1.5 offloads only for the current request. DSH 0.1.6 and later record offloaded occurrences and retry through the host's image-offload mechanism; raising or clearing the cap does not automatically restore images already offloaded from history. Existing payload, pixel, and per-image byte budgets still apply independently and may require more images to be offloaded. This optional compatibility setting does not change upstream service limits.
201
-
202
- ## FAQ
114
+ Restart `dsh web` and reload the page afterward. For desktop DSH, quit and reopen the application. Headless users should replace `web` with `headless`. The repository's default branch may contain changes not yet released to npm.
203
115
 
204
- ### Coexistence with the host's OpenCode Go and upgrade migration
116
+ **Why is usage hidden?** Auto mode shows it only for **DSH OpenCode Go** models. Check that the plugin is enabled, a key is configured, and the display mode is appropriate. Choose Always to show usage with other providers.
205
117
 
206
- Version 0.1.17 and later use the independent `dsh-opencode-go` provider, shown as **DSH OpenCode Go** in the model picker. The host pi-ai's `opencode-go` provider can run alongside it. Configure the API key in this plugin's settings, then choose a model under **DSH OpenCode Go**. Versions 0.1.16 and earlier use `opencode-go`; their headless configuration should also use that older identity.
118
+ **What if usage queries or account additions fail?** Retry in the usage panel or refresh usage in the account card. An added account whose key was not saved can be repaired with a key or removed. See [account operations and saving](docs/advanced.en.md#account-operations-and-saving) for recovery behavior.
207
119
 
208
- Sessions, Agent presets and headless defaults previously saved with `provider: opencode-go` need to select **DSH OpenCode Go** again, or change the provider to `dsh-opencode-go`. API keys, model settings and metadata caches are retained. Existing session content remains available; when switching providers, DSH removes the previous adapter's private replay metadata according to its ownership rules.
120
+ **Why does an old conversation need its model selected again?** When upgrading from `0.1.16` or earlier, select **DSH OpenCode Go** again in existing conversations or Agent presets. Manual configurations use `provider: dsh-opencode-go`.
209
121
 
210
- ### An expected model is missing
122
+ **Which hosts are verified?** Installed compatibility covers ten host versions from `0.1.5-rc.1` through `0.2.1-alpha.1`. Later versions need verification. Developer messages, dynamic tool additions/removals, and deferred tool loading are explicitly rejected; see [development and compatibility](docs/development.md).
211
123
 
212
- Check that the model's switch is on in **Settings → OpenCode Go**. Deprecated models default to off; turning on an individual model makes it available in conversation pickers without another global option.
213
-
214
- Confirm that the plugin is enabled and an API key is configured, then refresh the model list in Settings. Settings reads and refreshes request the gateway's `/models` endpoint and synchronize the OpenCode Go configuration from [models.dev](https://models.dev/api.json). Conversation pickers respect the catalog cache lifetime, so model switch changes do not force another gateway request. Protocol support, context length, output limit, and image capability come from the online configuration, so new models do not require a release of this plugin or pi-ai.
215
-
216
- Models that are present in the gateway and have an entry using Anthropic Messages, OpenAI Chat Completions, or OpenAI Responses are discovered on the next Settings refresh or after the catalog cache expires. A Settings refresh bypasses the cache and notifies open conversation pickers to use the same updated catalog; a direct request for a previously unseen model also triggers an immediate resynchronization. The Settings page shows the complete discovery result.
217
-
218
- A gateway model ID with no usable protocol or capability configuration is marked “Configuration missing” in Settings, with its switch off and disabled, and is kept out of the conversation picker, so one unconfigured model cannot block the rest of the list. Direct requests report the reason. Refresh after the upstream configuration is corrected. A model ID alone is not enough to reliably infer its transport; new protocols or protocol-specific exceptions may still require adapter changes.
219
-
220
- If online configuration cannot be loaded, models without usable cached or built-in configuration are marked “Configuration unavailable”, with the configuration source error shown on the page. Check access to `https://models.dev/api.json` from the machine running DSH and review the error details, then refresh. When retrying a retained model list, its previous failure stays visible until a successful refresh clears it; configured models remain usable.
221
-
222
- A reasoning-capable model without adjustable reasoning levels (for example, `union-alpha`) remains selectable and usable; it simply has no reasoning-strength control.
223
-
224
- MiMo V2.6 Flash's gateway catalog does not yet list its controls. Based on direct OpenCode Go probes, the plugin offers **Off / Low / Medium / High**: Default omits `reasoning_effort` and preserves gateway-default reasoning; Off sends `none`, and the other levels send their matching values. This rule applies only to the verified model and protocol, not other MiMo models. Low / Medium / High were accepted and returned reasoning content, but are not guaranteed to produce increasing amounts of reasoning.
225
-
226
- Online effort declarations determine selectable strengths. Toggle or budget declarations produce controls only for established native switch or budget protocols; they do not imply `off` or `high` effort parameters on a generic OpenAI-compatible route. An explicit empty control list does not gain an Off choice just because the model can reason.
227
-
228
- A model that does offer adjustable levels also declares a default effort (`high` when the model offers it, otherwise the highest level it offers) whenever its transport would answer an unset effort with an explicit disable (`deepseek`, `zai`, `qwen`, `qwen-chat-template`). DSH uses that default when no level has been chosen, so leaving the control unset still sends a reasoning level instead of turning thinking off. Transports that leave the choice to the provider declare no default and are unchanged, and an explicitly chosen level always wins.
229
-
230
- If the online configuration is temporarily unavailable, the plugin prefers previously fetched configuration, including disk data from before a restart, and falls back to pi-ai's built-in metadata. If a gateway catalog refresh fails, ongoing requests and Settings retain the last successful list from the current process. A failure from either source shows a warning, its cause, and the last successful checks of the model listing and model configuration separately. An initial gateway failure never invents a model list from cached metadata.
231
-
232
- Model configuration is saved to `$DSH_HOME/cache/dsh-opencode-go/models.dev.api.json`, or `~/.dsh/cache/dsh-opencode-go/models.dev.api.json` when `DSH_HOME` is unset. This contains only public metadata, its ETag, and the last successful check time; it excludes API keys and gateway listings. After a restart, ordinary reads verify the gateway listing and use disk configuration while revalidating metadata in the background. The completed refresh updates conversation pickers. Corrupt caches fall back to the network, and write failures do not discard online results. Settings refreshes always wait for online verification, retaining old configuration with a diagnostic on failure; a disk hit is not reported as an online success. To clear the disk cache, exit DSH and delete this file.
233
-
234
- `refreshMinutes` controls the cache lifetime after a successful refresh. Failed refreshes become eligible for retry on the next read after 5, 10, 20, 40, then at most 60 seconds; there is no background polling when nothing reads the catalog. Explicit Settings refreshes and previously unknown model requests bypass this delay. Cancelling model resolution or generation immediately ends that caller's catalog wait while other callers can continue sharing the same refresh.
235
-
236
- Verified model configurations can serve generation immediately for five minutes after their cache lifetime expires, while triggering one shared background refresh. This window is measured from each source's last successful check; failed retries do not extend it. Beyond that window, requests wait for the next due refresh, retaining the existing fallback behavior if it fails. Initial loads without a disk cache, unknown models, and manual refreshes wait for online results. Listing requests have a 10-second deadline; the larger model metadata download has its own 30-second deadline and negotiates gzip to reduce transfer size on slow connections. If an HTTP/2 host compatibility issue delivers raw gzip bytes, the plugin asynchronously decompresses them within the same deadline, limiting both the delivered bytes and decoded result to 16 MiB. Model listing and usage requests continue to use uncompressed transfer.
237
-
238
- Continuation, retries, and restored sessions reuse the Host's durable session ID. Forks and subagent sessions use their own IDs, separate from the parent. Standalone requests without a session ID receive a fresh random identifier each time.
239
-
240
- ## Uninstall
241
-
242
- Remove the plugin from the relevant profile and restart the application:
124
+ Uninstall:
243
125
 
244
126
  ```sh
245
127
  dsh plugin --profile web remove dsh-opencode-go
246
- # or
247
- dsh plugin --profile headless remove dsh-opencode-go
248
128
  ```
249
129
 
250
- ## Feedback
251
-
252
- Please open an issue for bugs or feature requests.
253
-
254
- ## License
130
+ ## More documentation
255
131
 
256
- [MIT](LICENSE)
132
+ - [Advanced guide: Headless, proxies, manual configuration, and error diagnostics](docs/advanced.en.md)
133
+ - [Development and testing](docs/development.md)
134
+ - [Verification notes](docs/verification.md)
135
+ - [Issues and suggestions](https://github.com/Duskriver/dsh-opencode-go/issues)
136
+ - [MIT license](LICENSE)