opencode-reviewer 1.0.0 → 1.0.2
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.md +64 -23
- package/dist/tui.js +2846 -1219
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# OpenCode Reviewer
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> ⚠️ **NOT v2 COMPATIBLE YET**
|
|
4
|
+
>
|
|
5
|
+
> I recommend not upgrading opencode to v2 yet as many things are still unstable
|
|
6
|
+
|
|
7
|
+
Reviews pending permissions in the [OpenCode](https://github.com/anomalyco/opencode) sidebar using a separate LLM. Covers
|
|
4
8
|
shell commands, file edits, skill loading, MCP calls, custom tools, and external-directory access.
|
|
5
9
|
Supports streaming explanations, saved report history, auto-approval, and Linux
|
|
6
10
|
desktop notifications with distinct sounds.
|
|
@@ -13,7 +17,8 @@ This plugin is meant to enable you to run sessions with less frequent input in a
|
|
|
13
17
|
|
|
14
18
|

|
|
15
19
|
|
|
16
|
-
|
|
20
|
+
Verified with OpenCode 1.18.35 on Linux. Version **1.0.2** is the final release
|
|
21
|
+
compatible with OpenCode V1.
|
|
17
22
|
|
|
18
23
|
## Install and config
|
|
19
24
|
|
|
@@ -25,7 +30,7 @@ OpenCode installs the [npm package](https://www.npmjs.com/package/opencode-revie
|
|
|
25
30
|
"$schema": "https://opencode.ai/tui.json",
|
|
26
31
|
"plugin": [
|
|
27
32
|
[
|
|
28
|
-
"opencode-reviewer@
|
|
33
|
+
"opencode-reviewer@1.0.2",
|
|
29
34
|
{
|
|
30
35
|
"baseURL": "https://openrouter.ai/api/v1",
|
|
31
36
|
"model": "your-model",
|
|
@@ -50,7 +55,7 @@ OpenCode installs the [npm package](https://www.npmjs.com/package/opencode-revie
|
|
|
50
55
|
"attention": { "banner": true, "sound": true },
|
|
51
56
|
"unsafe": { "banner": true, "sound": true },
|
|
52
57
|
"question": { "banner": true, "sound": true },
|
|
53
|
-
"approved": { "banner": true, "sound":
|
|
58
|
+
"approved": { "banner": true, "sound": false },
|
|
54
59
|
"error": { "banner": true, "sound": true },
|
|
55
60
|
"ended": { "banner": true, "sound": true }
|
|
56
61
|
},
|
|
@@ -96,21 +101,21 @@ inclusive, fractions are invalid, and the maximum safe integer is
|
|
|
96
101
|
| `apiKey` | string | Unset | Nonempty Bearer token. Takes precedence over `apiKeyEnv`. |
|
|
97
102
|
| `apiKeyEnv` | string | Unset | Environment-variable name matching `[A-Za-z_][A-Za-z_0-9]*`. Without an inline key, its value must be set and nonblank when a review runs. Omit both key options for no Authorization header. |
|
|
98
103
|
| `instructions` | string | Unset (built-ins) | Absolute, NUL-free directory path containing overrides for the [prompt templates](https://github.com/mightykatun/opencode-reviewer/tree/main/prompts), not inline instructions. Missing named files use built-ins; supplied files must be readable, regular, non-symlink, nonempty UTF-8 text up to 64 KiB. Fixed contracts cannot be overridden. |
|
|
99
|
-
| `stream` | boolean | `false` | Request SSE and show provisional rating/text updates. Normal automatic approval waits for a completed, validated
|
|
104
|
+
| `stream` | boolean | `false` | Request SSE and show provisional rating/text updates. Normal automatic approval waits for a completed, validated report; fast mode can approve on an early Safe rating. Presentation rules are described below. |
|
|
100
105
|
| `reviewBash` | boolean | `true` | Review native shell-command permissions. |
|
|
101
106
|
| `reviewEdits` | boolean | `true` | Review native `edit`, `write` and `apply_patch` permissions. |
|
|
102
107
|
| `reviewSkills` | boolean | `true` | Review native skill-load permissions for dangerous guidance and relevance to the current task. Supplies the host's skill instructions and bounded, directly referenced supporting files within the skill directory. |
|
|
103
108
|
| `reviewMcp` | boolean | `false` | Review identifiable MCP tool and resource permissions. |
|
|
104
109
|
| `reviewCustomTools` | boolean | `false` | Review permissions requested by registered custom tools. |
|
|
105
110
|
| `reviewExternalDirectories` | boolean | `false` | Review directory access independently of operation-review switches. Directory approval can resume the operation without another prompt. |
|
|
106
|
-
| `autoApprove` | boolean | `false` | Allow Safe reviews once automatically. Normally waits for completion, validation
|
|
107
|
-
| `fastMode` | boolean | `false` | Requires `autoApprove: true`. Approve
|
|
111
|
+
| `autoApprove` | boolean | `false` | Allow Safe reviews once automatically. Normally waits for completion, validation and the countdown. Root-view rendering is required, including behind report history; same-conversation subagent browsing permits hidden approval. |
|
|
112
|
+
| `fastMode` | boolean | `false` | Requires `autoApprove: true`. Approve an eligible, front-of-queue request as soon as a Safe rating is parsed, bypassing the countdown. Respects `stream`; with `stream: false`, waits for the complete validated response. Finish the report and save it in the background after approval. |
|
|
108
113
|
| `extraCareful` | boolean | `true` | Include extra-careful guidance when `autoApprove` is enabled. Setting `false` omits that guidance without disabling automatic approval. |
|
|
109
|
-
| `autoApproveDelaySeconds` | integer | `15` | `0`–`3600` seconds. Positive values
|
|
114
|
+
| `autoApproveDelaySeconds` | integer | `15` | `0`–`3600` seconds. Positive values include an extra 200 ms initial grace; `0` skips the wait but keeps the other approval checks. Ignored in fast mode. |
|
|
110
115
|
| `notify` | boolean | `true` | Master switch for desktop banners, sounds and reminders. `false` overrides all per-type controls. |
|
|
111
116
|
| `notifySound` | boolean | `true` | Master switch for notification audio. `false` silences every type and reminder without disabling enabled banners. |
|
|
112
117
|
| `staleReminderSeconds` | integer | `60` | `0` through the maximum safe integer, in seconds. `0` disables reminders; otherwise eligible pending human interactions repeat at this interval, limited to the native front-of-queue blocker per conversation. |
|
|
113
|
-
| `notifications` | object | All
|
|
118
|
+
| `notifications` | object | All banners enabled; all sounds enabled except `approved` | Keys: `attention`, `unsafe`, `question`, `approved`, `error`, `ended`. Each entry is an object with optional `banner` and `sound` booleans. Omitted types/fields retain their defaults; unknown types/fields are invalid. Controls also apply to reminders. |
|
|
114
119
|
| `notificationSoundDirectory` | string | Unset (bundled sounds) | Absolute, NUL-free path, at most 4096 string code units. Use the six notification type names as basenames: usable `.wav` first, then `.mp3`, then the corresponding bundled sound. |
|
|
115
120
|
| `formatRetries` | integer | `1` | `0`–`100` additional assessment-format correction attempts. `0` disables format corrections, not independent transport recovery. |
|
|
116
121
|
| `maxOutputTokens` | integer | `4096` | `1` through the maximum safe integer. Sent as `max_tokens` on every reviewer POST, including retries/corrections. Your provider/model enforces its supported output limit. |
|
|
@@ -131,6 +136,16 @@ The sidebar shows Safe, Unsafe, or Analysis unavailable. Explanations support
|
|
|
131
136
|
Markdown and scrolling. If the sidebar is hidden, use OpenCode's Show sidebar
|
|
132
137
|
command.
|
|
133
138
|
|
|
139
|
+
The reviewer side panel appears only in the top-level conversation. Browsing its
|
|
140
|
+
subagents, including nested subagents, hides the panel while reviews and both normal
|
|
141
|
+
and fast automatic approvals continue. Countdown deadlines stay the same, and new
|
|
142
|
+
Safe reviews can become eligible while hidden. Return to the top-level conversation
|
|
143
|
+
to see the current report or browse saved history.
|
|
144
|
+
|
|
145
|
+
On the top-level route, automatic approval requires mouse tracking for the host's
|
|
146
|
+
painted-panel ownership checks. With mouse tracking disabled there, reports remain
|
|
147
|
+
available for manual review.
|
|
148
|
+
|
|
134
149
|
Skill-load review is enabled by default; set `skill` permissions to `ask` in
|
|
135
150
|
`opencode.json` to receive reviews. Its prompt requires both bounded risk and clear
|
|
136
151
|
relevance to the current work. A harmless but irrelevant skill is rated Unsafe.
|
|
@@ -151,13 +166,16 @@ that can override its review contract.
|
|
|
151
166
|
With streaming enabled, Evaluating and its spinner disappear when a rating arrives.
|
|
152
167
|
The rating remains provisional until the full response is validated. A retry
|
|
153
168
|
clears the preview and restores the loading indicator. Normal auto-approval
|
|
154
|
-
starts only after the full response is validated and rendered
|
|
169
|
+
starts only after the full response is validated and rendered, except that rendering
|
|
170
|
+
is not required while the panel is intentionally hidden by same-conversation
|
|
171
|
+
subagent browsing.
|
|
155
172
|
|
|
156
173
|
With `autoApprove: true` and `fastMode: true`, a parsed Safe rating approves the
|
|
157
|
-
current
|
|
158
|
-
rest of a streamed report.
|
|
159
|
-
|
|
160
|
-
|
|
174
|
+
current eligible permission immediately, without a countdown or waiting for the
|
|
175
|
+
rest of a streamed report. Same-conversation subagent browsing also permits fast
|
|
176
|
+
approval while the panel is hidden. Explicit sidebar hiding, covering dialogs and
|
|
177
|
+
report history prevent fast approval. Without streaming, fast mode waits for the
|
|
178
|
+
full validated response and then skips the countdown.
|
|
161
179
|
|
|
162
180
|
After confirmed fast approval, the live panel shows **Auto-approved; finishing
|
|
163
181
|
report…** and stays ahead of newer requests until its report finishes. Hiding the
|
|
@@ -181,11 +199,14 @@ provider charges, and unreported usage remains unknown.
|
|
|
181
199
|
|
|
182
200
|
During an auto-approval countdown, click the countdown to allow once immediately,
|
|
183
201
|
or Cancel to leave the request manual. Hiding or covering the panel also cancels
|
|
184
|
-
that request's countdown, except when covered by this plugin's report history
|
|
202
|
+
that request's countdown, except when covered by this plugin's report history or
|
|
203
|
+
intentionally hidden while browsing the same conversation's subagents. Switching
|
|
204
|
+
to an unrelated conversation still cancels it. Returning cannot revive a canceled
|
|
205
|
+
request.
|
|
185
206
|
Cancel before using native Allow always or rejection
|
|
186
207
|
forms; those forms alone do not stop the countdown.
|
|
187
|
-
Positive countdowns
|
|
188
|
-
|
|
208
|
+
Positive countdowns add a 200 ms initial grace and then update on remaining-time
|
|
209
|
+
boundaries. A zero-second setting still approves without that grace.
|
|
189
210
|
|
|
190
211
|
`/reviewer-disable` and `/reviewer-enable` control the current conversation and its
|
|
191
212
|
descendants. The setting is saved for resume. Both commands are also in the command
|
|
@@ -291,11 +312,12 @@ terminal is focused:
|
|
|
291
312
|
with its own sound. Provisional streamed ratings never notify.
|
|
292
313
|
- **Agent has a question:** a pending agent question at the front of the native
|
|
293
314
|
input queue, with its own sound.
|
|
294
|
-
- **Reviewer approved a permission:**
|
|
315
|
+
- **Reviewer approved a permission:** a silent banner by default, sent after confirmed
|
|
295
316
|
automatic approval, including fast mode while its report is still streaming.
|
|
296
317
|
Positive and zero delays also notify on success; the countdown is silent.
|
|
297
|
-
Approval sounds are limited to
|
|
298
|
-
one every two seconds
|
|
318
|
+
Opt in with `notifications.approved.sound: true`. Approval sounds are limited to
|
|
319
|
+
one every two seconds, including delayed playback. Sounds from the same session
|
|
320
|
+
wait for the previous player to finish, so successive alerts do not overlap.
|
|
299
321
|
- **Session error:** an unrecovered session/provider failure, not a review failure.
|
|
300
322
|
- **Session ended:** a completed root-agent response, not a question/permission
|
|
301
323
|
pause or an explicit user interruption.
|
|
@@ -311,7 +333,7 @@ actionable position, restarting analysis or entering automatic approval cancels
|
|
|
311
333
|
pending attention delivery and reminders.
|
|
312
334
|
|
|
313
335
|
Each type's `banner` and `sound` can be controlled independently. For example,
|
|
314
|
-
`notifications.approved
|
|
336
|
+
`notifications.approved: { "banner": false, "sound": true }` enables approval sounds without banners;
|
|
315
337
|
`notifications.question.sound: false` keeps question banners silent. Set both to
|
|
316
338
|
`false` to disable that type. `notify: false` overrides all types and disables
|
|
317
339
|
reminders too; `notifySound: false` silences all types and their reminders.
|
|
@@ -319,7 +341,8 @@ Sound-only delivery does not require a desktop banner or delivery acknowledgemen
|
|
|
319
341
|
Invalid notification settings disable notification work without disabling reviews.
|
|
320
342
|
|
|
321
343
|
Pending permissions and questions repeat after `staleReminderSeconds`, measured
|
|
322
|
-
from initial dispatch, even if desktop delivery fails.
|
|
344
|
+
from actual initial dispatch, even if desktop delivery fails. Capacity waiting
|
|
345
|
+
does not start the reminder clock or replace an undelivered initial alert. Reminders replace their
|
|
323
346
|
previous banner and append **(Reminder)** to the event text, reusing the same
|
|
324
347
|
sound, icon, session heading and click target. Only the native front-of-queue
|
|
325
348
|
interaction per root conversation repeats: permissions precede questions, with
|
|
@@ -362,6 +385,18 @@ Audio is prepared before showing its banner and played from the normalized cache
|
|
|
362
385
|
with a low-latency buffer; preparation never blocks permission approval.
|
|
363
386
|
`stdbuf` makes delivery acknowledgements immediate instead of waiting for
|
|
364
387
|
`notify-send` to flush its output when the banner closes.
|
|
388
|
+
Delivery is bounded: up to 64 active tickets (48 routine), 256 waiting actionable
|
|
389
|
+
episodes, and 128 waiting routine events. A full routine backlog drops new
|
|
390
|
+
approval/error/completion events; already admitted events retain their exact
|
|
391
|
+
targets. Actionable attention/Unsafe/question work has priority, rotating among
|
|
392
|
+
roots; after eight actionable dispatches, waiting routine work gets a turn.
|
|
393
|
+
Each root has only its current actionable episode, and waiting reminders coalesce.
|
|
394
|
+
The process pool allows 24 children: 20 banners (16 routine), two players, one
|
|
395
|
+
withdrawal and one activation. Audio preparation has two actual-operation slots;
|
|
396
|
+
audio waiting is bounded to 64 requests. Cancellation and timeouts do not free
|
|
397
|
+
physical slots until their operations settle. Queued actionable work is canceled
|
|
398
|
+
when its request resolves or loses native queue ownership. Desktop/process
|
|
399
|
+
failures remain best-effort and do not delay permission approval.
|
|
365
400
|
Disable overlapping notification plugins to avoid duplicate alerts.
|
|
366
401
|
</details>
|
|
367
402
|
|
|
@@ -370,6 +405,12 @@ Disable overlapping notification plugins to avoid duplicate alerts.
|
|
|
370
405
|
Use Node.js 24.15.0+ within 24.x, or 22.22.2+ within 22.x, and npm.
|
|
371
406
|
Run `npm ci --ignore-scripts`, then `npm run check` for typechecking, source tests,
|
|
372
407
|
pure-helper tests and the build. `npm run test:helpers` runs the helper checks
|
|
373
|
-
without building or starting OpenCode. Pull-request CI checks both Node versions
|
|
408
|
+
without building or starting OpenCode. Pull-request CI checks both Node versions
|
|
409
|
+
and runs a separate representative Linux OpenCode 1.18.35 fixture profile.
|
|
410
|
+
After building, run `node scripts/test-runtime.mjs --profile ci` for that same
|
|
411
|
+
profile. Use `node scripts/test-runtime.mjs --list` for the complete runtime
|
|
412
|
+
inventory or `node scripts/test-runtime.mjs --plan --profile ci` for a
|
|
413
|
+
host-independent plan. Profiles select documented scenario/flag combinations;
|
|
414
|
+
interactive desktop checks and historical replays have separate prerequisites.
|
|
374
415
|
See [AGENTS.md](https://github.com/mightykatun/opencode-reviewer/blob/main/AGENTS.md)
|
|
375
416
|
for runtime tests and the tag-driven release process.
|