opencode-resolve 0.1.3 → 0.1.5
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.
- package/README.ko.md +921 -0
- package/README.md +498 -119
- package/dist/index.js +223 -26
- package/opencode-resolve.example.json +19 -5
- package/opencode-resolve.reference.jsonc +96 -31
- package/package.json +1 -1
- package/scripts/install-local.mjs +97 -5
- package/scripts/postinstall.mjs +110 -4
package/README.md
CHANGED
|
@@ -1,17 +1,44 @@
|
|
|
1
|
-
# opencode-resolve
|
|
1
|
+
# opencode-resolve — Lightweight Resolver Plugin for OpenCode
|
|
2
|
+
|
|
3
|
+
**[English](./README.md) | [한국어](./README.ko.md)**
|
|
2
4
|
|
|
3
5
|
[](https://www.npmjs.com/package/opencode-resolve)
|
|
6
|
+
[](https://github.com/jshsakura/opencode-resolve/actions/workflows/publish.yml)
|
|
4
7
|
[](./LICENSE)
|
|
5
8
|
|
|
6
|
-
|
|
9
|
+
> **opencode-resolve** is a **lightweight resolver plugin for [OpenCode](https://opencode.ai)**. It lives _inside_ your OpenCode session and turns a single instruction into a finished, verified change — that is what _resolving_ means here.
|
|
10
|
+
>
|
|
11
|
+
> It is **not** a standalone application, not a model provider, not a separate CLI you run daily, and not a replacement for your `opencode.json` configuration. It is an OpenCode plugin and nothing more.
|
|
12
|
+
|
|
13
|
+
It exposes a **fixed-role verified resolve loop** — **resolver** (context-efficient planner/judge) and **coder** (focused implementer) — running with auto-approved permissions so a task drives to completion without prompting at every step. The resolver inspects only relevant files, plans the smallest patch, dispatches coder with exact instructions, verifies, and iterates through verified checkpoints. Each checkpoint is retried up to 3 times on failure, then the resolver moves forward. Internal specialist subagents (**explorer**, **reviewer**, **deep-reviewer**) are injected by default as OpenCode-native subagents — available when the resolver judges them justified — but they are not part of the core path and are never user-facing primary roles. It defines roles, not model providers: agents inherit your OpenCode default model unless you pin them.
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
# Paste this into any AI coding assistant for fully guided setup
|
|
17
|
+
Install and configure opencode-resolve by following the instructions here:
|
|
18
|
+
https://github.com/jshsakura/opencode-resolve#drop-in-setup-give-to-an-llm
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## What this is — and isn't
|
|
24
|
+
|
|
25
|
+
| ✅ What it is | ❌ What it isn't |
|
|
26
|
+
|---|---|
|
|
27
|
+
| A **lightweight resolver plugin for OpenCode** installed via `opencode plugin opencode-resolve` | A standalone app or separate CLI |
|
|
28
|
+
| A fixed-role verified loop (resolver + coder) injected into OpenCode | A model provider or API key manager |
|
|
29
|
+
| A Context7 MCP auto-registration hook | A replacement for your `opencode.json` config |
|
|
30
|
+
| A config file (`resolve.json`) that lives alongside OpenCode config | Something you invoke manually every time you code |
|
|
31
|
+
| Installed once, then runs automatically inside OpenCode | An alternative to OpenCode itself |
|
|
7
32
|
|
|
8
|
-
|
|
33
|
+
If OpenCode is not installed or not running, opencode-resolve does nothing.
|
|
9
34
|
|
|
10
35
|
---
|
|
11
36
|
|
|
12
37
|
## Table of Contents
|
|
13
38
|
|
|
14
|
-
- [
|
|
39
|
+
- [Features](#features)
|
|
40
|
+
- [AI-Powered Setup](#ai-powered-setup)
|
|
41
|
+
- [Prerequisites](#prerequisites)
|
|
15
42
|
- [Quick Start](#quick-start)
|
|
16
43
|
- [Drop-in setup (give to an LLM)](#drop-in-setup-give-to-an-llm)
|
|
17
44
|
- [Default Behavior](#default-behavior)
|
|
@@ -23,39 +50,115 @@ Small OpenCode plugin that turns a single instruction into a finished, verified
|
|
|
23
50
|
- [Model Setup](#model-setup)
|
|
24
51
|
- [Agent Reference](#agent-reference)
|
|
25
52
|
- [Optional Commands](#optional-commands)
|
|
53
|
+
- [Context7 Integration](#context7-integration)
|
|
54
|
+
- [Keeping Up to Date](#keeping-up-to-date)
|
|
26
55
|
- [Local Development](#local-development)
|
|
27
56
|
- [Verification](#verification)
|
|
28
57
|
- [Release](#release)
|
|
29
58
|
- [Design Rules](#design-rules)
|
|
59
|
+
- [License](#license)
|
|
30
60
|
|
|
31
61
|
---
|
|
32
62
|
|
|
33
|
-
##
|
|
63
|
+
## Features
|
|
64
|
+
|
|
65
|
+
- **Fixed-role verified resolve loop** — `resolver` (context-efficient planner/judge) + `coder` (focused implementer)
|
|
66
|
+
- **Context-efficient by default** — minimal file reads, smallest patch, targeted verification, checkpointed execution with max 3 retries per failing checkpoint
|
|
67
|
+
- **OpenCode-native internal specialist subagents** — `reviewer` (verification-gap audit), `explorer` (codebase scout), `deep-reviewer` (risky/security review) — injected as subagents by default but not part of the core path; resolver dispatches them only when justified
|
|
68
|
+
- **Auto-approved permissions** — coder and resolver work without per-action prompts
|
|
69
|
+
- **Context7 MCP** — auto-registers [Context7](https://context7.com) documentation lookup when `context7: true`
|
|
70
|
+
- **Model pinning** — pin different models per role when you have measured a benefit; by default all roles inherit your OpenCode default model
|
|
71
|
+
- **Soft parallel cap** — `maxParallelSubagents` controls how many coders the resolver fans out
|
|
72
|
+
- **Strict validation** — unknown keys, typos, invalid modes, and wrong types all fail fast at load time
|
|
73
|
+
- **Additive migration** — upgrades never overwrite your existing config
|
|
74
|
+
- **Zero dependencies beyond `@opencode-ai/plugin`** — nothing extra to install
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## AI-Powered Setup
|
|
79
|
+
|
|
80
|
+
> **One line. Any AI coding assistant. Everything configured automatically.**
|
|
81
|
+
|
|
82
|
+
Paste this into Claude Code, Cursor, Codex, OpenCode, Windsurf, VS Code Copilot, or Gemini CLI:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
Install and configure opencode-resolve by following the instructions here:
|
|
86
|
+
https://github.com/jshsakura/opencode-resolve#drop-in-setup-give-to-an-llm
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Your AI will:
|
|
90
|
+
|
|
91
|
+
1. Install the plugin via `opencode plugin opencode-resolve --global --force`
|
|
92
|
+
2. Merge `opencode-resolve` into your `opencode.json` plugin array
|
|
93
|
+
3. Create `resolve.json` with a working configuration
|
|
94
|
+
4. Tell you to restart OpenCode
|
|
95
|
+
|
|
96
|
+
No manual config editing required. Works on macOS, Linux, and Windows.
|
|
97
|
+
|
|
98
|
+
> For manual setup, see [Prerequisites](#prerequisites) and [Quick Start](#quick-start) below.
|
|
34
99
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Prerequisites
|
|
103
|
+
|
|
104
|
+
### 1. OpenCode
|
|
105
|
+
|
|
106
|
+
opencode-resolve is an OpenCode plugin. You need [OpenCode](https://opencode.ai) installed and running.
|
|
107
|
+
|
|
108
|
+
Verify:
|
|
109
|
+
|
|
110
|
+
```sh
|
|
111
|
+
opencode --version
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### 2. Node.js ≥ 20
|
|
115
|
+
|
|
116
|
+
The plugin and OpenCode itself require Node.js 20 or later.
|
|
117
|
+
|
|
118
|
+
Verify:
|
|
119
|
+
|
|
120
|
+
```sh
|
|
121
|
+
node --version # should be v20.x or later
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### 3. A configured model provider
|
|
125
|
+
|
|
126
|
+
OpenCode needs at least one model provider configured in `~/.config/opencode/opencode.json` with a valid API key. opencode-resolve agents inherit your default model unless you pin them.
|
|
127
|
+
|
|
128
|
+
Example minimal provider setup:
|
|
129
|
+
|
|
130
|
+
```json
|
|
131
|
+
{
|
|
132
|
+
"model": "openai/gpt-4o",
|
|
133
|
+
"provider": {
|
|
134
|
+
"openai": {
|
|
135
|
+
"name": "OpenAI"
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
```
|
|
40
140
|
|
|
41
|
-
|
|
141
|
+
> No additional API keys or MCP servers are required. Context7 is auto-registered by the plugin.
|
|
42
142
|
|
|
43
143
|
---
|
|
44
144
|
|
|
45
145
|
## Quick Start
|
|
46
146
|
|
|
47
|
-
Install from npm
|
|
147
|
+
### Install from npm
|
|
48
148
|
|
|
49
149
|
```sh
|
|
50
150
|
npm install -g opencode-resolve
|
|
51
151
|
```
|
|
52
152
|
|
|
53
|
-
The
|
|
153
|
+
The `postinstall` script automatically:
|
|
54
154
|
|
|
55
|
-
1. Adds `opencode-resolve` to `~/.config/opencode/opencode.json` `plugin` array.
|
|
56
|
-
2. Creates `~/.config/opencode/resolve.json`
|
|
155
|
+
1. Adds `opencode-resolve` to `~/.config/opencode/opencode.json` `plugin` array (if not already present).
|
|
156
|
+
2. Creates `~/.config/opencode/resolve.json` adapted to your current model provider when the file does not exist:
|
|
157
|
+
- **GLM/ZAI model detected** → mixed GLM + GPT alias preset (`coder` → GLM, `resolver` → GPT).
|
|
158
|
+
- **OpenAI/GPT model detected** → single-provider GPT preset using your current model for all roles.
|
|
159
|
+
- **Other or no model** → model-neutral `models: {}` (all roles inherit OpenCode default).
|
|
57
160
|
|
|
58
|
-
|
|
161
|
+
Existing `resolve.json` files are **never overwritten** — the adaptive preset only applies to first-time creation. To regenerate, delete `resolve.json` and reinstall.
|
|
59
162
|
|
|
60
163
|
To skip automatic registration:
|
|
61
164
|
|
|
@@ -63,7 +166,17 @@ To skip automatic registration:
|
|
|
63
166
|
OPENCODE_RESOLVE_SKIP_POSTINSTALL=1 npm install -g opencode-resolve
|
|
64
167
|
```
|
|
65
168
|
|
|
66
|
-
|
|
169
|
+
### Refresh the plugin cache
|
|
170
|
+
|
|
171
|
+
> **Important — OpenCode caches plugins itself.** OpenCode does NOT use globally-installed npm packages directly. It maintains its own cache at `~/.cache/opencode/packages/`. After the very first install (or any future upgrade), refresh the cache:
|
|
172
|
+
|
|
173
|
+
```sh
|
|
174
|
+
opencode plugin opencode-resolve --global --force
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Manual fallback
|
|
178
|
+
|
|
179
|
+
If `postinstall` didn't register the plugin, add it to `~/.config/opencode/opencode.json` yourself:
|
|
67
180
|
|
|
68
181
|
```json
|
|
69
182
|
{
|
|
@@ -71,81 +184,253 @@ Manual fallback: add the plugin to `~/.config/opencode/opencode.json` yourself:
|
|
|
71
184
|
}
|
|
72
185
|
```
|
|
73
186
|
|
|
187
|
+
### Restart OpenCode
|
|
188
|
+
|
|
189
|
+
```sh
|
|
190
|
+
opencode
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
You should now see `resolver` and `coder` agents available.
|
|
194
|
+
|
|
74
195
|
---
|
|
75
196
|
|
|
76
197
|
## Drop-in setup (give to an LLM)
|
|
77
198
|
|
|
78
|
-
Hand the block below to any reasonably capable LLM along with the instruction _"set up opencode-resolve on this machine"_ and it
|
|
199
|
+
Hand the block below to any reasonably capable LLM along with the instruction _"set up opencode-resolve on this machine"_ and it will finish the install end-to-end. The LLM **must run this interactively** — it discovers what providers and models are already configured, then asks the user which to pin per role. No guessing, no invented model IDs.
|
|
79
200
|
|
|
80
|
-
> **
|
|
201
|
+
> **For LLMs reading this:** treat every "Ask the user" prompt below as a real question — wait for the user's answer before continuing. Never proceed with a default if the user hasn't responded. Never invent model IDs that aren't in the user's `opencode.json` (or in their declared `provider.*` registry).
|
|
81
202
|
|
|
82
|
-
|
|
203
|
+
### Step 1 — Install and prime the cache
|
|
83
204
|
|
|
84
205
|
```sh
|
|
85
206
|
opencode plugin opencode-resolve --global --force
|
|
86
207
|
```
|
|
87
208
|
|
|
88
|
-
|
|
209
|
+
This downloads the plugin, installs it into OpenCode's package cache (`~/.cache/opencode/packages/`), and makes it available.
|
|
210
|
+
|
|
211
|
+
### Step 2 — Register the plugin in `~/.config/opencode/opencode.json`
|
|
212
|
+
|
|
213
|
+
Add the string `"opencode-resolve"` to the `plugin` array. **Do not use the inline tuple form here** — keep the entry as a bare string so all role/model config lives in `resolve.json` (Step 3). This avoids split-brain configuration.
|
|
89
214
|
|
|
90
215
|
```json
|
|
91
216
|
{
|
|
92
217
|
"$schema": "https://opencode.ai/config.json",
|
|
93
|
-
"model": "<
|
|
218
|
+
"model": "<user-default-model-id>",
|
|
94
219
|
"plugin": ["opencode-resolve"]
|
|
95
220
|
}
|
|
96
221
|
```
|
|
97
222
|
|
|
98
|
-
|
|
223
|
+
> If the user already has other plugins, append `"opencode-resolve"` to the existing array. **Never overwrite** their existing config.
|
|
224
|
+
|
|
225
|
+
#### 2b. Offer the recommended companion plugins
|
|
226
|
+
|
|
227
|
+
Before moving to model selection, ask the user about two **independent** companion plugins — one question each, recommended-by-default. Both are separate OpenCode plugins; opencode-resolve does not require them but pairs well with both.
|
|
228
|
+
|
|
229
|
+
**Companion 1 — `@tarquinen/opencode-dcp` (Dynamic Context Pruning)**
|
|
230
|
+
|
|
231
|
+
> _opencode-resolve pairs well with **`@tarquinen/opencode-dcp`** — it prunes obsolete tool outputs so long resolver loops cost fewer tokens. Want to install it? (recommended)_
|
|
232
|
+
|
|
233
|
+
**Companion 2 — `@slkiser/opencode-quota` (quota & usage tracking)**
|
|
234
|
+
|
|
235
|
+
> _And **`@slkiser/opencode-quota`** — shows your live token/quota usage without polluting the context window. Supports GLM coding-plan, OpenAI Plus/Pro, Qwen, and more. Useful for actually seeing the token savings opencode-resolve gives you. Install it? (recommended)_
|
|
236
|
+
|
|
237
|
+
For each **yes** answer:
|
|
238
|
+
|
|
239
|
+
1. Run `opencode plugin <package>@latest --global --force` (primes the cache).
|
|
240
|
+
2. Append `"<package>@latest"` to the `plugin` array in `~/.config/opencode/opencode.json`, only if it is not already present.
|
|
241
|
+
|
|
242
|
+
Where `<package>` is `@tarquinen/opencode-dcp` or `@slkiser/opencode-quota`.
|
|
243
|
+
|
|
244
|
+
For each **no**, skip — do not modify `opencode.json` for that entry. Proceed to Step 3 either way.
|
|
245
|
+
|
|
246
|
+
> `context7` MCP is registered automatically by opencode-resolve at runtime when `context7: true` (the default in `resolve.json`). No separate question is needed for that.
|
|
247
|
+
|
|
248
|
+
### Step 3 — Pick models interactively, then write `~/.config/opencode/resolve.json`
|
|
249
|
+
|
|
250
|
+
The LLM **drives a short Q&A** here. Goal: end with `resolve.json` containing model IDs the user explicitly chose from their own configuration.
|
|
251
|
+
|
|
252
|
+
#### 3a. Discover the user's installed providers and models
|
|
253
|
+
|
|
254
|
+
Read `~/.config/opencode/opencode.json` and build a candidate map:
|
|
255
|
+
|
|
256
|
+
| Source | What to collect |
|
|
257
|
+
|---|---|
|
|
258
|
+
| `provider.*` keys | Each configured provider (e.g. `zai`, `openai`, `anthropic`). |
|
|
259
|
+
| `provider.<key>.models.*` keys | The model keys the user has declared under that provider. |
|
|
260
|
+
| Top-level `model` | If the prefix before `/` is not already in `provider.*`, add it as an implicit candidate (e.g. `zai-coding-plan` from `zai-coding-plan/glm-5.1`). |
|
|
261
|
+
| `agent.*.model` | Any per-agent overrides — add their provider/model pairs as candidates. |
|
|
262
|
+
|
|
263
|
+
If the user has **no providers configured at all**, stop and tell them to add at least one provider with a valid API key to `opencode.json` first — opencode-resolve cannot pick a model that does not exist.
|
|
264
|
+
|
|
265
|
+
#### 3b. Ask the user: which provider?
|
|
266
|
+
|
|
267
|
+
Print the candidate list and ask. Example wording the LLM should use:
|
|
268
|
+
|
|
269
|
+
> _I found these providers in your OpenCode config. Which one should opencode-resolve roles use?_
|
|
270
|
+
>
|
|
271
|
+
> 1. `zai-coding-plan` — models: `glm-5.1`, `glm-4.7-flash`
|
|
272
|
+
> 2. `openai` — models: `gpt-4o`, `gpt-4o-mini`, `o1`, `o1-mini`, `o3-mini`, `gpt-5.5`
|
|
273
|
+
> 3. _Other (provide an explicit `provider/model` ID)_
|
|
274
|
+
|
|
275
|
+
If exactly one provider candidate exists, skip the question and use it.
|
|
276
|
+
|
|
277
|
+
#### 3c. Ask the user: single, two-tier, or three-tier split?
|
|
278
|
+
|
|
279
|
+
The default recommendation is **C (three-tier bronze/silver/gold)** — opencode-resolve has three qualitatively distinct workloads (read-only scout → write/patch → reason/judge) and three matching tiers cost about the same as two-tier but read role costs more accurately. Fall back to B if the user only has two models, A only when they have one.
|
|
280
|
+
|
|
281
|
+
> _Recommended: **three-tier** — a cheap scout model for `explorer`, a mid coder for `coder`, and a strong reasoner for `resolver`/`reviewer`/`deep-reviewer`/`planner`. Choose:_
|
|
282
|
+
>
|
|
283
|
+
> **C. Three-tier — bronze (scout) + silver (coder) + gold (reasoner) — recommended**
|
|
284
|
+
> B. Two-tier — fast + strong (when you only have two models)
|
|
285
|
+
> A. Single model for all roles (only if you have one model or want maximum simplicity)
|
|
286
|
+
|
|
287
|
+
Default to C if the user just hits enter or says "recommended". Only fall back if they don't have enough distinct models. Same-provider split is fully valid (e.g. `openai/gpt-4o-mini` / `openai/gpt-5.3-codex` / `openai/o4-mini`, or `zai/glm-4.7-flash` / `zai-coding-plan/glm-5.1` / `zai/glm-5`).
|
|
288
|
+
|
|
289
|
+
#### 3d. Ask the user: which model(s)?
|
|
290
|
+
|
|
291
|
+
Show only the models under the provider picked in 3b.
|
|
292
|
+
|
|
293
|
+
- For **single-tier (A)** — ask one question:
|
|
294
|
+
> _Which model should every role use?_ → list models from the chosen provider.
|
|
295
|
+
- For **split (B)** — ask two questions, in order:
|
|
296
|
+
> _Pick the **fast** model for `coder` and `explorer`:_ → list models.
|
|
297
|
+
>
|
|
298
|
+
> _Pick the **strong** model for `resolver`, `reviewer`, `deep-reviewer`:_ → list models.
|
|
299
|
+
|
|
300
|
+
Confirm each pick back to the user before writing the file. Example:
|
|
301
|
+
|
|
302
|
+
> _I'll pin `coder` and `explorer` to `zai-coding-plan/glm-5.1`, and `resolver`/`reviewer`/`deep-reviewer` to `openai/gpt-5.5`. Proceed?_
|
|
303
|
+
|
|
304
|
+
#### 3d-bis. Pick `maxParallelSubagents` from the `coder` model
|
|
305
|
+
|
|
306
|
+
opencode-resolve's identity is **token efficiency** — the resolver plans fast and dispatches subagents by type, and the parallel cap is per-role. The cap is determined by the `coder` model only — coder is the fan-out subject, so its rate budget is what matters:
|
|
307
|
+
|
|
308
|
+
| `coder` model ID contains | `maxParallelSubagents` |
|
|
309
|
+
|---|---|
|
|
310
|
+
| `glm` (any GLM model — most often the GLM coding-plan) | **2** |
|
|
311
|
+
| anything else (GPT, Claude, Gemini, local, …) | **4** |
|
|
312
|
+
|
|
313
|
+
The GLM constraint comes from the GLM coding-plan's per-account rate limits — even a powerful GLM gets throttled under burst dispatch. Every other family tested tolerates 4 well and the resolver gets meaningful speedup. Don't look at the strong/reasoner model — the cap follows the doer, not the judge.
|
|
314
|
+
|
|
315
|
+
For single-tier (A) and two-tier (B), apply the same rule to whichever model the `coder` agent ends up using.
|
|
316
|
+
|
|
317
|
+
#### 3e. Write `~/.config/opencode/resolve.json`
|
|
318
|
+
|
|
319
|
+
**Three-tier (C, recommended)** — use the `bronze`/`silver`/`gold` aliases:
|
|
99
320
|
|
|
100
321
|
```json
|
|
101
322
|
{
|
|
102
|
-
"enabled": ["coder", "reviewer", "
|
|
323
|
+
"enabled": ["coder", "resolver", "explorer", "reviewer", "deep-reviewer", "planner"],
|
|
103
324
|
"preserveNative": true,
|
|
104
325
|
"context7": true,
|
|
105
326
|
"commands": false,
|
|
106
|
-
"autoApprove": true,
|
|
107
|
-
"maxParallelSubagents": 2,
|
|
108
327
|
"models": {
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
"
|
|
328
|
+
"bronze": "<provider>/<scout-model>",
|
|
329
|
+
"silver": "<provider>/<coder-model>",
|
|
330
|
+
"gold": "<provider>/<reasoner-model>",
|
|
331
|
+
"explorer": "bronze",
|
|
332
|
+
"coder": "silver",
|
|
333
|
+
"resolver": "gold",
|
|
334
|
+
"reviewer": "gold",
|
|
335
|
+
"deep-reviewer": "gold",
|
|
336
|
+
"planner": "gold"
|
|
114
337
|
},
|
|
115
338
|
"agents": {
|
|
116
|
-
"coder":
|
|
117
|
-
"
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
"
|
|
123
|
-
|
|
339
|
+
"coder": { "enabled": true, "mode": "all" },
|
|
340
|
+
"resolver": { "enabled": true },
|
|
341
|
+
"explorer": { "enabled": true, "mode": "subagent" },
|
|
342
|
+
"reviewer": { "enabled": true, "mode": "subagent" },
|
|
343
|
+
"deep-reviewer": { "enabled": true, "mode": "subagent" },
|
|
344
|
+
"planner": { "enabled": true, "mode": "subagent" },
|
|
345
|
+
"architect": { "enabled": false },
|
|
346
|
+
"gpt-coder": { "enabled": false },
|
|
347
|
+
"debugger": { "enabled": false },
|
|
348
|
+
"researcher": { "enabled": false }
|
|
349
|
+
},
|
|
350
|
+
"autoApprove": true,
|
|
351
|
+
"autoUpdate": true,
|
|
352
|
+
"maxParallelSubagents": 2
|
|
124
353
|
}
|
|
125
354
|
```
|
|
126
355
|
|
|
127
|
-
**
|
|
356
|
+
**Two-tier (B)** — collapse bronze and silver if the user has only two models:
|
|
357
|
+
|
|
358
|
+
```json
|
|
359
|
+
"models": {
|
|
360
|
+
"silver": "<provider>/<coder-model>",
|
|
361
|
+
"gold": "<provider>/<reasoner-model>",
|
|
362
|
+
"explorer": "silver",
|
|
363
|
+
"coder": "silver",
|
|
364
|
+
"resolver": "gold",
|
|
365
|
+
"reviewer": "gold",
|
|
366
|
+
"deep-reviewer": "gold",
|
|
367
|
+
"planner": "gold"
|
|
368
|
+
}
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
**Single-tier (A)** — every role on one model:
|
|
372
|
+
|
|
373
|
+
```json
|
|
374
|
+
"models": {
|
|
375
|
+
"gold": "<provider>/<single-model>",
|
|
376
|
+
"explorer": "gold",
|
|
377
|
+
"coder": "gold",
|
|
378
|
+
"resolver": "gold",
|
|
379
|
+
"reviewer": "gold",
|
|
380
|
+
"deep-reviewer": "gold",
|
|
381
|
+
"planner": "gold"
|
|
382
|
+
}
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
Replace every `<provider>/<model>` placeholder with the **exact** ID strings the user picked. Set `maxParallelSubagents` to **2** if the `coder` model ID contains `glm`, otherwise **4**.
|
|
386
|
+
|
|
387
|
+
Replace every `<provider>/<model>` placeholder with the **exact** ID strings the user picked in 3b/3d — no inventing, no autocompletion, no version drift. If you cannot map the picked model to a `provider/model` string, ask the user to clarify rather than guessing.
|
|
388
|
+
|
|
389
|
+
> Each enabled agent carries an explicit `enabled: true` so the file is self-documenting. The `enabled` array remains authoritative; the per-agent flag just removes ambiguity for humans reading the file.
|
|
390
|
+
|
|
391
|
+
> If `resolve.json` already exists, **do not overwrite it silently**. Show the user the existing content first, summarize what would change, and ask whether to overwrite, merge, or abort.
|
|
392
|
+
|
|
393
|
+
### Step 4 — Restart OpenCode and verify
|
|
394
|
+
|
|
395
|
+
Close and reopen OpenCode, then confirm the install worked:
|
|
396
|
+
|
|
397
|
+
```sh
|
|
398
|
+
opencode run "list available agents"
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
The output **must** include `resolver` and `coder` (and `reviewer` if enabled). Two failure modes to check explicitly:
|
|
402
|
+
|
|
403
|
+
| Symptom | Cause | Fix |
|
|
404
|
+
|---|---|---|
|
|
405
|
+
| Only OpenCode's built-in `explore` / `general` appear | Plugin didn't load | Re-run `opencode plugin opencode-resolve --global --force`; verify `"opencode-resolve"` is in `opencode.json` `plugin` array as a string. |
|
|
406
|
+
| Agents appear but fail when invoked with "model not found" | A pinned model ID in `models` doesn't exist | Re-open `resolve.json`, replace the offending ID with one the user actually has, restart. |
|
|
407
|
+
| The user said split but only one tier shows up | `models` block missing `fast` or `strong` | Re-run Step 3 from 3d. |
|
|
408
|
+
|
|
409
|
+
Internal specialist subagents (`explorer`, `reviewer`, `deep-reviewer`) are subagent-only and won't appear in the primary picker — only `resolver` (and `coder` since it has `mode: "all"`) show up there.
|
|
128
410
|
|
|
129
411
|
### Why this template
|
|
130
412
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
413
|
+
| Setting | Why |
|
|
414
|
+
|---|---|
|
|
415
|
+
| `enabled: ["coder", "resolver", "explorer", "reviewer", "deep-reviewer"]` | Fixed core path (resolver→coder) plus OpenCode-native internal specialist subagents injected by default |
|
|
416
|
+
| `autoApprove: true` | Coder and resolver work without per-action prompts |
|
|
417
|
+
| `maxParallelSubagents: 2` | Up to two coders may run in parallel for independent work |
|
|
418
|
+
| `agents.coder.mode = "all"` | Coder appears in the agent picker, not just as a subagent |
|
|
419
|
+
| `agents.{explorer,reviewer,deep-reviewer}.mode = "subagent"` | Internal specialists are subagent-only — never user-facing primary roles |
|
|
420
|
+
| `context7: true` | Plugin auto-registers Context7 MCP — no manual MCP config needed |
|
|
421
|
+
| `models` aliases | Empty by default — all roles inherit the OpenCode default model. Pin role-specific models only when you have measured a benefit |
|
|
422
|
+
| Other agents disabled | `architect`, `gpt-coder`, `debugger`, `researcher` off by default. Enable when needed |
|
|
423
|
+
|
|
424
|
+
### What happens when you call the resolver
|
|
425
|
+
|
|
426
|
+
1. **Classify** — Resolver classifies the work as quick, normal, deep, or risky.
|
|
427
|
+
2. **Inspect** — Reads only relevant files using local tools. No broad exploration.
|
|
428
|
+
3. **For trivial work** — Resolver applies the small edit directly. No subagent needed.
|
|
429
|
+
4. **Implement** — Dispatches `coder` with exact file paths and focused instructions.
|
|
430
|
+
5. **Verify** — Runs the cheapest meaningful check first (targeted test, type check, or lint).
|
|
431
|
+
6. **Retry** — If issues remain, dispatches `coder` again with a focused fix. Max 3 attempts per failing checkpoint. When verified, proceed to the next checkpoint.
|
|
432
|
+
7. **Report** — Returns a concise evidence summary: what changed, verification results, and any remaining blockers.
|
|
433
|
+
8. **Internal specialists** — When justified: dispatch `explorer` (scope genuinely unknown), `reviewer` (verification gap on non-trivial changes), or `deep-reviewer` (risky/security/high-impact only). These are available by default as subagents but are not the core path.
|
|
149
434
|
|
|
150
435
|
---
|
|
151
436
|
|
|
@@ -153,14 +438,16 @@ opencode plugin opencode-resolve --global --force
|
|
|
153
438
|
|
|
154
439
|
| Item | Default |
|
|
155
440
|
|---|---|
|
|
156
|
-
| Enabled agents | `coder`, `reviewer`, `
|
|
441
|
+
| Enabled agents | `coder`, `resolver`, `explorer`, `reviewer`, `deep-reviewer` |
|
|
442
|
+
| Core path | `resolver` → `coder` (fixed-role verified loop) |
|
|
443
|
+
| Internal subagents | `explorer`, `reviewer`, `deep-reviewer` (subagent-only, dispatched when justified) |
|
|
157
444
|
| Primary agent for new tasks | `resolver` (`mode: "all"`) |
|
|
158
445
|
| Agent model | Inherits top-level OpenCode `model` |
|
|
159
446
|
| Native `plan` / `build` | Preserved untouched |
|
|
160
|
-
| Context7 MCP preset | Added
|
|
447
|
+
| Context7 MCP preset | Added automatically when `context7: true` |
|
|
161
448
|
| Optional commands | Disabled |
|
|
162
449
|
| `autoApprove` | `true` (no per-action prompts on coder/resolver) |
|
|
163
|
-
|
|
|
450
|
+
| Max retries per checkpoint | 3 (via resolver prompt) |
|
|
164
451
|
|
|
165
452
|
---
|
|
166
453
|
|
|
@@ -180,14 +467,14 @@ Inline plugin options in `opencode.json` override file config.
|
|
|
180
467
|
Config precedence:
|
|
181
468
|
|
|
182
469
|
```text
|
|
183
|
-
built-in defaults
|
|
470
|
+
built-in defaults → first config file found → inline plugin options
|
|
184
471
|
```
|
|
185
472
|
|
|
186
473
|
Minimal config (matches defaults):
|
|
187
474
|
|
|
188
475
|
```json
|
|
189
476
|
{
|
|
190
|
-
"enabled": ["coder", "reviewer", "
|
|
477
|
+
"enabled": ["coder", "resolver", "explorer", "reviewer", "deep-reviewer"],
|
|
191
478
|
"autoApprove": true,
|
|
192
479
|
"context7": true,
|
|
193
480
|
"commands": false
|
|
@@ -202,7 +489,7 @@ Inline form inside `opencode.json`:
|
|
|
202
489
|
[
|
|
203
490
|
"opencode-resolve",
|
|
204
491
|
{
|
|
205
|
-
"enabled": ["coder", "reviewer", "
|
|
492
|
+
"enabled": ["coder", "resolver", "explorer", "reviewer", "deep-reviewer"],
|
|
206
493
|
"autoApprove": true,
|
|
207
494
|
"context7": true,
|
|
208
495
|
"commands": false
|
|
@@ -222,13 +509,13 @@ Every accepted top-level option:
|
|
|
222
509
|
|
|
223
510
|
| Key | Type | Default | Purpose |
|
|
224
511
|
|---|---|---|---|
|
|
225
|
-
| `enabled` | `string[]` | `["coder", "reviewer", "
|
|
512
|
+
| `enabled` | `string[]` | `["coder", "resolver", "explorer", "reviewer", "deep-reviewer"]` | Which resolve agents to inject. Core path: resolver→coder. Internal specialists (explorer, reviewer, deep-reviewer) are subagent-only. Per-agent `agents.<name>.enabled` overrides this. |
|
|
226
513
|
| `preserveNative` | `boolean` | `true` | Native `plan`/`build` are always preserved. Accepted for readability. |
|
|
227
514
|
| `context7` | `boolean` | `true` | When true, registers the Context7 MCP server unless already configured. |
|
|
228
515
|
| `commands` | `boolean` | `false` | When true, adds `resolve`, `resolve-code`, `resolve-review` commands. |
|
|
229
516
|
| `autoApprove` | `boolean` | `true` | Flips default `"ask"` permissions to `"allow"` on enabled agents. Never touches `"deny"` or user-set keys. |
|
|
230
|
-
| `maxParallelSubagents` | `positive integer` | `
|
|
231
|
-
| `models` | `object` | `{}` | Alias map. Keys are agent names or `glm`/`gpt`. Values are model ids or other aliases. |
|
|
517
|
+
| `maxParallelSubagents` | `positive integer` | `2` | Cap on simultaneous subagents the resolver dispatches per role. |
|
|
518
|
+
| `models` | `object` | `{}` | Alias map. Keys are agent names or `fast`/`strong`/`mini`/`codex`/`quick`/`deep`/`glm`/`gpt`. Values are model ids or other aliases. Empty by default — all roles inherit the OpenCode default model. |
|
|
232
519
|
| `agents` | `object` | `{}` | Per-agent overrides (see below). |
|
|
233
520
|
| `config` | `string` | _none_ | Custom path to a config file (relative to the project or absolute). |
|
|
234
521
|
|
|
@@ -260,9 +547,7 @@ Permission keys (each takes `"ask"`, `"allow"`, or `"deny"`):
|
|
|
260
547
|
}
|
|
261
548
|
```
|
|
262
549
|
|
|
263
|
-
A fully-annotated reference config ships with the package as
|
|
264
|
-
[`opencode-resolve.reference.jsonc`](./opencode-resolve.reference.jsonc) — copy
|
|
265
|
-
the keys you need into your `resolve.json` (without the comments).
|
|
550
|
+
A fully-annotated reference config ships with the package as [`opencode-resolve.reference.jsonc`](./opencode-resolve.reference.jsonc) — copy the keys you need into your `resolve.json` (without the comments).
|
|
266
551
|
|
|
267
552
|
---
|
|
268
553
|
|
|
@@ -278,7 +563,7 @@ the keys you need into your `resolve.json` (without the comments).
|
|
|
278
563
|
| User explicit `"allow"` | stays `"allow"` | stays `"allow"` |
|
|
279
564
|
| User explicit `"deny"` | stays `"deny"` | stays `"deny"` |
|
|
280
565
|
|
|
281
|
-
|
|
566
|
+
Agents with `"deny"` defaults (e.g. reviewer's `edit` and `bash`) keep those denials even with `autoApprove: true`. Reviewer is enabled by default as an internal subagent — its deny permissions ensure it stays read-only.
|
|
282
567
|
|
|
283
568
|
Turn it off when you want the conservative ask-every-time behavior:
|
|
284
569
|
|
|
@@ -288,29 +573,29 @@ Turn it off when you want the conservative ask-every-time behavior:
|
|
|
288
573
|
}
|
|
289
574
|
```
|
|
290
575
|
|
|
291
|
-
Trust note
|
|
576
|
+
> **Trust note:** `autoApprove: true` assumes you trust the workspace and the model you have configured. Use a sandbox or VM for untrusted code, and keep `autoApprove: false` if you want to inspect every action.
|
|
292
577
|
|
|
293
578
|
---
|
|
294
579
|
|
|
295
580
|
## Parallel Subagent Limit
|
|
296
581
|
|
|
297
|
-
`maxParallelSubagents` (default `2`) caps how many subagents the **resolver** may dispatch concurrently **per role
|
|
582
|
+
`maxParallelSubagents` (default `2`) caps how many subagents the **resolver** may dispatch concurrently **per role** for context efficiency. The default of `2` lets up to two coders run in parallel for genuinely independent work.
|
|
298
583
|
|
|
299
584
|
| Value | Behavior |
|
|
300
585
|
|---|---|
|
|
301
|
-
| `1` | Strictly one
|
|
302
|
-
| `2` (default) | Up to two
|
|
303
|
-
| `N > 2` | Up to N
|
|
586
|
+
| `1` | Strictly one coder at a time. |
|
|
587
|
+
| `2` (default) | Up to two coders concurrently. Useful when fanning out genuinely independent work. |
|
|
588
|
+
| `N > 2` | Up to N coders concurrently. Use sparingly to avoid context waste. |
|
|
304
589
|
|
|
305
590
|
Override per project or per user:
|
|
306
591
|
|
|
307
592
|
```json
|
|
308
|
-
{ "maxParallelSubagents": 1 }
|
|
309
|
-
{ "maxParallelSubagents": 2 }
|
|
310
|
-
{ "maxParallelSubagents": 4 }
|
|
593
|
+
{ "maxParallelSubagents": 1 }
|
|
594
|
+
{ "maxParallelSubagents": 2 }
|
|
595
|
+
{ "maxParallelSubagents": 4 }
|
|
311
596
|
```
|
|
312
597
|
|
|
313
|
-
> **Important — soft limit, not a hard cap.** The limit is woven into the resolver's system prompt only. There is no runtime interceptor that blocks excess dispatches.
|
|
598
|
+
> **Important — soft limit, not a hard cap.** The limit is woven into the resolver's system prompt only. There is no runtime interceptor that blocks excess dispatches. Capable instruction-following coding models generally respect the directive, but if a model misbehaves, dispatches above the limit will go through. Pair this with `maxSteps` to bound total iterations if you want a stricter ceiling.
|
|
314
599
|
|
|
315
600
|
The limit is templated into the prompt at config-load time, so restart OpenCode to pick up the new value. If you provide a custom `agents.resolver.prompt`, the templated rule is skipped and your prompt wins entirely.
|
|
316
601
|
|
|
@@ -325,6 +610,18 @@ When you upgrade to a newer version of `opencode-resolve`, the `postinstall` scr
|
|
|
325
610
|
- **Never** rewrites your `enabled` list, `models` map, or `agents` overrides.
|
|
326
611
|
- If `enabled` is set and does not include `"resolver"`, prints a one-line tip suggesting you add it. Your file is left untouched.
|
|
327
612
|
|
|
613
|
+
### Adaptive first-install preset
|
|
614
|
+
|
|
615
|
+
When `resolve.json` does **not** exist, postinstall inspects your OpenCode model configuration and writes a provider-adapted `models` block:
|
|
616
|
+
|
|
617
|
+
| Detected provider | Preset |
|
|
618
|
+
|---|---|
|
|
619
|
+
| GLM / ZAI | Mixed GLM + GPT: coder/explorer → GLM, resolver/reviewer/deep-reviewer → GPT |
|
|
620
|
+
| OpenAI / GPT | Single-provider: all roles use your current OpenAI model |
|
|
621
|
+
| Other or none | Model-neutral: `models: {}` (all roles inherit OpenCode default) |
|
|
622
|
+
|
|
623
|
+
To change presets at any time, edit `models` in `resolve.json` directly or delete the file and reinstall.
|
|
624
|
+
|
|
328
625
|
Skip the migration entirely with:
|
|
329
626
|
|
|
330
627
|
```sh
|
|
@@ -335,7 +632,7 @@ OPENCODE_RESOLVE_SKIP_POSTINSTALL=1 npm install -g opencode-resolve
|
|
|
335
632
|
|
|
336
633
|
## Model Setup
|
|
337
634
|
|
|
338
|
-
`opencode-resolve` does not
|
|
635
|
+
`opencode-resolve` does not pin any provider-specific model by default. All resolve agents inherit your top-level OpenCode `model` — use a single efficient model if it gives the best token-per-result efficiency. Only pin role-specific models when you have measured a benefit.
|
|
339
636
|
|
|
340
637
|
Model resolution order for each resolve agent:
|
|
341
638
|
|
|
@@ -344,68 +641,80 @@ Model resolution order for each resolve agent:
|
|
|
344
641
|
3. top-level OpenCode `model`
|
|
345
642
|
4. OpenCode's own fallback when no model is configured
|
|
346
643
|
|
|
347
|
-
Use
|
|
644
|
+
### Use default model for everything (recommended)
|
|
348
645
|
|
|
349
|
-
|
|
646
|
+
```json
|
|
647
|
+
{
|
|
648
|
+
"enabled": ["coder", "resolver", "explorer", "reviewer", "deep-reviewer"],
|
|
649
|
+
"models": {}
|
|
650
|
+
}
|
|
651
|
+
```
|
|
350
652
|
|
|
351
|
-
Role-specific aliases
|
|
653
|
+
### Role-specific aliases (when measured benefit exists)
|
|
352
654
|
|
|
353
655
|
```json
|
|
354
656
|
{
|
|
355
|
-
"enabled": ["coder", "reviewer", "
|
|
657
|
+
"enabled": ["coder", "resolver", "explorer", "reviewer", "deep-reviewer"],
|
|
356
658
|
"models": {
|
|
357
|
-
"
|
|
358
|
-
"
|
|
359
|
-
"coder": "
|
|
360
|
-
"resolver": "
|
|
361
|
-
"reviewer": "gpt"
|
|
659
|
+
"fast": "openai/gpt-5-mini",
|
|
660
|
+
"strong": "openai/gpt-5.3-codex",
|
|
661
|
+
"coder": "fast",
|
|
662
|
+
"resolver": "strong"
|
|
362
663
|
}
|
|
363
664
|
}
|
|
364
665
|
```
|
|
365
666
|
|
|
366
|
-
Pin one role directly
|
|
667
|
+
### Pin one role directly
|
|
367
668
|
|
|
368
669
|
```json
|
|
369
670
|
{
|
|
370
671
|
"agents": {
|
|
371
|
-
"
|
|
372
|
-
"model": "openai/gpt-5.
|
|
672
|
+
"resolver": {
|
|
673
|
+
"model": "openai/gpt-5.3-codex"
|
|
373
674
|
}
|
|
374
675
|
}
|
|
375
676
|
}
|
|
376
677
|
```
|
|
377
678
|
|
|
378
|
-
|
|
679
|
+
### Mixed setup (OpenCode config + resolve models)
|
|
379
680
|
|
|
380
|
-
|
|
681
|
+
Native OpenCode agents such as `plan` and `build` are configured through the top-level OpenCode `agent`, not through `opencode-resolve`.
|
|
381
682
|
|
|
382
683
|
```json
|
|
383
684
|
{
|
|
384
|
-
"model": "
|
|
685
|
+
"model": "openai/gpt-5-mini",
|
|
385
686
|
"agent": {
|
|
386
687
|
"plan": {
|
|
387
|
-
"model": "openai/gpt-5.
|
|
688
|
+
"model": "openai/gpt-5.3-codex"
|
|
388
689
|
}
|
|
389
690
|
},
|
|
390
691
|
"plugin": [
|
|
391
692
|
[
|
|
392
693
|
"opencode-resolve",
|
|
393
694
|
{
|
|
394
|
-
"enabled": ["coder", "reviewer", "
|
|
395
|
-
"models": {
|
|
396
|
-
"glm": "zai-coding-plan/glm-5.1",
|
|
397
|
-
"gpt": "openai/gpt-5.5",
|
|
398
|
-
"coder": "glm",
|
|
399
|
-
"resolver": "gpt",
|
|
400
|
-
"reviewer": "gpt"
|
|
401
|
-
}
|
|
695
|
+
"enabled": ["coder", "resolver", "explorer", "reviewer", "deep-reviewer"]
|
|
402
696
|
}
|
|
403
697
|
]
|
|
404
698
|
]
|
|
405
699
|
}
|
|
406
700
|
```
|
|
407
701
|
|
|
408
|
-
In this setup, `plan
|
|
702
|
+
In this setup, `plan` uses `openai/gpt-5.3-codex`; native `build`, resolve `coder`, and resolve `resolver` all use `openai/gpt-5-mini`.
|
|
703
|
+
|
|
704
|
+
### Supported model alias keys
|
|
705
|
+
|
|
706
|
+
| Alias | Purpose |
|
|
707
|
+
|---|---|
|
|
708
|
+
| `fast` | Provider-neutral alias for a fast/cheap model |
|
|
709
|
+
| `strong` | Provider-neutral alias for a strong/expensive model |
|
|
710
|
+
| `mini` | Provider-neutral alias for a mini/efficient model |
|
|
711
|
+
| `codex` | Provider-neutral alias for a codex-style coding model |
|
|
712
|
+
| `quick` | Legacy alias (equivalent to `fast`) |
|
|
713
|
+
| `deep` | Legacy alias (equivalent to `strong`) |
|
|
714
|
+
| `glm` | Legacy alias (backward compatibility) |
|
|
715
|
+
| `gpt` | Legacy alias (backward compatibility) |
|
|
716
|
+
|
|
717
|
+
Aliases only resolve when defined in `models`. Agent names (`coder`, `resolver`, etc.) are also valid alias keys.
|
|
409
718
|
|
|
410
719
|
---
|
|
411
720
|
|
|
@@ -413,9 +722,11 @@ In this setup, `plan`, `resolver`, and `reviewer` use `openai/gpt-5.5`; native `
|
|
|
413
722
|
|
|
414
723
|
| Agent | Default | Mode | Edit | Bash | WebFetch | Purpose |
|
|
415
724
|
|---|:---:|---|---|---|---|---|
|
|
416
|
-
| `resolver` | Yes | `all` | ask → allow | ask → allow | ask → allow |
|
|
417
|
-
| `coder` | Yes | `subagent` | ask → allow | ask → allow | ask → allow | Focused implementer. Smallest correct
|
|
418
|
-
| `
|
|
725
|
+
| `resolver` | Yes (core) | `all` | ask → allow | ask → allow | ask → allow | Context-efficient orchestrator. Decomposes work into verified checkpoints, dispatches coder, verifies each, carries forward. Max 3 retries per failing checkpoint. |
|
|
726
|
+
| `coder` | Yes (core) | `subagent` | ask → allow | ask → allow | ask → allow | Focused implementer. Smallest correct patch. Reads only needed files. |
|
|
727
|
+
| `explorer` | Yes (subagent) | `subagent` | **deny** | ask → allow | ask → allow | Internal fast codebase scout. Resolver dispatches when scope is genuinely unknown; prefers local read/grep/glob for narrow scope. |
|
|
728
|
+
| `reviewer` | Yes (subagent) | `subagent` | **deny** | **deny** | ask → allow | Internal verification-gap auditor. Resolver dispatches for post-change verification gaps on non-trivial changes. |
|
|
729
|
+
| `deep-reviewer` | Yes (subagent) | `subagent` | **deny** | **deny** | ask → allow | Internal thorough review for risky/security/architecture changes. Resolver dispatches ONLY for high-impact work. |
|
|
419
730
|
| `architect` | No | `subagent` | deny | ask → allow | ask → allow | Design and task decomposition. |
|
|
420
731
|
| `gpt-coder` | No | `subagent` | ask → allow | ask → allow | ask → allow | Stronger-reasoning implementation fallback. |
|
|
421
732
|
| `debugger` | No | `subagent` | ask → allow | ask → allow | ask → allow | Reproduction and root-cause analysis. |
|
|
@@ -433,19 +744,25 @@ Supported modes:
|
|
|
433
744
|
|
|
434
745
|
Supported permission values: `ask`, `allow`, `deny`.
|
|
435
746
|
|
|
436
|
-
Supported model alias keys: `glm`, `gpt`, and every supported agent name. Aliases only resolve when defined in `models`.
|
|
747
|
+
Supported model alias keys: `fast`, `strong`, `mini`, `codex`, `quick`, `deep`, `glm`, `gpt`, and every supported agent name. Aliases only resolve when defined in `models`.
|
|
437
748
|
|
|
438
749
|
`preserveNative` is accepted for readability, but native `plan` and `build` are always preserved. The plugin never rewrites built-in OpenCode agents.
|
|
439
750
|
|
|
440
751
|
### Resolver orchestration rules
|
|
441
752
|
|
|
442
|
-
The resolver
|
|
753
|
+
The resolver uses a context-efficient approach with checkpointed execution (max 3 retries per failing checkpoint):
|
|
443
754
|
|
|
444
|
-
-
|
|
445
|
-
-
|
|
446
|
-
-
|
|
447
|
-
-
|
|
448
|
-
-
|
|
755
|
+
- **Classify** the work as quick, normal, deep, or risky before planning.
|
|
756
|
+
- **Inspect only relevant files** using local tools — avoid broad exploration.
|
|
757
|
+
- For trivial work, apply edits directly — no subagent needed.
|
|
758
|
+
- Dispatch **coder** with focused file/behavior instructions.
|
|
759
|
+
- Run the **cheapest meaningful verification** first.
|
|
760
|
+
- Retry from verification logs if issues remain. Max 3 attempts per failing checkpoint; then move forward or report the blocker.
|
|
761
|
+
- Use **explorer** only when scope is genuinely unknown and local read/grep/glob are insufficient (internal subagent, not core path).
|
|
762
|
+
- Use **reviewer** only when a verification gap exists on non-trivial changes (internal subagent, not core path).
|
|
763
|
+
- Use **deep-reviewer** only for risky, security-sensitive, architectural, or high-impact changes (internal subagent, not core path).
|
|
764
|
+
- Return a concise evidence summary when resolved or blocked.
|
|
765
|
+
- Honor the `maxParallelSubagents` per-role limit for context efficiency.
|
|
449
766
|
|
|
450
767
|
---
|
|
451
768
|
|
|
@@ -461,6 +778,56 @@ Set `commands: true` to add helper subtask commands:
|
|
|
461
778
|
|
|
462
779
|
---
|
|
463
780
|
|
|
781
|
+
## Context7 Integration
|
|
782
|
+
|
|
783
|
+
When `context7: true` (the default), the plugin automatically registers the [Context7](https://context7.com) MCP server at startup:
|
|
784
|
+
|
|
785
|
+
```json
|
|
786
|
+
{
|
|
787
|
+
"type": "remote",
|
|
788
|
+
"url": "https://mcp.context7.com/mcp"
|
|
789
|
+
}
|
|
790
|
+
```
|
|
791
|
+
|
|
792
|
+
This gives all resolve agents access to up-to-date library and framework documentation through the `resolve-library-id` and `query-docs` tools — no manual MCP configuration needed.
|
|
793
|
+
|
|
794
|
+
To disable Context7 registration (e.g. you already have it configured, or you don't want it):
|
|
795
|
+
|
|
796
|
+
```json
|
|
797
|
+
{
|
|
798
|
+
"context7": false
|
|
799
|
+
}
|
|
800
|
+
```
|
|
801
|
+
|
|
802
|
+
If `mcp.context7` is already present in your OpenCode config, the plugin does not overwrite it.
|
|
803
|
+
|
|
804
|
+
---
|
|
805
|
+
|
|
806
|
+
## Keeping Up to Date
|
|
807
|
+
|
|
808
|
+
> **OpenCode caches the last version it downloaded.** To get a new release you must explicitly refresh.
|
|
809
|
+
|
|
810
|
+
```sh
|
|
811
|
+
# Upgrade via npm
|
|
812
|
+
npm install -g opencode-resolve@latest
|
|
813
|
+
|
|
814
|
+
# Refresh the OpenCode cache
|
|
815
|
+
opencode plugin opencode-resolve --global --force
|
|
816
|
+
|
|
817
|
+
# Restart OpenCode
|
|
818
|
+
```
|
|
819
|
+
|
|
820
|
+
After upgrading, `postinstall` runs additive migration on your `resolve.json` — new keys are added, existing keys are never modified.
|
|
821
|
+
|
|
822
|
+
### Pinning a specific version
|
|
823
|
+
|
|
824
|
+
```sh
|
|
825
|
+
npm install -g opencode-resolve@0.1.3
|
|
826
|
+
opencode plugin opencode-resolve --global --force
|
|
827
|
+
```
|
|
828
|
+
|
|
829
|
+
---
|
|
830
|
+
|
|
464
831
|
## Local Development
|
|
465
832
|
|
|
466
833
|
From this repository:
|
|
@@ -536,7 +903,19 @@ The release workflow runs `npm ci`, `npm run typecheck`, `npm test`, and `npm pu
|
|
|
536
903
|
## Design Rules
|
|
537
904
|
|
|
538
905
|
- Do not overwrite native `plan` or `build` agents.
|
|
539
|
-
-
|
|
540
|
-
-
|
|
541
|
-
-
|
|
906
|
+
- Core path is fixed: `resolver` (context-efficient planner/judge) → `coder` (implementer).
|
|
907
|
+
- Internal specialist subagents (`explorer`, `reviewer`, `deep-reviewer`) are injected by default as OpenCode-native subagents — they inherit OpenCode's composition philosophy — but are not the default execution path and are never user-facing primary roles.
|
|
908
|
+
- Resolver prefers local read/grep/glob for narrow scope; dispatches `explorer` only when scope is genuinely unknown.
|
|
909
|
+
- Resolver dispatches `reviewer` only for verification gaps on non-trivial changes.
|
|
910
|
+
- Resolver dispatches `deep-reviewer` only for risky, security-sensitive, architectural, or high-impact changes.
|
|
911
|
+
- Reviewer and deep-reviewer are read-only — fixes always go through `coder` or `resolver`.
|
|
912
|
+
- Max 3 retries per failing checkpoint to avoid wasted context. Large tasks are decomposed into verified checkpoints.
|
|
913
|
+
- The resolver honors `maxParallelSubagents` for context efficiency.
|
|
542
914
|
- Search and inspect before editing. Make the smallest correct change. Verify when practical.
|
|
915
|
+
- Read only needed files. Avoid broad exploration. Targeted verification, not full suites.
|
|
916
|
+
|
|
917
|
+
---
|
|
918
|
+
|
|
919
|
+
## License
|
|
920
|
+
|
|
921
|
+
[MIT](./LICENSE)
|