opencode-reviewer 2.0.0 → 2.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 CHANGED
@@ -3,8 +3,8 @@
3
3
  Reviews pending permissions in the [OpenCode](https://github.com/anomalyco/opencode) sidebar using a separate LLM. Reviews
4
4
  native shell commands, file edits, and external-directory access. Skill, MCP and
5
5
  custom-tool requests currently remain manual.
6
- Supports streaming explanations, saved report history, auto-approval, and Linux
7
- desktop notifications with distinct sounds.
6
+ Supports streaming explanations, saved report history and stats, auto-approval, and Linux
7
+ desktop notifications (Gnome) with distinct sounds.
8
8
 
9
9
  This plugin is meant to enable you to run sessions with less frequent input in a safer way. Also giving the reviewer context of specific files the agent might want to run/see/... The review prompts are freely configurable, so you can determine the reviewers behavior very accurately.
10
10
 
@@ -14,9 +14,8 @@ This plugin is meant to enable you to run sessions with less frequent input in a
14
14
 
15
15
  ![](./assets/recording.gif)
16
16
 
17
- Targets OpenCode V2 on Linux. Host version numbers do not gate plugin activation;
18
- the companion protocol and actual scoped API contracts govern review and approval.
19
- Verified host checks are recorded in the maintainer migration plan.
17
+ For OpenCode V2 on Linux. The plugin checks the server companion's protocol and
18
+ each request's data and scope rather than allowing only specific host versions.
20
19
 
21
20
  ## Install and config
22
21
 
@@ -30,7 +29,7 @@ There is no project-local CLI configuration. OpenCode loads the
30
29
  "$schema": "https://opencode.ai/v2/cli.json",
31
30
  "plugins": [
32
31
  {
33
- "package": "opencode-reviewer@2.0.0",
32
+ "package": "opencode-reviewer@latest",
34
33
  "options": {
35
34
  "baseURL": "https://openrouter.ai/api/v1",
36
35
  "model": "your-model",
@@ -80,28 +79,18 @@ launching OpenCode. The inline key takes precedence. Omit both for an unauthenti
80
79
  endpoint. Remove `instructions` to use the built-in prompts and
81
80
  `notificationSoundDirectory` to use the bundled sounds.
82
81
 
83
- The connection, credential and directory values above are examples, not defaults.
84
- All boolean, numeric and per-type notification values shown are the defaults.
85
- Restart OpenCode after changing reviewer configuration. Also load the server
86
- companion in `opencode.json`, globally or in the project. Keep permission rules
87
- only in this server configuration, not in `cli.json`:
82
+ You also need to edit `opencode.json`, as the plugin needs to be informed of states
83
+ that are not exposed by TUI APIs:
88
84
 
89
85
  ```json
90
86
  {
91
87
  "$schema": "https://opencode.ai/config.json",
92
- "plugins": ["opencode-reviewer@2.0.0"],
93
- "permissions": [
94
- { "action": "shell", "resource": "*", "effect": "ask" },
95
- { "action": "edit", "resource": "*", "effect": "ask" },
96
- { "action": "skill", "resource": "*", "effect": "ask" },
97
- { "action": "external_directory", "resource": "*", "effect": "ask" }
98
- ]
88
+ "plugins": ["opencode-reviewer@latest"],
99
89
  }
100
90
  ```
101
91
 
102
- Merge these entries with your existing configuration. Rules are ordered; the last
103
- matching rule wins. Reviews run only when OpenCode asks for permission. Existing
104
- `allow` rules and native autoaccept skip review. See OpenCode's
92
+ ### Opencode docs
93
+
105
94
  [server config](https://opencode.ai/v2/docs/config),
106
95
  [CLI config](https://opencode.ai/v2/docs/cli/config) and
107
96
  [CLI plugins](https://opencode.ai/v2/docs/build/plugins/cli) guides.
@@ -109,7 +98,7 @@ matching rule wins. Reviews run only when OpenCode asks for permission. Existing
109
98
  ## Options reference
110
99
 
111
100
  These are options inside the plugin's `options` object in global `cli.json`.
112
- Defaults apply only to omitted options; `null` is invalid. Boolean and integer
101
+ Defaults apply only to omitted options. `null` is invalid. Boolean and integer
113
102
  options require JSON booleans and numbers, not quoted strings. Integer ranges are
114
103
  inclusive, fractions are invalid, and the maximum safe integer is
115
104
  9,007,199,254,740,991. Unknown option names are rejected.
@@ -128,7 +117,7 @@ inclusive, fractions are invalid, and the maximum safe integer is
128
117
  | `reviewMcp` | boolean | `false` | MCP-review category switch. V2 MCP collection is currently unsupported; enabling this does not supply missing origin/catalog evidence or permit automatic approval. |
129
118
  | `reviewCustomTools` | boolean | `false` | Custom-tool review category switch. V2 custom-tool collection is currently unsupported; these requests remain manual. |
130
119
  | `reviewExternalDirectories` | boolean | `false` | Review directory access independently of operation-review switches. Directory approval can resume the operation without another prompt. |
131
- | `autoApprove` | boolean | `false` | Allow Safe reviews once automatically. Normally waits for completion, validation and the countdown. Requires the top-level conversation and physical presentation proof; subagent browsing never permits automatic approval. Normal-mode report-history cover has a separate physical-proof exception. |
120
+ | `autoApprove` | boolean | `false` | Allow Safe reviews once automatically. Normally waits for completion, validation and the countdown. Works throughout the current conversation, including subagent browsing and hidden/covered reports. Home, dashboards, unrelated conversations and native permission decision editing wait without cancellation. |
132
121
  | `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. |
133
122
  | `extraCareful` | boolean | `true` | Include extra-careful guidance when `autoApprove` is enabled. Setting `false` omits that guidance without disabling automatic approval. |
134
123
  | `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. |
@@ -143,10 +132,10 @@ inclusive, fractions are invalid, and the maximum safe integer is
143
132
  | `maxFiles` | integer | `6` | `1`–`1000` distinct file candidates per shell/edit review, including unavailable candidates. |
144
133
  | `maxEvidenceBytes` | integer | `131072` | `1`–`16777216` bytes for command/source content, edit diffs or category-specific JSON evidence. Optional items are omitted whole; oversized mandatory evidence fails analysis. This is not a cap on the full prompt or HTTP request. |
145
134
 
146
- Notification channels are independent: `banner: false, sound: true` is sound-only;
147
- `banner: true, sound: false` is banner-only; both `false` disable that type.
135
+ Notification channels are independent: `banner: false, sound: true` is sound-only,
136
+ `banner: true, sound: false` is banner-only, both `false` disable that type.
148
137
  `notify` and `notifySound` take precedence. Invalid notification settings disable
149
- notification work without invalidating otherwise valid review settings.
138
+ notification.
150
139
 
151
140
  My LLMs insist on writing a bunch of useless text to my README, so I collapsed them here in case anyone wants to inflict themselves (or more likely their agent) the pain of reading it.
152
141
 
@@ -156,47 +145,49 @@ The sidebar shows Safe, Unsafe, or Analysis unavailable. Explanations support
156
145
  Markdown and scrolling. If the sidebar is hidden, use OpenCode's Show sidebar
157
146
  command.
158
147
 
159
- The reviewer side panel appears only in the top-level conversation. Browsing its
160
- subagents, including nested subagents, hides the panel and prevents both normal
161
- and fast automatic approvals. Reviews may finish while hidden. A Safe report that
162
- has never started a normal countdown may first become eligible after returning to
163
- the root and receiving real presentation proof, with a fresh countdown. Leaving
164
- the root after a countdown starts permanently makes that request manual for the
165
- running controller, even after returning or disabling/re-enabling review.
166
-
167
- Automatic approval requires mouse tracking for the host's painted-panel ownership
168
- checks. With mouse tracking disabled, reports remain available for manual review.
169
- The plugin never enables mouse tracking. It preserves sidebar visibility except
170
- after an explicit approval-notification click, when a root frame confirms the
171
- sidebar is absent before revealing it.
172
-
173
- The category switches are retained, but the current V2 collectors do not support
174
- skill, MCP or custom-tool reviews. Missing mandatory skill instructions and unproven
175
- MCP/custom origin or catalog evidence leave these requests manual, not Safe.
176
-
177
- Native Code Mode and its tool search remain enabled. Exactly linked native calls
178
- can be reviewed; ambiguously linked nested calls remain manual. The plugin assumes
179
- installed plugins preserve native tool meanings, do not replace or alias native
180
- executors, and do not rewrite commands after evidence capture.
181
-
182
- Subagent requests carry the genuine latest root-user prompt. Exact immediate
183
- delegation is currently unavailable through the supported V2 evidence path and is
184
- factually omitted, not guessed from older tasks, sibling requests or queued follow-ups.
185
- Optional context omissions do not alone prevent review when mandatory operation
186
- evidence is verified. Context cannot override the review contract.
148
+ The reviewer panel appears only in the main conversation. Opening any subagent,
149
+ including a nested one, hides the panel but does not stop normal or fast auto-approval
150
+ within that conversation. A Safe report need not be displayed before approval.
151
+ Command selectors, dialogs, report history, other session panels, sidebar hiding,
152
+ terminal resizing and disabled mouse tracking do not cancel automation.
153
+
154
+ Home, dashboard routes and unrelated conversations hold approval until you return
155
+ to the request's conversation. A countdown already started keeps its original
156
+ deadline; if it expires while waiting, approval can proceed immediately on return
157
+ after fresh checks. A review that has never started a countdown starts its full
158
+ delay when its conversation becomes eligible.
159
+
160
+ The plugin doesn't enable mouse tracking or reveal a hidden sidebar unless you
161
+ click an approval notification; it checks that the sidebar is absent from the main
162
+ conversation before showing it. Hidden automatic reports are saved normally.
163
+
164
+ The skill, MCP and custom-tool options are still present, but these reviews aren't
165
+ supported in V2. The reviewer can't get the required skill instructions or verify
166
+ the source and catalog information for MCP and custom tools. Those requests need
167
+ manual approval; they aren't rated Safe.
168
+
169
+ Code Mode and its tool search stay enabled. Native tool calls can be reviewed when
170
+ the reviewer can match them exactly to their permission requests. Nested calls
171
+ without an exact match need manual approval. This assumes other installed plugins don't change
172
+ what native tools do, replace or alias their executors, or rewrite commands after
173
+ the reviewer has captured them.
174
+
175
+ Subagent reviews include the latest user prompt from the main conversation. The
176
+ V2 evidence collector can't get the exact task passed to the requesting subagent,
177
+ so it leaves that out rather than guessing from older tasks, sibling requests or
178
+ queued follow-ups. Missing optional context doesn't prevent review if the required
179
+ operation evidence is verified. Context can't override the review rules.
187
180
 
188
181
  With streaming enabled, Evaluating and its spinner disappear when a rating arrives.
189
- The rating remains provisional until the full response is validated. A retry
190
- clears the preview and restores the loading indicator. Normal auto-approval
191
- starts only after the full response is validated and rendered on the top-level
192
- conversation, with matching physical presentation proof.
193
-
194
- With `autoApprove: true` and `fastMode: true`, a parsed Safe rating approves the
195
- current eligible permission immediately, without a countdown or waiting for the
196
- rest of a streamed report. It still requires native front-of-queue ownership and
197
- physical presentation on the top-level conversation. Subagent browsing, explicit
198
- sidebar hiding, covering dialogs and report history prevent fast approval. Without
199
- streaming, fast mode waits for the full validated response and then skips the countdown.
182
+ The rating is provisional until the full response passes validation. A retry
183
+ clears the preview and brings back the loading indicator. Normal auto-approval
184
+ waits for the full validated report, then the configured countdown.
185
+
186
+ With `autoApprove: true` and `fastMode: true`, a parsed Safe rating can approve the
187
+ request before the streamed report finishes, without a countdown. The request must
188
+ be first in OpenCode's permission queue and belong to the currently viewed conversation
189
+ or its descendants. The report may be hidden or covered. Without streaming, fast
190
+ mode waits for the full validated response, then skips the countdown.
200
191
 
201
192
  After confirmed fast approval, the live panel shows **Auto-approved; finishing
202
193
  report…** and stays ahead of newer requests until its report finishes. Hiding the
@@ -219,13 +210,16 @@ limits and overall timeout still apply. Retried requests can incur additional
219
210
  provider charges, and unreported usage remains unknown.
220
211
 
221
212
  During an auto-approval countdown, click the countdown to allow once immediately,
222
- or Cancel to leave the request manual. Hiding or covering the panel also cancels
223
- that request's countdown, except for this plugin's physically proven report-history
224
- cover on the root route. Browsing any subagent or switching conversations cancels it.
225
- Returning, remounting or re-enabling cannot revive a canceled request. An uncertain
226
- approval write also remains manual and is never retried.
227
- Cancel before using native Allow always or rejection
228
- forms; those forms alone do not stop the countdown.
213
+ or Cancel to leave the request manual. Only explicit stop actions, such as Cancel,
214
+ disabling review, or native interruption/rejection, stop automation for that request.
215
+ Returning, reopening the panel or re-enabling review won't restart a canceled countdown.
216
+ Selecting native Allow always or Reject, or editing a rejection reason, holds
217
+ approval without cancellation. Returning to Allow once resumes eligibility with
218
+ the original countdown deadline. Ambiguous native choice state also waits.
219
+ Temporary queue/cache/read failures wait and recover after fresh verification.
220
+ Changed or unverifiable requests remain manual. If the plugin can't confirm the
221
+ result of a sent approval attempt, it never retries that write.
222
+ Cancel remains available during native preparation, until the approval is sent.
229
223
  Positive countdowns add a 200 ms initial grace and then update on remaining-time
230
224
  boundaries. A zero-second setting still approves without that grace.
231
225
 
@@ -234,9 +228,9 @@ descendants. The setting is saved for resume. Both commands are also in the comm
234
228
  palette. Disabling stops unapproved reviews and countdowns while native permission
235
229
  controls remain available. Already-approved fast-mode reports finish in the background.
236
230
 
237
- After a server reconnect or companion replacement, the old controller stops reviews
238
- and automatic replies until the plugin is reloaded or OpenCode is restarted. It does
239
- not mix old permission caches with a new connection.
231
+ If the server reconnects or the companion is replaced, reviews and auto-approval
232
+ stop. Reload the plugin or restart OpenCode to resume. This keeps cached permissions
233
+ from the old connection separate from the new one.
240
234
 
241
235
  ### Report history
242
236
 
@@ -247,6 +241,7 @@ PageUp/PageDown scroll. Close or Escape closes history. Repeating the command
247
241
  returns to the newest report. History remains available with review disabled or
248
242
  invalid reviewer configuration. The history command preserves a hidden sidebar;
249
243
  clicking an approval notification reveals it and selects that permission's live or saved report.
244
+ Keyboard browsing also works with mouse tracking off.
250
245
 
251
246
  Each entry shows the original report, available usage, model, provider and outcome:
252
247
  **Auto approved**, **Manually approved**, **Cancelled**, or **Rejected**. Cancelled
@@ -256,20 +251,25 @@ native Allow once replies whose submitting client cannot be identified. History
256
251
  keeps the latest completed report, which can differ from the report that caused
257
252
  approval in another window.
258
253
 
259
- Normal-mode history cover preserves an ongoing countdown only on
260
- the root route, with physical proof of the history heading/footer and rendered
261
- report. A newly completed Safe review may become eligible under that same proof.
262
- Native dialogs, including the command palette, still cancel an active countdown;
263
- opening history afterward cannot restart it. Fast mode has no history-cover
264
- exception. Browsing saved reports never approves a request or replays notifications.
265
-
266
- Reports are saved only after a qualifying permission resolution. Saved reports
267
- can contain private text and are retained in OpenCode's local state directory
268
- unless deletion ownership is proven. A conversation deletion does not authorize
269
- purging reports without proven server/scope ownership. Uncertain offline deletions
270
- retain history; a missing list entry or bare 404 is not enough. Windows using the
271
- same state directory share this history, partitioned by host directory and root
272
- conversation. Uncommitted reports can be lost on shutdown or prolonged storage failure.
254
+ Opening report history does not hold normal or fast auto-approval for eligible live
255
+ requests. Browsing saved reports doesn't itself approve requests or replay notifications.
256
+
257
+ Reports are saved only after a permission resolution that qualifies for history.
258
+ They can contain private text and are kept under OpenCode's local state base:
259
+ `$XDG_STATE_HOME`, or `~/.local/state` when unset. Safely accessible history stays
260
+ under `opencode/opencode-reviewer/`. If the host directory is unsuitable for private
261
+ storage, the plugin uses its private, plugin-owned sibling
262
+ `opencode-reviewer-state/opencode-reviewer/` without changing host-directory permissions.
263
+ An existing safe sibling database remains in use across restarts. Conversation
264
+ enable/disable settings stay in the original OpenCode state directory.
265
+ Saved modes require private ownership and a nonreplaceable path; an untrusted or
266
+ unreadable mode suspends review rather than silently enabling it.
267
+ The plugin deletes them only when it can verify that a deleted conversation belongs
268
+ to the matching server and scope. If that can't be verified after an offline
269
+ deletion, it keeps the history; a missing list entry or bare 404 isn't enough.
270
+ Windows using the same state directory share history, grouped by host directory
271
+ and main conversation. Reports not yet saved can be lost on shutdown or during a
272
+ prolonged storage failure.
273
273
 
274
274
  ### Usage totals
275
275
 
@@ -432,7 +432,8 @@ Use Node.js 24.15.0+ within 24.x, or 22.22.2+ within 22.x, and npm.
432
432
  Run `npm ci --ignore-scripts`, then `npm run check` for typechecking, source tests,
433
433
  pure-helper tests and the build. `npm run test:helpers` runs the helper checks
434
434
  without building or starting OpenCode. Pull-request CI checks both Node versions
435
- and runs a separate representative Linux OpenCode 2.0.26 fixture profile.
435
+ and runs a separate representative Linux fixture profile on stock OpenCode
436
+ 2.0.26 and 2.0.27.
436
437
  After building, run `node scripts/test-runtime.mjs --profile ci` for that same
437
438
  profile. Use `node scripts/test-runtime.mjs --list` for the complete runtime
438
439
  inventory or `node scripts/test-runtime.mjs --plan --profile ci` for a
@@ -31,8 +31,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31
31
 
32
32
  https://github.com/anomalyco/opencode/tree/v2.0.26/packages/theme
33
33
 
34
- The pinned theme helper is bundled in the terminal payload. Solid and OpenTUI
35
- remain host-provided external dependencies.
34
+ The pinned theme syntax helper is bundled unchanged in the terminal payload.
35
+ A build-time adapter replaces its public barrel with a syntax-only re-export;
36
+ unused theme parsers, schemas and their Effect dependency are not bundled.
37
+ Solid and OpenTUI remain host-provided external dependencies.
36
38
 
37
39
  License source: https://github.com/anomalyco/opencode/blob/v2.0.26/LICENSE
38
40