opencode-azure-devops-pr-review 0.3.1 → 0.3.3
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/CHANGELOG.md +46 -0
- package/README.md +128 -86
- package/package.json +2 -11
- package/src/attribution.mjs +2 -4
- package/src/azure.mjs +5 -2
- package/src/host.mjs +28 -5
- package/src/runtime.mjs +13 -7
- package/src/session.mjs +6 -12
- package/AGENTS.md +0 -164
- package/CODE_OF_CONDUCT.md +0 -83
- package/CONTRIBUTING.md +0 -84
- package/SECURITY.md +0 -38
- package/config/settings.example.json +0 -55
- package/config/settings.schema.json +0 -316
- package/docs/ARCHITECTURE.md +0 -414
- package/docs/AZURE_DEVOPS.md +0 -217
- package/docs/COMMENTING.md +0 -399
- package/docs/DEBUGGING.md +0 -146
- package/docs/DEMO.md +0 -195
- package/docs/ENTERPRISE.md +0 -236
- package/docs/QUICKSTART.md +0 -238
- package/docs/RELEASING.md +0 -95
- package/docs/ROADMAP.md +0 -241
- package/docs/VALIDATION.md +0 -2127
- package/docs/VALIDATION_HISTORY.md +0 -1845
- package/docs/VERIFICATION.md +0 -42
- package/docs/assets/RECORDING.md +0 -131
- package/docs/assets/adjust-findings-teaser.gif +0 -0
- package/docs/assets/adjust-preview.png +0 -0
- package/docs/assets/adjust-publication.png +0 -0
- package/docs/assets/example-comments.md +0 -38
- package/docs/assets/generate-demo-gif.py +0 -25
- package/docs/assets/generate-demo.mjs +0 -141
- package/docs/assets/live-azure-readback.png +0 -0
- package/docs/assets/live-preview.png +0 -0
- package/docs/assets/live-review-teaser.gif +0 -0
- package/docs/assets/live-review.png +0 -0
- package/docs/assets/quick-review-demo.gif +0 -0
- package/docs/assets/record-terminal.py +0 -124
- package/docs/assets/render-terminal-demo.py +0 -168
- package/docs/assets/review-example.svg +0 -1
- package/docs/assets/walkthrough.svg +0 -1
- package/docs/releases/v0.1.0.md +0 -74
- package/docs/releases/v0.2.0.md +0 -107
- package/docs/releases/v0.2.1.md +0 -65
- package/docs/releases/v0.2.2.md +0 -76
- package/docs/releases/v0.2.3.md +0 -93
- package/docs/releases/v0.3.0.md +0 -125
- package/docs/releases/v0.3.1.md +0 -87
- package/install.sh +0 -171
- package/scripts/merge-settings.py +0 -120
- package/uninstall.sh +0 -50
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,51 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.3 — 2026-10-31
|
|
4
|
+
|
|
5
|
+
- AZPR is tested with OpenCode 2.2.4 instead of 2.1.4. The runtime needed no
|
|
6
|
+
change: on both hosts the same review sends byte-identical model requests.
|
|
7
|
+
Upgrading OpenCode migrates its database irreversibly; stop the service and
|
|
8
|
+
back up `opencode.db` first.
|
|
9
|
+
- `/pr-check` names the OpenCode version in a row of its own and warns when it
|
|
10
|
+
is not the tested one; reviews still run. Receipts no longer end with a
|
|
11
|
+
host notice.
|
|
12
|
+
- A used-up usage or spend limit stops the stage at once: AZPR refuses
|
|
13
|
+
OpenCode's retries and starts no new session, and the receipt names the
|
|
14
|
+
limit. This covers OpenCode 2.2.3's ChatGPT and OpenCode Go usage limits and
|
|
15
|
+
OpenCode's spend limits besides the provider quota and the free-model limit;
|
|
16
|
+
before, a used-up ChatGPT limit was retried as a rate limit.
|
|
17
|
+
- AZPR subscribes only to the session events that show a review progressing;
|
|
18
|
+
OpenCode 2.2.0 and later deliver no others.
|
|
19
|
+
- On OpenCode 2.2.4, `NO_PROXY` always lists `127.0.0.1`, `localhost` and
|
|
20
|
+
`::1`, and Bun honours `NO_PROXY` even for `azure.proxy`. Azure DevOps is
|
|
21
|
+
unaffected; the company-network guide now says to keep `dev.azure.com` out of
|
|
22
|
+
`NO_PROXY` when it must use the proxy. Test-only Azure DevOps base URLs may
|
|
23
|
+
use any 127.0.0.0/8 address, so the proxy scenario can still be tested.
|
|
24
|
+
- The host smoke test adds a foreign MCP server behind CodeMode and an image
|
|
25
|
+
model, and checks that private reviewers see neither those tools nor image
|
|
26
|
+
generation while ordinary sessions keep them.
|
|
27
|
+
|
|
28
|
+
## 0.3.2 — 2026-10-30
|
|
29
|
+
|
|
30
|
+
- The README starts with actual Azure DevOps output: an inline comment with its
|
|
31
|
+
code context and, in an expandable section, the complete PR summary from the
|
|
32
|
+
same review. The first-review steps come before the 15-second recording, and
|
|
33
|
+
a documentation table points to the guide for each task. The demo records how
|
|
34
|
+
the screenshots were captured and edited, and lists the pictured comment
|
|
35
|
+
bodies as text.
|
|
36
|
+
- Receipts say that COMPLETE means no source-commit change was detected. A
|
|
37
|
+
final version recheck that fails adds a warning and leaves the review
|
|
38
|
+
COMPLETE; publication still rechecks the PR before posting.
|
|
39
|
+
- The npm package contains only the runtime, README, changelog and license:
|
|
40
|
+
32 files and about 170 KB instead of 76 files and 1.35 MB. Documentation,
|
|
41
|
+
media, installers, the settings example and schema and the repository guides
|
|
42
|
+
remain in the repository and the source archive; npmjs.com shows the
|
|
43
|
+
README's links and images from GitHub.
|
|
44
|
+
- The README and architecture guide list the commands that answer without a
|
|
45
|
+
background run, the README and commenting guide state that repeating the
|
|
46
|
+
saved adjustments plans nothing, and the architecture guide counts AZPR's
|
|
47
|
+
six tools.
|
|
48
|
+
|
|
3
49
|
## 0.3.1 — 2026-10-27
|
|
4
50
|
|
|
5
51
|
- Installation and upgrades are documented as they behave on OpenCode 2.1.4:
|
package/README.md
CHANGED
|
@@ -3,58 +3,42 @@
|
|
|
3
3
|
[](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/actions/workflows/ci.yml?query=branch%3Amain)
|
|
4
4
|
[](https://www.npmjs.com/package/opencode-azure-devops-pr-review)
|
|
5
5
|
[](LICENSE)
|
|
6
|
-
[](docs/VALIDATION.md)
|
|
7
7
|
|
|
8
8
|
**Review Azure DevOps pull requests from a URL. No checkout required.**
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
leave out findings or change their severity, and publish when you are ready.
|
|
13
|
-
No MCP server or CI pipeline setup is required.
|
|
10
|
+
Use your own OpenCode models to review code, inspect the proposed comments,
|
|
11
|
+
and choose what gets published. No MCP server or CI pipeline setup is required.
|
|
14
12
|
|
|
15
13
|
AZPR is an independent community project. It is not built by or affiliated with
|
|
16
14
|
the OpenCode team.
|
|
17
15
|
|
|
18
|
-
[Get started](
|
|
19
|
-
[
|
|
20
|
-
[Validation and limitations](docs/VALIDATION.md) ·
|
|
21
|
-
[Download v0.3.1](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/releases/tag/v0.3.1)
|
|
16
|
+
[Get started](#your-first-review) · [15-second recording](#watch-the-workflow) ·
|
|
17
|
+
[Full demo](docs/DEMO.md) · [Documentation](#documentation)
|
|
22
18
|
|
|
23
|
-
|
|
19
|
+
## See the review in Azure DevOps
|
|
24
20
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
[73-second walkthrough](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/releases/download/v0.2.0/azpr-live-demo.mp4)
|
|
29
|
-
of a review, preview and publication.*
|
|
21
|
+
Findings include a source location, evidence and a suggested fix. Preview the
|
|
22
|
+
planned comments in OpenCode, then publish them as inline comments and a PR
|
|
23
|
+
summary.
|
|
30
24
|
|
|
31
|
-
|
|
25
|
+
[](docs/assets/azure-inline-review.png)
|
|
32
26
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
roles. Keep a stronger model profile for selected PRs with `/pr-deep`.
|
|
49
|
-
- **Configure the Azure connection for your network.** Set a forward proxy and
|
|
50
|
-
additional CA certificates for AZPR's Azure DevOps requests. Model-provider
|
|
51
|
-
connections remain configured in OpenCode.
|
|
52
|
-
|
|
53
|
-
Content search downloads a bounded repository archive into memory; source
|
|
54
|
-
context is sent through your selected model providers, and review records are
|
|
55
|
-
saved locally. See [content-search limits](docs/AZURE_DEVOPS.md#who-calls-what)
|
|
56
|
-
for archive and file-size bounds, and [team setup and data handling](docs/ENTERPRISE.md)
|
|
57
|
-
for proxy authentication and retention.
|
|
27
|
+
*Actual output on a dedicated test PR with seeded defects, from a different run
|
|
28
|
+
than the recording below. The image joins cropped excerpts of the diff and the
|
|
29
|
+
comment, with identifying UI removed; code and review text are unchanged. It
|
|
30
|
+
shows the output format, not review accuracy. Click the image to enlarge, or
|
|
31
|
+
[read the pictured comments and capture details](docs/DEMO.md#actual-azure-devops-comments).*
|
|
32
|
+
|
|
33
|
+
<details>
|
|
34
|
+
<summary>See the complete PR summary from the same review</summary>
|
|
35
|
+
|
|
36
|
+
[](docs/assets/azure-review-summary.png)
|
|
37
|
+
|
|
38
|
+
The summary keeps the full finding index in one place. Like the image above, it
|
|
39
|
+
is an actual capture excerpt with identifying UI removed and its text unchanged.
|
|
40
|
+
|
|
41
|
+
</details>
|
|
58
42
|
|
|
59
43
|
## Your first review
|
|
60
44
|
|
|
@@ -63,7 +47,7 @@ for proxy authentication and retention.
|
|
|
63
47
|
[company networks](docs/ENTERPRISE.md#company-networks) first):
|
|
64
48
|
|
|
65
49
|
```sh
|
|
66
|
-
opencode plugin add opencode-azure-devops-pr-review@0.3.
|
|
50
|
+
opencode plugin add opencode-azure-devops-pr-review@0.3.3
|
|
67
51
|
```
|
|
68
52
|
|
|
69
53
|
2. Follow the [quickstart](docs/QUICKSTART.md) to save your PAT in a private
|
|
@@ -81,6 +65,11 @@ before starting the review; it uses no model. The review runs functional and ris
|
|
|
81
65
|
reviewers, then separate verification. If the completed review has findings to
|
|
82
66
|
comment on, `--preview` prepares their comments in a separate, cancellable run.
|
|
83
67
|
**Nothing is posted by these commands.** Previewing comments also uses a model.
|
|
68
|
+
For a lighter first pass, use `/pr-quick <PR URL> --preview`; its findings are
|
|
69
|
+
not independently verified.
|
|
70
|
+
|
|
71
|
+
<details>
|
|
72
|
+
<summary>Optional: adjust findings and publish after reading the preview</summary>
|
|
84
73
|
|
|
85
74
|
Read the report and preview. Before publishing, you can exclude a finding or
|
|
86
75
|
change its severity using IDs from your report, for example:
|
|
@@ -102,8 +91,39 @@ preview as the PAT owner and skips matching comments AZPR already posted. It
|
|
|
102
91
|
never edits them; for an adjusted review, the receipt identifies those whose
|
|
103
92
|
text differs from the new preview. See
|
|
104
93
|
[adjusting findings](#adjusting-findings-after-a-preview) for how repeating an
|
|
105
|
-
option replaces its earlier list.
|
|
106
|
-
|
|
94
|
+
option replaces its earlier list.
|
|
95
|
+
|
|
96
|
+
</details>
|
|
97
|
+
|
|
98
|
+
## Why AZPR?
|
|
99
|
+
|
|
100
|
+
- **Control what gets posted.** Read a preview, exclude findings or change
|
|
101
|
+
severity, then inspect the newly planned comments. The original review stays
|
|
102
|
+
intact. Publication rechecks the PR head, skips matching comments and reads
|
|
103
|
+
new comments back; automatic publication is opt-in.
|
|
104
|
+
- **Read beyond the diff.** Reviewers can follow definitions, callers and
|
|
105
|
+
tests at the selected PR commit, without a local checkout or an Azure Code
|
|
106
|
+
Search index.
|
|
107
|
+
- **Give findings a separate check.** Functional and risk reviewers propose
|
|
108
|
+
findings; verifier sessions re-read the source and look for counterevidence.
|
|
109
|
+
Quick mode skips that independent check for a lighter pass.
|
|
110
|
+
- **Use the models you already have.** Assign models per role, use one model
|
|
111
|
+
for all roles, or configure stronger models for selected PRs with `/pr-deep`.
|
|
112
|
+
|
|
113
|
+
For company networks, configure a proxy and additional CA certificates for
|
|
114
|
+
AZPR's Azure requests; model-provider connections stay in OpenCode. Content
|
|
115
|
+
search downloads a bounded repository archive into memory, source context goes
|
|
116
|
+
to your selected model providers, and review records are saved locally. See
|
|
117
|
+
[team setup and data handling](docs/ENTERPRISE.md) and
|
|
118
|
+
[content-search limits](docs/AZURE_DEVOPS.md#who-calls-what).
|
|
119
|
+
|
|
120
|
+
## Watch the workflow
|
|
121
|
+
|
|
122
|
+
[](docs/DEMO.md#adjust-findings-before-publishing)
|
|
123
|
+
|
|
124
|
+
*A 15-second edit of a real OpenCode 2.1.4 session on a dedicated test PR.
|
|
125
|
+
Waiting time is shortened, so the length is not the review duration.
|
|
126
|
+
[Recording details and longer walkthrough](docs/DEMO.md).*
|
|
107
127
|
|
|
108
128
|
## Choose a review
|
|
109
129
|
|
|
@@ -151,7 +171,7 @@ general review-accuracy score.
|
|
|
151
171
|
|
|
152
172
|
| Component | Tested target |
|
|
153
173
|
| --- | --- |
|
|
154
|
-
| OpenCode | **OpenCode CLI 2.
|
|
174
|
+
| OpenCode | **OpenCode CLI 2.2.4** (`@opencode/cli`; V2 plugin API). On another OpenCode 2.x, `/pr-check` shows an OpenCode WARNING row and reviews still run. OpenCode 1.x is not supported. |
|
|
155
175
|
| Operating system | **Ubuntu 22.04** (validation environment: WSL2). Other operating systems are not yet validated. |
|
|
156
176
|
| Azure | **Azure DevOps Services**, REST API **7.1**. Azure DevOps Server is not supported by the current URL handling. |
|
|
157
177
|
| Installation | OpenCode's plugin manager with the npm package or the versioned Git package, or the source installer with POSIX `sh` and Python 3; no plugin build step or npm dependencies. |
|
|
@@ -162,6 +182,18 @@ same runtime. A fresh installation exposes `/pr-setup` before
|
|
|
162
182
|
reviewing is enabled; the [quickstart](docs/QUICKSTART.md) configures one model
|
|
163
183
|
for both quick and verified reviews.
|
|
164
184
|
|
|
185
|
+
## Documentation
|
|
186
|
+
|
|
187
|
+
| I want to… | Start here |
|
|
188
|
+
| --- | --- |
|
|
189
|
+
| Install AZPR and run a first review | [Step-by-step quickstart](docs/QUICKSTART.md) |
|
|
190
|
+
| Upgrade an existing installation | [Upgrade instructions](#upgrading) |
|
|
191
|
+
| Choose models, language or settings | [Configuration](#configuration) |
|
|
192
|
+
| Adjust, preview or publish comments | [Commenting guide](docs/COMMENTING.md) |
|
|
193
|
+
| Set up a company proxy or understand data handling | [Team setup](docs/ENTERPRISE.md) |
|
|
194
|
+
| Understand what has been tested | [Validation and limitations](docs/VALIDATION.md) |
|
|
195
|
+
| Troubleshoot or contribute | [Debugging](docs/DEBUGGING.md) · [Contributing](CONTRIBUTING.md) |
|
|
196
|
+
|
|
165
197
|
## How reviews work
|
|
166
198
|
|
|
167
199
|
<details>
|
|
@@ -207,9 +239,12 @@ regressions that the everyday model missed, at many times its cost and time
|
|
|
207
239
|
(see [deep versus review](docs/VALIDATION.md#deep-versus-review-2026-10-19)).
|
|
208
240
|
`/pr-check` says when `/pr-deep` is off or its models repeat the review models.
|
|
209
241
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
242
|
+
Readiness checks, reviews, comment planning, adjustments and publication
|
|
243
|
+
acknowledge `STARTED` and continue in the current OpenCode process; short
|
|
244
|
+
`PROGRESS` notices and a final receipt return to the invoking conversation. Use
|
|
245
|
+
the displayed `/pr-stop <run-id>` to cancel. `/pr-setup` (including `--help`),
|
|
246
|
+
`/pr-stop`, `/pr-comment --show`, an adjustment that changes nothing and a
|
|
247
|
+
refused command answer directly, without a background run.
|
|
213
248
|
Completed reviews, previews and publication ledgers are saved privately and
|
|
214
249
|
survive an OpenCode restart.
|
|
215
250
|
|
|
@@ -228,17 +263,17 @@ Azure DevOps REST API with the runtime's built-in `fetch`.
|
|
|
228
263
|
Install the npm package with OpenCode's plugin manager:
|
|
229
264
|
|
|
230
265
|
```sh
|
|
231
|
-
opencode plugin add opencode-azure-devops-pr-review@0.3.
|
|
266
|
+
opencode plugin add opencode-azure-devops-pr-review@0.3.3
|
|
232
267
|
```
|
|
233
268
|
|
|
234
269
|
The same release is also a versioned Git package, which needs Git but not the
|
|
235
270
|
npm registry:
|
|
236
271
|
|
|
237
272
|
```sh
|
|
238
|
-
opencode plugin add 'github:WTLAIB/opencode-azure-devops-pr-review-v2#v0.3.
|
|
273
|
+
opencode plugin add 'github:WTLAIB/opencode-azure-devops-pr-review-v2#v0.3.3'
|
|
239
274
|
```
|
|
240
275
|
|
|
241
|
-
Add only one of them. OpenCode 2.
|
|
276
|
+
Add only one of them. OpenCode 2.2.4 loads the plugin into a running OpenCode
|
|
242
277
|
service within a few seconds; if `/pr-setup` does not appear in a new
|
|
243
278
|
conversation, run `opencode service restart`. Then run `/pr-setup` for setup
|
|
244
279
|
instructions. Native packages
|
|
@@ -249,7 +284,7 @@ To select another configuration file, use an absolute path in the host config:
|
|
|
249
284
|
```json
|
|
250
285
|
{
|
|
251
286
|
"plugins": [{
|
|
252
|
-
"package": "opencode-azure-devops-pr-review@0.3.
|
|
287
|
+
"package": "opencode-azure-devops-pr-review@0.3.3",
|
|
253
288
|
"options": { "settingsFile": "/absolute/path/to/azpr/settings.json" }
|
|
254
289
|
}]
|
|
255
290
|
}
|
|
@@ -268,13 +303,13 @@ with a new version adds a second entry**: OpenCode keeps running the version
|
|
|
268
303
|
listed first and reports the new one as `Duplicate plugin ID: azpr` (from
|
|
269
304
|
0.3.1, `/pr-check` also warns about it). Upgrade when no AZPR command is
|
|
270
305
|
running, since
|
|
271
|
-
OpenCode 2.
|
|
306
|
+
OpenCode 2.2.4 replaces the running plugin as soon as its entry changes.
|
|
272
307
|
|
|
273
308
|
For an entry that `opencode plugin add` created, add the new version and,
|
|
274
309
|
only when that succeeds, remove the previous one:
|
|
275
310
|
|
|
276
311
|
```sh
|
|
277
|
-
opencode plugin add opencode-azure-devops-pr-review@0.3.
|
|
312
|
+
opencode plugin add opencode-azure-devops-pr-review@0.3.3 &&
|
|
278
313
|
opencode plugin remove opencode-azure-devops-pr-review@PREVIOUS_VERSION
|
|
279
314
|
```
|
|
280
315
|
|
|
@@ -297,7 +332,7 @@ configuration needs no new `/pr-setup`. `opencode plugin list` should then
|
|
|
297
332
|
show a single `azpr` row with the new version (from 0.3.1, `/pr-check` names
|
|
298
333
|
it too); if it still shows the previous one, run `opencode service restart`.
|
|
299
334
|
Exact versions stay pinned, so `opencode plugin update` leaves them unchanged.
|
|
300
|
-
See the [0.3.
|
|
335
|
+
See the [0.3.3 release notes](docs/releases/v0.3.3.md) for what changed and the
|
|
301
336
|
[0.2.0 release notes](docs/releases/v0.2.0.md) for automatic comments, which
|
|
302
337
|
remain disabled unless you configure `afterReview` or request them with a
|
|
303
338
|
review command flag.
|
|
@@ -307,8 +342,8 @@ review command flag.
|
|
|
307
342
|
<details>
|
|
308
343
|
<summary>Source installation and replacement</summary>
|
|
309
344
|
|
|
310
|
-
Download the [v0.3.
|
|
311
|
-
and extract it, or check out tag `v0.3.
|
|
345
|
+
Download the [v0.3.3 source archive](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/archive/refs/tags/v0.3.3.tar.gz)
|
|
346
|
+
and extract it, or check out tag `v0.3.3`. The installer needs POSIX `sh` and
|
|
312
347
|
Python 3's standard library. From that source directory:
|
|
313
348
|
|
|
314
349
|
```sh
|
|
@@ -463,14 +498,14 @@ every concrete defect it finds, in any area, as a finding.
|
|
|
463
498
|
| `azure.concurrency` | `3` simultaneous Azure DevOps calls across all AZPR commands. |
|
|
464
499
|
| `azure.callTimeoutSeconds` | `120`; a hung call is aborted and its slot released (reads are retried). |
|
|
465
500
|
| `azure.archiveMegabytes` | `100` (1–1024): the largest repository zip that content search downloads per run and commit; a larger repository is not searched. It is held in memory during a review. |
|
|
466
|
-
| `azure.proxy` | `""`: no AZPR proxy (`HTTPS_PROXY` and `NO_PROXY` in OpenCode's environment still apply). A forward proxy for AZPR's Azure DevOps calls only, such as `http://proxy.example.com:8080`; credentials go in the URL as `http://user:password@host:port` (percent-encoded) and are never shown. See [proxies](docs/AZURE_DEVOPS.md#proxies-and-tls-inspection). |
|
|
501
|
+
| `azure.proxy` | `""`: no AZPR proxy (`HTTPS_PROXY` and `NO_PROXY` in OpenCode's environment still apply; a host in `NO_PROXY` bypasses a set proxy too). A forward proxy for AZPR's Azure DevOps calls only, such as `http://proxy.example.com:8080`; credentials go in the URL as `http://user:password@host:port` (percent-encoded) and are never shown. See [proxies](docs/AZURE_DEVOPS.md#proxies-and-tls-inspection). |
|
|
467
502
|
| `azure.caFile` | `""`. The absolute path of a PEM file with CA certificates AZPR trusts in addition to the built-in roots, for a proxy that inspects HTTPS. |
|
|
468
503
|
| `azure.verifyTls` | `true`. `false` skips certificate checks for AZPR's Azure DevOps calls (like `curl -k`), so anyone who can intercept the connection can read the PAT; prefer `azure.caFile`. `/pr-check` warns while it is off. |
|
|
469
504
|
| `workflow.shardFiles` | `25` changed files per initial-review session. |
|
|
470
505
|
| `workflow.shardFindings` | At most `15` findings per verification session; one file's findings stay in the same session (a file is split only when it alone has more). |
|
|
471
506
|
| `workflow.parallelSessions` | `4` reviewer sessions at once within a command; comment planning runs at most two pages at once (one when this is `1`). |
|
|
472
507
|
| `workflow.repairAttempts` | `2` correction turns when an answer breaks the output contract. A quick review's one follow-up turn for unfinished work uses the same budget. |
|
|
473
|
-
| `workflow.stageRetries` | `1` new-session retry after a transient failure (provider 429/5xx, interrupted stream) or an inactivity stop. A used-up provider quota or OpenCode free-model limit is named and not retried, whatever its status. |
|
|
508
|
+
| `workflow.stageRetries` | `1` new-session retry after a transient failure (provider 429/5xx, interrupted stream) or an inactivity stop. A used-up usage or spend limit (provider quota, ChatGPT or OpenCode Go usage limit, OpenCode free-model or spend limit) is named and not retried, whatever its status, and AZPR refuses OpenCode's own retries of it. |
|
|
474
509
|
| `workflow.stageIdleSeconds` | `600` (`0` turns it off, otherwise 60–7200): a reviewer stage that shows no activity this long while it waits on OpenCode (the model stream, a tool or the host stopped responding) is stopped with `failure=idle` and an error naming its last activity, then retried in a new session. Every model request, streamed chunk of output, tool start or end and announced host retry restarts the window, so a stage that keeps working, including a long answer that keeps streaming, is never cut. With shell allowed, an approval or a command that takes longer counts as inactivity. |
|
|
475
510
|
| `debug.enabled` / `debug.directory` / `debug.keepRuns` | `false` / `""` / `20` run directories kept (`0` keeps all); see [debugging](docs/DEBUGGING.md). |
|
|
476
511
|
|
|
@@ -546,9 +581,9 @@ only. PR content, comments and tool responses are untrusted data.
|
|
|
546
581
|
|
|
547
582
|
Status meanings:
|
|
548
583
|
|
|
549
|
-
- **COMPLETE**: verification produced structured decisions and
|
|
550
|
-
|
|
551
|
-
are never posted. Only COMPLETE reviews can be commented on.
|
|
584
|
+
- **COMPLETE**: verification produced structured decisions and no source-commit
|
|
585
|
+
change was detected. Findings without a usable decision are listed as
|
|
586
|
+
UNREVIEWED and are never posted. Only COMPLETE reviews can be commented on.
|
|
552
587
|
- **STALE**: the PR source commit changed during the review; run a new one.
|
|
553
588
|
- **PARTIAL**: no verification session produced a structured result; initial
|
|
554
589
|
observations are shown for reference only.
|
|
@@ -558,19 +593,24 @@ Status meanings:
|
|
|
558
593
|
A quick review states its status, coverage and verification separately; its
|
|
559
594
|
receipt starts like `[AZPR 1a2b3c4d] COMPLETE; coverage incomplete;
|
|
560
595
|
verification none (quick review)`. COMPLETE means at least one shard produced a
|
|
561
|
-
usable result (a parsed answer is not enough) and
|
|
562
|
-
its findings are REPORTED when they passed the runtime's checks
|
|
563
|
-
location that exists at that commit, a file the session read) and
|
|
564
|
-
otherwise, and only REPORTED ones can be commented on. Coverage says
|
|
565
|
-
every changed file was reviewed, so zero findings never hide unreviewed
|
|
566
|
-
A quick reviewer whose answer is PARTIAL and names unfinished work is
|
|
567
|
-
once, in the same session, to continue (receipt `follow-up=completed`,
|
|
596
|
+
usable result (a parsed answer is not enough) and no source-commit change was
|
|
597
|
+
detected; its findings are REPORTED when they passed the runtime's checks
|
|
598
|
+
(fields, a location that exists at that commit, a file the session read) and
|
|
599
|
+
NEEDS_INFO otherwise, and only REPORTED ones can be commented on. Coverage says
|
|
600
|
+
whether every changed file was reviewed, so zero findings never hide unreviewed
|
|
601
|
+
files. A quick reviewer whose answer is PARTIAL and names unfinished work is
|
|
602
|
+
asked once, in the same session, to continue (receipt `follow-up=completed`,
|
|
568
603
|
`still-partial`, `unusable` or `failed`); a follow-up that fails or gives no
|
|
569
604
|
usable answer keeps the answer it followed. When the quick review found a
|
|
570
605
|
high-severity issue or left coverage incomplete, the receipt suggests
|
|
571
606
|
`/pr-review` before publishing; the hint is advisory, also when automatic
|
|
572
607
|
publication follows (see [automatic comments](#automatic-comments)).
|
|
573
608
|
|
|
609
|
+
A failed final version recheck adds a warning; it does not by itself prevent
|
|
610
|
+
COMPLETE in any review mode. Read the receipt warnings. Publication separately
|
|
611
|
+
rechecks that the PR is active and its source commit is unchanged before
|
|
612
|
+
posting.
|
|
613
|
+
|
|
574
614
|
## Comments
|
|
575
615
|
|
|
576
616
|
`/pr-comment` plans one general summary plus inline comments for confirmed high
|
|
@@ -597,20 +637,22 @@ its severity, then read the new preview:
|
|
|
597
637
|
/pr-comment <review-id> --exclude F-1 --severity F-2=low
|
|
598
638
|
```
|
|
599
639
|
|
|
600
|
-
|
|
601
|
-
one command when you use both.
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
640
|
+
Changed adjustments trigger new model planning when findings remain, so
|
|
641
|
+
combine both options in one command when you use both. Repeating the saved
|
|
642
|
+
adjustments changes nothing and does not plan again. Comments are planned
|
|
643
|
+
without the excluded findings and with the new severities, so their wording
|
|
644
|
+
may change; the summary index follows them, and nothing on the PR mentions the
|
|
645
|
+
adjustment. Each option replaces its whole saved list: `--exclude F-1` and then
|
|
646
|
+
`--exclude F-2` excludes only F-2. A changed severity changes how a finding is
|
|
647
|
+
published, not the finding itself; when a finding is wrong, exclude it.
|
|
648
|
+
Excluding every finding posts nothing. `--reset` clears the adjustments, and
|
|
649
|
+
`/pr-comment <review-id> --show` shows the saved preview without a model. An
|
|
650
|
+
adjusted review is posted only from the preview planned after its latest
|
|
651
|
+
adjustment; once its publication has started, it is neither adjusted nor
|
|
652
|
+
planned again. Comments that an earlier publication put on the PR are never
|
|
653
|
+
changed: they are skipped as always, and the receipt of an adjusted review
|
|
654
|
+
names those whose text differs from the preview. See
|
|
655
|
+
[adjusting findings](docs/COMMENTING.md#adjusting-findings-after-a-preview).
|
|
614
656
|
|
|
615
657
|
### Automatic comments
|
|
616
658
|
|
|
@@ -719,8 +761,8 @@ and a loopback fake Azure DevOps REST service in disposable directories under
|
|
|
719
761
|
Uninstall without `--apply` previews; `--apply` archives only this package under
|
|
720
762
|
`azpr-v2-backups` and leaves the private state directory for you to delete.
|
|
721
763
|
For a native installation, remove the entry you added, for example
|
|
722
|
-
`opencode plugin remove opencode-azure-devops-pr-review@0.3.
|
|
723
|
-
`opencode plugin remove 'github:WTLAIB/opencode-azure-devops-pr-review-v2#v0.3.
|
|
764
|
+
`opencode plugin remove opencode-azure-devops-pr-review@0.3.3` or
|
|
765
|
+
`opencode plugin remove 'github:WTLAIB/opencode-azure-devops-pr-review-v2#v0.3.3'`;
|
|
724
766
|
the external settings, PAT file and private review state remain available.
|
|
725
767
|
|
|
726
768
|
[Architecture](docs/ARCHITECTURE.md), [commenting](docs/COMMENTING.md),
|
|
@@ -733,7 +775,7 @@ or personal model selections.
|
|
|
733
775
|
## License and releases
|
|
734
776
|
|
|
735
777
|
[MIT](LICENSE), copyright 2026 WTLAIB. See the [changelog](CHANGELOG.md) for the
|
|
736
|
-
release scope, [v0.3.
|
|
778
|
+
release scope, [v0.3.3](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/releases/tag/v0.3.3)
|
|
737
779
|
for downloads, the [npm package](https://www.npmjs.com/package/opencode-azure-devops-pr-review),
|
|
738
780
|
[v0.2.0](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/releases/tag/v0.2.0)
|
|
739
781
|
for the recorded demonstration, and [releasing](docs/RELEASING.md) for the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-azure-devops-pr-review",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Azure DevOps PR reviews from a URL in OpenCode, with no checkout, configurable models, separate verification, and comment previews you can adjust before posting",
|
|
6
6
|
"scripts": {
|
|
@@ -34,18 +34,9 @@
|
|
|
34
34
|
"files": [
|
|
35
35
|
"server.js",
|
|
36
36
|
"src/",
|
|
37
|
-
"config/",
|
|
38
|
-
"scripts/merge-settings.py",
|
|
39
|
-
"install.sh",
|
|
40
|
-
"uninstall.sh",
|
|
41
37
|
"README.md",
|
|
42
38
|
"CHANGELOG.md",
|
|
43
|
-
"LICENSE"
|
|
44
|
-
"docs/",
|
|
45
|
-
"AGENTS.md",
|
|
46
|
-
"CONTRIBUTING.md",
|
|
47
|
-
"CODE_OF_CONDUCT.md",
|
|
48
|
-
"SECURITY.md"
|
|
39
|
+
"LICENSE"
|
|
49
40
|
],
|
|
50
41
|
"publishConfig": {
|
|
51
42
|
"access": "public"
|
package/src/attribution.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ROLES } from './config.mjs';
|
|
2
|
-
import { TESTED_HOST_VERSION } from './host.mjs';
|
|
3
2
|
// Deterministic attribution from invoked reviewer stages, not model-authored claims.
|
|
4
3
|
const vocabulary = {
|
|
5
4
|
en: { title: 'AI review provenance', disclaimer: 'AI-generated review, not human approval. Posting through a user account does not imply that person verified these conclusions.', method: 'Independent initial reviews, followed by source-based verification, duplicate merging, and rejection of unsupported findings; not majority voting.', roles: ['Source check', 'Functional review', 'Risk review', 'Verification', 'Duplicate check', 'Quick review'], stage: 'Stage', model: 'Selected provider/model ID', sessions: 'Sessions', count: 'Initial findings', dispositions: 'Finding dispositions', finding: 'Finding', result: 'Result', merged: 'Merged into', extra: 'New verifier findings', note: 'IDs identify the models selected in OpenCode, not independently verified provider backend identities. Host auxiliary models and the original chat model are not part of this ledger.', comment: 'AI-generated review; not human review or approval. Models:',
|
|
@@ -273,14 +272,13 @@ export function renderReceipt(run, report, status, error, settings) {
|
|
|
273
272
|
? '\nIncomplete draft notice: the quick review did not complete; its observations are unconfirmed and not input for PR comments.\n'
|
|
274
273
|
: '\nIncomplete draft notice: initial observations are unconfirmed because verification did not complete; they are not input for PR comments.\n';
|
|
275
274
|
body += renderDiagnosticNotices(run);
|
|
276
|
-
if (run.compatibility && !run.compatibility.tested && run.compatibility.version !== 'unknown') body += `\nHost notice: OpenCode ${run.compatibility.version} differs from the tested ${TESTED_HOST_VERSION}; capabilities were detected at runtime.\n`;
|
|
277
275
|
body += run.mode === 'check'
|
|
278
276
|
? '\nStatus: READY means AZPR can read the PR through the Azure DevOps REST API; it does not review or approve the PR.\n'
|
|
279
277
|
: run.mode === 'comment'
|
|
280
278
|
? ''
|
|
281
279
|
: run.mode === 'quick'
|
|
282
|
-
? '\nStatus: COMPLETE means at least one quick review session produced a usable result and
|
|
283
|
-
: '\nStatus: COMPLETE means verification produced structured decisions and
|
|
280
|
+
? '\nStatus: COMPLETE means at least one quick review session produced a usable result and no source-commit change was detected. Quick findings are not independently verified: the runtime checked only their form and source, and findings that failed those checks are NEEDS_INFO. Coverage says whether every changed file was reviewed. STALE means the PR source commit changed during the review. PARTIAL means no session produced a usable result. None of these approves the PR.\n'
|
|
281
|
+
: '\nStatus: COMPLETE means verification produced structured decisions and no source-commit change was detected; findings without a usable decision are listed as UNREVIEWED. STALE means the PR source commit changed during the review. PARTIAL keeps unverified results. None of these approves the PR.\n';
|
|
284
282
|
if (run.mode === 'quick' && status === 'COMPLETE' && run.quickSummary && (run.quickSummary.high > 0 || !run.quickSummary.coverage?.complete)) {
|
|
285
283
|
const hint = [run.quickSummary.high > 0 ? `${run.quickSummary.high} high-severity finding(s)` : '', !run.quickSummary.coverage?.complete ? 'incomplete coverage' : ''].filter(Boolean).join(' and ');
|
|
286
284
|
// Automatic publication follows the user's explicit choice; the hint stays advisory.
|
package/src/azure.mjs
CHANGED
|
@@ -105,14 +105,17 @@ export function targetKey(target) {
|
|
|
105
105
|
|
|
106
106
|
/**
|
|
107
107
|
* A REST base URL other than dev.azure.com is accepted only for loopback test
|
|
108
|
-
* servers, so a mistaken override can never send the PAT to another host.
|
|
108
|
+
* servers, so a mistaken override can never send the PAT to another host. All
|
|
109
|
+
* of 127.0.0.0/8 is loopback: OpenCode 2.2.4 adds 127.0.0.1, localhost and ::1
|
|
110
|
+
* to NO_PROXY, and Bun then bypasses even an explicit proxy, so a proxied test
|
|
111
|
+
* server needs another loopback address.
|
|
109
112
|
*/
|
|
110
113
|
export function restBaseUrl(override) {
|
|
111
114
|
if (override === undefined || override === null || override === '') return DEFAULT_BASE_URL;
|
|
112
115
|
let url;
|
|
113
116
|
try { url = new URL(override); } catch { throw new Error('[AZPR] The Azure DevOps test base URL is not a valid URL.'); }
|
|
114
117
|
if (!['http:', 'https:'].includes(url.protocol) || url.username || url.password || url.search || url.hash ||
|
|
115
|
-
!
|
|
118
|
+
!(url.hostname === 'localhost' || url.hostname === '[::1]' || /^127(?:\.\d{1,3}){3}$/.test(url.hostname))) {
|
|
116
119
|
throw new Error('[AZPR] An Azure DevOps base URL override must be a loopback test server.');
|
|
117
120
|
}
|
|
118
121
|
return url.href.replace(/\/+$/, '');
|
package/src/host.mjs
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* constant and response normalization lives here so an upgrade has one place
|
|
7
7
|
* to adjust.
|
|
8
8
|
*/
|
|
9
|
-
export const TESTED_HOST_VERSION = '2.
|
|
9
|
+
export const TESTED_HOST_VERSION = '2.2.4';
|
|
10
10
|
|
|
11
|
-
// Text OpenCode (2.0.32 through 2.
|
|
11
|
+
// Text OpenCode (2.0.32 through 2.2.4) queues after resuming an interrupted text stream.
|
|
12
12
|
export const HOST_CONTINUATION_TEXT = 'The previous response was interrupted. Continue from where you left off without repeating completed content.';
|
|
13
13
|
|
|
14
14
|
// Context message types that mean someone other than the admitted prompt
|
|
@@ -57,7 +57,7 @@ export function packageNamed(target, name, repository) {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
|
-
* This plugin's entries in the host's plugin list. OpenCode 2.1.4
|
|
60
|
+
* This plugin's entries in the host's plugin list. OpenCode 2.1.4 through 2.2.4 list
|
|
61
61
|
* { id?, source: { type: package|local|builtin|sdk, target?, version? },
|
|
62
62
|
* state: { status: active|failed, error? } } and keeps only the first entry
|
|
63
63
|
* of a plugin ID: a second one is listed as failed with "Duplicate plugin ID".
|
|
@@ -93,7 +93,7 @@ export function pluginSourceLabel(source) {
|
|
|
93
93
|
|
|
94
94
|
/**
|
|
95
95
|
* Session events that show a turn progressing while no hook runs. OpenCode
|
|
96
|
-
* 2.1.2
|
|
96
|
+
* 2.1.2 through 2.2.4 emit one delta event per streamed chunk of answer text,
|
|
97
97
|
* reasoning or tool-call input; the projected session context shows the text
|
|
98
98
|
* only once the step ends.
|
|
99
99
|
*/
|
|
@@ -107,6 +107,13 @@ const PROGRESS_EVENTS = new Map([
|
|
|
107
107
|
['session.step.ended', 'a model step ended'],
|
|
108
108
|
]);
|
|
109
109
|
|
|
110
|
+
/**
|
|
111
|
+
* The event types to subscribe to. OpenCode 2.2.0 and later deliver only
|
|
112
|
+
* these (`event.subscribe({ types })`); earlier releases ignore the option and
|
|
113
|
+
* `sessionProgress` skips the rest.
|
|
114
|
+
*/
|
|
115
|
+
export const PROGRESS_EVENT_TYPES = Object.freeze([...PROGRESS_EVENTS.keys()]);
|
|
116
|
+
|
|
110
117
|
/** The session and activity a progress event stands for, or null. */
|
|
111
118
|
export function sessionProgress(event) {
|
|
112
119
|
const activity = PROGRESS_EVENTS.get(event?.type);
|
|
@@ -115,7 +122,7 @@ export function sessionProgress(event) {
|
|
|
115
122
|
}
|
|
116
123
|
|
|
117
124
|
/**
|
|
118
|
-
* OpenCode runs plugins on Bun (1.4.2 in 2.0.32 and 2.1.2, 1.4.4 in 2.1.4),
|
|
125
|
+
* OpenCode runs plugins on Bun (1.4.2 in 2.0.32 and 2.1.2, 1.4.4 in 2.1.4 through 2.2.4),
|
|
119
126
|
* whose fetch accepts per-request `proxy` and `tls` options. Node's fetch
|
|
120
127
|
* silently ignores both, so a configured proxy would be bypassed; callers
|
|
121
128
|
* refuse instead.
|
|
@@ -144,6 +151,22 @@ export function usageTotals(requests) {
|
|
|
144
151
|
return { ...total, cachedInputShare: prompt ? Number((total.cacheRead / prompt).toFixed(4)) : null };
|
|
145
152
|
}
|
|
146
153
|
|
|
154
|
+
/**
|
|
155
|
+
* Provider error types that mean a usage or spend limit is used up. Another
|
|
156
|
+
* attempt fails the same way, so AZPR refuses OpenCode's retries of them and
|
|
157
|
+
* starts no new session. OpenCode 2.2.0 added the spend limits and 2.2.3 the
|
|
158
|
+
* ChatGPT and OpenCode Go usage limits; before, a ChatGPT limit arrived as a
|
|
159
|
+
* rate limit.
|
|
160
|
+
*/
|
|
161
|
+
export const USED_UP_LIMITS = Object.freeze({
|
|
162
|
+
'provider.quota': 'The provider reports the usage quota as used up',
|
|
163
|
+
'provider.free-limit': "OpenCode reports the free model's usage limit as reached",
|
|
164
|
+
'provider.chatgpt-limit': 'ChatGPT reports the subscription usage limit as reached',
|
|
165
|
+
'provider.go-limit': 'OpenCode Go reports its usage limit as reached',
|
|
166
|
+
'provider.budget-limit': 'OpenCode reports the workspace usage limit as reached',
|
|
167
|
+
'provider.model-budget-limit': "OpenCode reports this model's spend limit as reached",
|
|
168
|
+
});
|
|
169
|
+
|
|
147
170
|
/** Throw one readable error naming every missing host method. */
|
|
148
171
|
export function requireMethods(context, paths, purpose) {
|
|
149
172
|
const missing = paths.filter(path => typeof path.split('.').reduce((value, key) => value?.[key], context) !== 'function');
|