opencode-azure-devops-pr-review 0.3.0 → 0.3.1
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 +21 -0
- package/README.md +79 -41
- package/docs/ARCHITECTURE.md +8 -2
- package/docs/AZURE_DEVOPS.md +17 -14
- package/docs/DEBUGGING.md +7 -5
- package/docs/ENTERPRISE.md +37 -6
- package/docs/QUICKSTART.md +85 -66
- package/docs/VALIDATION.md +65 -4
- package/docs/VALIDATION_HISTORY.md +2 -2
- package/docs/releases/v0.3.1.md +87 -0
- package/package.json +1 -1
- package/src/azure.mjs +18 -3
- package/src/config.mjs +5 -0
- package/src/host.mjs +44 -0
- package/src/plugin.js +2 -1
- package/src/runtime.mjs +27 -5
- package/src/setup.mjs +49 -21
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.1 — 2026-10-27
|
|
4
|
+
|
|
5
|
+
- Installation and upgrades are documented as they behave on OpenCode 2.1.4:
|
|
6
|
+
`opencode plugin add` loads the plugin into a running service without a
|
|
7
|
+
restart, and adding a second version leaves the first one running. The
|
|
8
|
+
README's new Upgrading section adds the new version and removes the
|
|
9
|
+
previous one only when the download succeeded. Saved settings still need a
|
|
10
|
+
restart, and every message that asks for one names `opencode service restart`.
|
|
11
|
+
- `/pr-check` names the installation that answered and warns when another
|
|
12
|
+
AZPR entry is configured but not running, such as a second version that
|
|
13
|
+
OpenCode lists as a duplicate plugin ID. User names, passwords and query
|
|
14
|
+
strings in package specifications are masked.
|
|
15
|
+
- `/pr-setup` takes the organization from a PR or organization URL and,
|
|
16
|
+
without `--pat-file`, uses `${XDG_CONFIG_HOME:-~/.config}/azpr/pat` (or, with
|
|
17
|
+
`--replace`, the PAT file already set); its receipt names both.
|
|
18
|
+
- The quickstart runs the terminal steps first and needs one restart. The team
|
|
19
|
+
guide separates package downloads, model providers and Azure DevOps on
|
|
20
|
+
company networks, and the Azure DevOps guide names the actual settings
|
|
21
|
+
locations. Two links in the validation history now point at the version
|
|
22
|
+
that still had their sections.
|
|
23
|
+
|
|
3
24
|
## 0.3.0 — 2026-10-26
|
|
4
25
|
|
|
5
26
|
- Choose what reaches the PR after reading a preview:
|
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ the OpenCode team.
|
|
|
18
18
|
[Get started](docs/QUICKSTART.md) · [See the demo](docs/DEMO.md) ·
|
|
19
19
|
[Team setup and data handling](docs/ENTERPRISE.md) ·
|
|
20
20
|
[Validation and limitations](docs/VALIDATION.md) ·
|
|
21
|
-
[Download v0.3.
|
|
21
|
+
[Download v0.3.1](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/releases/tag/v0.3.1)
|
|
22
22
|
|
|
23
23
|
[](docs/DEMO.md)
|
|
24
24
|
|
|
@@ -58,15 +58,17 @@ for proxy authentication and retention.
|
|
|
58
58
|
|
|
59
59
|
## Your first review
|
|
60
60
|
|
|
61
|
-
1. Install the npm package using OpenCode's plugin manager
|
|
61
|
+
1. Install the npm package using OpenCode's plugin manager (already installed?
|
|
62
|
+
see [upgrading](#upgrading); behind a company proxy, see
|
|
63
|
+
[company networks](docs/ENTERPRISE.md#company-networks) first):
|
|
62
64
|
|
|
63
65
|
```sh
|
|
64
|
-
opencode plugin add opencode-azure-devops-pr-review@0.3.
|
|
66
|
+
opencode plugin add opencode-azure-devops-pr-review@0.3.1
|
|
65
67
|
```
|
|
66
68
|
|
|
67
69
|
2. Follow the [quickstart](docs/QUICKSTART.md) to save your PAT in a private
|
|
68
70
|
file and run `/pr-setup` with your organization and one model. Restart the
|
|
69
|
-
OpenCode service to load the settings.
|
|
71
|
+
OpenCode service (`opencode service restart`) to load the settings.
|
|
70
72
|
3. In one OpenCode conversation, check access, then review and preview:
|
|
71
73
|
|
|
72
74
|
```text
|
|
@@ -226,17 +228,20 @@ Azure DevOps REST API with the runtime's built-in `fetch`.
|
|
|
226
228
|
Install the npm package with OpenCode's plugin manager:
|
|
227
229
|
|
|
228
230
|
```sh
|
|
229
|
-
opencode plugin add opencode-azure-devops-pr-review@0.3.
|
|
231
|
+
opencode plugin add opencode-azure-devops-pr-review@0.3.1
|
|
230
232
|
```
|
|
231
233
|
|
|
232
234
|
The same release is also a versioned Git package, which needs Git but not the
|
|
233
235
|
npm registry:
|
|
234
236
|
|
|
235
237
|
```sh
|
|
236
|
-
opencode plugin add 'github:WTLAIB/opencode-azure-devops-pr-review-v2#v0.3.
|
|
238
|
+
opencode plugin add 'github:WTLAIB/opencode-azure-devops-pr-review-v2#v0.3.1'
|
|
237
239
|
```
|
|
238
240
|
|
|
239
|
-
Add only one of them.
|
|
241
|
+
Add only one of them. OpenCode 2.1.4 loads the plugin into a running OpenCode
|
|
242
|
+
service within a few seconds; if `/pr-setup` does not appear in a new
|
|
243
|
+
conversation, run `opencode service restart`. Then run `/pr-setup` for setup
|
|
244
|
+
instructions. Native packages
|
|
240
245
|
use `${XDG_CONFIG_HOME:-~/.config}/azpr/settings.json`; configuration and the
|
|
241
246
|
separate PAT file stay outside the package cache when the plugin is updated.
|
|
242
247
|
To select another configuration file, use an absolute path in the host config:
|
|
@@ -244,7 +249,7 @@ To select another configuration file, use an absolute path in the host config:
|
|
|
244
249
|
```json
|
|
245
250
|
{
|
|
246
251
|
"plugins": [{
|
|
247
|
-
"package": "opencode-azure-devops-pr-review@0.3.
|
|
252
|
+
"package": "opencode-azure-devops-pr-review@0.3.1",
|
|
248
253
|
"options": { "settingsFile": "/absolute/path/to/azpr/settings.json" }
|
|
249
254
|
}]
|
|
250
255
|
}
|
|
@@ -256,15 +261,43 @@ copy its settings to the external configuration path with owner-only
|
|
|
256
261
|
permissions, archive the old installation with its uninstaller, then add the
|
|
257
262
|
package. Keep the PAT file and private state directory in place.
|
|
258
263
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
264
|
+
### Upgrading
|
|
265
|
+
|
|
266
|
+
Keep one AZPR entry in the `plugins` list. **Running only `opencode plugin add`
|
|
267
|
+
with a new version adds a second entry**: OpenCode keeps running the version
|
|
268
|
+
listed first and reports the new one as `Duplicate plugin ID: azpr` (from
|
|
269
|
+
0.3.1, `/pr-check` also warns about it). Upgrade when no AZPR command is
|
|
270
|
+
running, since
|
|
271
|
+
OpenCode 2.1.4 replaces the running plugin as soon as its entry changes.
|
|
272
|
+
|
|
273
|
+
For an entry that `opencode plugin add` created, add the new version and,
|
|
274
|
+
only when that succeeds, remove the previous one:
|
|
275
|
+
|
|
276
|
+
```sh
|
|
277
|
+
opencode plugin add opencode-azure-devops-pr-review@0.3.1 &&
|
|
278
|
+
opencode plugin remove opencode-azure-devops-pr-review@PREVIOUS_VERSION
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
The first command downloads the new version in your terminal, with that
|
|
282
|
+
terminal's proxy settings. If it fails, `&&` skips the removal and nothing
|
|
283
|
+
changes; do not remove the previous entry by itself after a failed download.
|
|
284
|
+
Once the removal runs, the running OpenCode service switches to the new
|
|
285
|
+
version within a few seconds, with no restart. Use the same commands with the
|
|
286
|
+
`github:` specifications for the Git package, or to move between npm and Git.
|
|
287
|
+
|
|
288
|
+
For an entry with options (an object with `package` and `options`), change
|
|
289
|
+
only its `package` value and keep the options. The OpenCode service then
|
|
290
|
+
downloads the new version itself, with the service's network settings (see
|
|
291
|
+
[company networks](docs/ENTERPRISE.md#company-networks)); if that download fails,
|
|
292
|
+
AZPR's commands disappear until the package is available and the service
|
|
293
|
+
restarts.
|
|
294
|
+
|
|
295
|
+
External settings, the PAT file and review records stay in place; a working
|
|
296
|
+
configuration needs no new `/pr-setup`. `opencode plugin list` should then
|
|
297
|
+
show a single `azpr` row with the new version (from 0.3.1, `/pr-check` names
|
|
298
|
+
it too); if it still shows the previous one, run `opencode service restart`.
|
|
299
|
+
Exact versions stay pinned, so `opencode plugin update` leaves them unchanged.
|
|
300
|
+
See the [0.3.1 release notes](docs/releases/v0.3.1.md) for what changed and the
|
|
268
301
|
[0.2.0 release notes](docs/releases/v0.2.0.md) for automatic comments, which
|
|
269
302
|
remain disabled unless you configure `afterReview` or request them with a
|
|
270
303
|
review command flag.
|
|
@@ -274,8 +307,8 @@ review command flag.
|
|
|
274
307
|
<details>
|
|
275
308
|
<summary>Source installation and replacement</summary>
|
|
276
309
|
|
|
277
|
-
Download the [v0.3.
|
|
278
|
-
and extract it, or check out tag `v0.3.
|
|
310
|
+
Download the [v0.3.1 source archive](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/archive/refs/tags/v0.3.1.tar.gz)
|
|
311
|
+
and extract it, or check out tag `v0.3.1`. The installer needs POSIX `sh` and
|
|
279
312
|
Python 3's standard library. From that source directory:
|
|
280
313
|
|
|
281
314
|
```sh
|
|
@@ -349,9 +382,10 @@ Keep `LICENSE` with copied or redistributed packages.
|
|
|
349
382
|
|
|
350
383
|
Run `/pr-setup` to see the active settings path. Native packages use the
|
|
351
384
|
external configuration described above; source installations retain their
|
|
352
|
-
installed `plugins/azpr-v2/settings.json`. Edit that file and restart
|
|
353
|
-
|
|
354
|
-
|
|
385
|
+
installed `plugins/azpr-v2/settings.json`. Edit that file and restart the
|
|
386
|
+
OpenCode service (`opencode service restart`, or your own `opencode serve`
|
|
387
|
+
process). A changed file blocks new commands until the restart; running
|
|
388
|
+
commands keep the settings they started with.
|
|
355
389
|
|
|
356
390
|
For initial setup, one command sets the organization, existing PAT file and
|
|
357
391
|
the same model for review and quick roles without calling a model or Azure:
|
|
@@ -360,10 +394,14 @@ the same model for review and quick roles without calling a model or Azure:
|
|
|
360
394
|
/pr-setup --organization YOUR_ORG --model YOUR_PROVIDER/YOUR_MODEL --pat-file "/absolute/path/to/pat"
|
|
361
395
|
```
|
|
362
396
|
|
|
363
|
-
|
|
397
|
+
`--organization` also accepts a PR or organization URL. Without `--pat-file`,
|
|
398
|
+
setup uses `${XDG_CONFIG_HOME:-~/.config}/azpr/pat`, the file the
|
|
399
|
+
[quickstart](docs/QUICKSTART.md#2-save-the-pat-in-a-private-file-terminal)
|
|
400
|
+
creates. An existing file requires `--replace`, which keeps the PAT file
|
|
401
|
+
already set unless you name another; unrelated advanced settings and deep
|
|
364
402
|
models are preserved. Setup checks the model catalog and PAT file before
|
|
365
|
-
saving. It never accepts the PAT itself as a command argument. Restart
|
|
366
|
-
saving, then run `/pr-check` to verify Azure read access.
|
|
403
|
+
saving. It never accepts the PAT itself as a command argument. Restart the
|
|
404
|
+
OpenCode service after saving, then run `/pr-check` to verify Azure read access.
|
|
367
405
|
|
|
368
406
|
```json
|
|
369
407
|
{
|
|
@@ -421,7 +459,7 @@ every concrete defect it finds, in any area, as a finding.
|
|
|
421
459
|
| `afterReview.quick` / `.review` / `.deep` | `none` each: nothing follows a review; run `/pr-comment` yourself. `preview` plans a comment preview after a COMPLETE review of that mode (a model runs; nothing is posted); `publish` plans and posts it as the PAT owner; a comment that a safeguard holds back waits for a person. A flag after the PR URL overrides it for one run. See [automatic comments](#automatic-comments). |
|
|
422
460
|
| `azure.organization` | Required. The `<org>` of `https://dev.azure.com/<org>`; PR URLs of other organizations are refused. |
|
|
423
461
|
| `azure.pat` | A personal access token for that organization with **Code (Read)** and **Pull Request Threads (Read & write)**, or `""` when `azure.patFile` is set. Sent only to `https://dev.azure.com/<org>` and never logged. |
|
|
424
|
-
| `azure.patFile` | `""`. Recommended: the absolute path of a file that holds only the PAT, so `settings.json` holds no secret. It must be a regular file you own that only you can access (mode 600, not a symbolic link). AZPR reads it at start and before each command; after replacing it, restart OpenCode. Set either this or `azure.pat`. |
|
|
462
|
+
| `azure.patFile` | `""`. Recommended: the absolute path of a file that holds only the PAT, so `settings.json` holds no secret. It must be a regular file you own that only you can access (mode 600, not a symbolic link). AZPR reads it at start and before each command; after replacing it, restart the OpenCode service. Set either this or `azure.pat`. |
|
|
425
463
|
| `azure.concurrency` | `3` simultaneous Azure DevOps calls across all AZPR commands. |
|
|
426
464
|
| `azure.callTimeoutSeconds` | `120`; a hung call is aborted and its slot released (reads are retried). |
|
|
427
465
|
| `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. |
|
|
@@ -453,24 +491,24 @@ a PAT scoped to **one organization** (global "all accessible organizations"
|
|
|
453
491
|
PATs stop working on 2026-12-01) with **Code: Read** and **Pull Request Threads:
|
|
454
492
|
Read & write**, which cover every call AZPR makes, and give it an expiry you
|
|
455
493
|
renew. Keep it alone in a file that only you can read and point `azure.patFile`
|
|
456
|
-
at it, so `settings.json` holds no secret
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
`/home/you/.config/azpr/pat`) and leave `"pat"` empty in the installed
|
|
466
|
-
`settings.json`, and restart OpenCode. `azure.pat` can hold the PAT instead; the
|
|
494
|
+
at it, so `settings.json` holds no secret: the
|
|
495
|
+
[quickstart](docs/QUICKSTART.md#2-save-the-pat-in-a-private-file-terminal) shows
|
|
496
|
+
how to create that file without echoing the PAT, recording it in your shell
|
|
497
|
+
history or overwriting an existing file, and `/pr-setup` sets `azure.patFile`.
|
|
498
|
+
|
|
499
|
+
To set it by hand, put that file's absolute path (for example
|
|
500
|
+
`/home/you/.config/azpr/pat`) in `"patFile"`, leave `"pat"` empty in the
|
|
501
|
+
settings file `/pr-setup` names, and restart the OpenCode service. `azure.pat`
|
|
502
|
+
can hold the PAT instead; the
|
|
467
503
|
installer keeps `settings.json` at mode 600. A file only you can read protects
|
|
468
504
|
the PAT from other accounts, not from programs you run yourself, so keep its
|
|
469
505
|
scopes minimal and its lifetime short. Keep the PAT out of this repository,
|
|
470
506
|
shared settings profiles, chat and environment variables that child processes
|
|
471
507
|
inherit. Behind a corporate proxy, also set `azure.proxy`, and `azure.caFile`
|
|
472
508
|
when the proxy inspects HTTPS (see
|
|
473
|
-
[proxies and TLS inspection](docs/AZURE_DEVOPS.md#proxies-and-tls-inspection)
|
|
509
|
+
[proxies and TLS inspection](docs/AZURE_DEVOPS.md#proxies-and-tls-inspection),
|
|
510
|
+
and [company networks](docs/ENTERPRISE.md#company-networks) for package
|
|
511
|
+
downloads and model providers).
|
|
474
512
|
|
|
475
513
|
Reviewers read source through six read-only AZPR tools (`azpr_read_diff`,
|
|
476
514
|
`azpr_read_file`, `azpr_search_code`, `azpr_find_files`, `azpr_list_files`,
|
|
@@ -681,8 +719,8 @@ and a loopback fake Azure DevOps REST service in disposable directories under
|
|
|
681
719
|
Uninstall without `--apply` previews; `--apply` archives only this package under
|
|
682
720
|
`azpr-v2-backups` and leaves the private state directory for you to delete.
|
|
683
721
|
For a native installation, remove the entry you added, for example
|
|
684
|
-
`opencode plugin remove opencode-azure-devops-pr-review@0.3.
|
|
685
|
-
`opencode plugin remove 'github:WTLAIB/opencode-azure-devops-pr-review-v2#v0.3.
|
|
722
|
+
`opencode plugin remove opencode-azure-devops-pr-review@0.3.1` or
|
|
723
|
+
`opencode plugin remove 'github:WTLAIB/opencode-azure-devops-pr-review-v2#v0.3.1'`;
|
|
686
724
|
the external settings, PAT file and private review state remain available.
|
|
687
725
|
|
|
688
726
|
[Architecture](docs/ARCHITECTURE.md), [commenting](docs/COMMENTING.md),
|
|
@@ -695,7 +733,7 @@ or personal model selections.
|
|
|
695
733
|
## License and releases
|
|
696
734
|
|
|
697
735
|
[MIT](LICENSE), copyright 2026 WTLAIB. See the [changelog](CHANGELOG.md) for the
|
|
698
|
-
release scope, [v0.3.
|
|
736
|
+
release scope, [v0.3.1](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/releases/tag/v0.3.1)
|
|
699
737
|
for downloads, the [npm package](https://www.npmjs.com/package/opencode-azure-devops-pr-review),
|
|
700
738
|
[v0.2.0](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/releases/tag/v0.2.0)
|
|
701
739
|
for the recorded demonstration, and [releasing](docs/RELEASING.md) for the
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -40,7 +40,10 @@ keep configuration outside the package cache, at an explicit absolute
|
|
|
40
40
|
`options.settingsFile` or `${XDG_CONFIG_HOME:-~/.config}/azpr/settings.json`.
|
|
41
41
|
Source installations retain their adjacent settings file. `/pr-setup` provides
|
|
42
42
|
guidance before settings exist, validates one model and an existing private PAT
|
|
43
|
-
file, and writes settings only on the explicit setup command.
|
|
43
|
+
file, and writes settings only on the explicit setup command. Without
|
|
44
|
+
`--pat-file` it uses the PAT file already set (with `--replace`) or
|
|
45
|
+
`${XDG_CONFIG_HOME:-~/.config}/azpr/pat`, and `--organization` also accepts a
|
|
46
|
+
PR or organization URL. It makes no model
|
|
44
47
|
or Azure request. Changes take effect after a restart; the loaded runtime and
|
|
45
48
|
its active grants do not change in place. While settings are missing or
|
|
46
49
|
unusable, the review commands answer `SETUP REQUIRED` and name the problem
|
|
@@ -401,7 +404,10 @@ Reviewers have no Azure DevOps write tool at all; only the runtime writes.
|
|
|
401
404
|
(`permission.hook`, `tool.transform`) and holds the host continuation text.
|
|
402
405
|
Without `permission.hook` the project boundary for native read tools is left to
|
|
403
406
|
the host's own permission rules; `/pr-check` shows a WARNING row and reviews
|
|
404
|
-
still run.
|
|
407
|
+
still run. With `plugin.list`, `/pr-check` names the installation that runs
|
|
408
|
+
and warns about any other AZPR entry the host configured but does not run,
|
|
409
|
+
such as a second version that OpenCode 2.1.4 lists as a duplicate plugin ID;
|
|
410
|
+
a host without it gets an information row.
|
|
405
411
|
Receipts note when the detected OpenCode version differs from the tested one
|
|
406
412
|
(`TESTED_HOST_VERSION`, 2.1.4).
|
|
407
413
|
REST paths and the pinned api-version live only in `azure.mjs`; see
|
package/docs/AZURE_DEVOPS.md
CHANGED
|
@@ -16,21 +16,22 @@ other component's configuration.
|
|
|
16
16
|
Global PATs ("All accessible organizations") stop working on 2026-12-01; use
|
|
17
17
|
an organization-scoped token. `Code: Read & write` also works but allows
|
|
18
18
|
pushing code, which AZPR never needs.
|
|
19
|
-
2. Put the PAT alone in a file only you can read,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
2. Put the PAT alone in a file only you can read, as the
|
|
20
|
+
[quickstart](QUICKSTART.md#2-save-the-pat-in-a-private-file-terminal) shows,
|
|
21
|
+
then run `/pr-setup --organization YOUR_ORGANIZATION --model PROVIDER/MODEL`
|
|
22
|
+
(add `--pat-file` for a file other than `${XDG_CONFIG_HOME:-~/.config}/azpr/pat`).
|
|
23
|
+
To edit the settings by hand instead, use the file `/pr-setup` names: an
|
|
24
|
+
explicit `options.settingsFile`; `settings.json` next to a source
|
|
25
|
+
installation (`plugins/azpr-v2/settings.json`); otherwise
|
|
26
|
+
`${XDG_CONFIG_HOME:-~/.config}/azpr/settings.json`:
|
|
27
27
|
|
|
28
28
|
```json
|
|
29
29
|
{ "azure": { "organization": "YOUR_ORGANIZATION", "patFile": "/home/YOU/.config/azpr/pat" } }
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
`"pat": "YOUR_PAT"` in place of `patFile` also works but keeps the secret in
|
|
33
|
-
`settings.json`; set one of the two, not both.
|
|
33
|
+
`settings.json`; set one of the two, not both. Restart the OpenCode service
|
|
34
|
+
(`opencode service restart`) after saving.
|
|
34
35
|
|
|
35
36
|
3. Run `/pr-check <PR URL>`; it reads the PR, its changes, one HEAD and one BASE
|
|
36
37
|
file and the discussions without any model request.
|
|
@@ -52,7 +53,7 @@ any request.
|
|
|
52
53
|
When dev.azure.com is reachable only through a proxy, a direct connection fails
|
|
53
54
|
and `/pr-check` reports `network error (ConnectionRefused)` (or a timeout, or
|
|
54
55
|
`ENOTFOUND`) under PR metadata. Point AZPR at the proxy in `settings.json` and
|
|
55
|
-
restart OpenCode:
|
|
56
|
+
restart the OpenCode service:
|
|
56
57
|
|
|
57
58
|
```json
|
|
58
59
|
{ "azure": { "proxy": "http://proxy.example.com:8080" } }
|
|
@@ -80,14 +81,16 @@ restart OpenCode:
|
|
|
80
81
|
intercept the connection can then read the PAT, so use it only when the CA
|
|
81
82
|
certificate cannot be obtained. `/pr-check` shows a WARNING row while it is
|
|
82
83
|
off.
|
|
83
|
-
- Settings and the CA file are read when OpenCode loads AZPR; restart
|
|
84
|
-
after changing either. `/pr-check` lists the proxy
|
|
84
|
+
- Settings and the CA file are read when OpenCode loads AZPR; restart the
|
|
85
|
+
OpenCode service after changing either. `/pr-check` lists the proxy
|
|
86
|
+
(without credentials) and
|
|
85
87
|
the number of extra CA certificates.
|
|
86
88
|
- Without `azure.proxy`, OpenCode's runtime (Bun) still honours `HTTPS_PROXY`
|
|
87
89
|
and `NO_PROXY` in the OpenCode process environment, and `NODE_EXTRA_CA_CERTS`
|
|
88
90
|
for extra CA certificates. Those apply to every connection OpenCode makes,
|
|
89
91
|
including model providers; `azure.proxy` and `azure.caFile` limit the change
|
|
90
|
-
to AZPR.
|
|
92
|
+
to AZPR. See [company networks](ENTERPRISE.md#company-networks) for package
|
|
93
|
+
downloads and the service environment.
|
|
91
94
|
- The three settings rely on the per-request proxy and TLS options of Bun's
|
|
92
95
|
`fetch`. A runtime whose `fetch` would ignore them makes AZPR refuse to load
|
|
93
96
|
instead of connecting directly.
|
|
@@ -200,7 +203,7 @@ but AZPR accepts only Azure DevOps Services URLs (`dev.azure.com/<org>` and
|
|
|
200
203
|
| `Azure DevOps refused … (HTTP 403 …)` | The PAT lacks a scope or the user lacks access to the project or repository. |
|
|
201
204
|
| `azure.patFile could not be used (…)` | The file is missing, a symbolic link, not a regular file, owned by another user, accessible by group or others (`chmod 600` it) or larger than 4 KB. |
|
|
202
205
|
| `azure.patFile must hold only the Azure DevOps PAT (…)` | The file is empty, holds more than one token or still a placeholder. |
|
|
203
|
-
| `azure.patFile changed since OpenCode loaded it` | Restart OpenCode to use the new PAT; running commands keep the old one. |
|
|
206
|
+
| `azure.patFile changed since OpenCode loaded it` | Restart the OpenCode service to use the new PAT; running commands keep the old one. |
|
|
204
207
|
| `Azure DevOps could not find … (HTTP 404 TF…)` | Wrong project, repository, PR ID or path; Azure's error code is shown. |
|
|
205
208
|
| `The PR belongs to organization "x", but azure.organization is "y"` | Configure the PAT and organization of that PR. |
|
|
206
209
|
| `… did not finish within the per-call timeout` | Azure DevOps or the network did not answer; reads were retried. |
|
package/docs/DEBUGGING.md
CHANGED
|
@@ -42,7 +42,7 @@ packages, or installed `plugins/azpr-v2/settings.json` for source installs):
|
|
|
42
42
|
{ "debug": { "enabled": true, "directory": "", "keepRuns": 20 }, "returnReport": "full" }
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
Restart OpenCode after editing. An empty directory selects
|
|
45
|
+
Restart the OpenCode service (`opencode service restart`) after editing. An empty directory selects
|
|
46
46
|
`${XDG_STATE_HOME:-~/.local/state}/opencode/azpr-v2-debug/`; a relative path is
|
|
47
47
|
resolved against the active project. Each run creates a unique owner-only
|
|
48
48
|
directory named in the receipt. Debug data can contain source, PR details and
|
|
@@ -117,16 +117,16 @@ Common receipts:
|
|
|
117
117
|
|
|
118
118
|
| Message | Next step |
|
|
119
119
|
| --- | --- |
|
|
120
|
-
| `Azure DevOps rejected the PAT for organization …` | Renew or correct the PAT in `azure.pat` or the file named by `azure.patFile` (organization-scoped, Code Read, Pull Request Threads Read & write) and restart OpenCode. |
|
|
120
|
+
| `Azure DevOps rejected the PAT for organization …` | Renew or correct the PAT in `azure.pat` or the file named by `azure.patFile` (organization-scoped, Code Read, Pull Request Threads Read & write) and restart the OpenCode service. |
|
|
121
121
|
| `The provider reports the usage quota as used up (provider.quota)` / `OpenCode reports the free model's usage limit as reached (provider.free-limit)` | The stage failed without a new-session retry, which would fail the same way. Choose another model in the settings, or wait until the provider's quota or the free limit resets. |
|
|
122
|
-
| `azure.patFile could not be used …` / `azure.patFile changed since OpenCode loaded it` | Make it a regular file you own with only the PAT (`chmod 600`), or restart OpenCode after replacing it. |
|
|
122
|
+
| `azure.patFile could not be used …` / `azure.patFile changed since OpenCode loaded it` | Make it a regular file you own with only the PAT (`chmod 600`), or restart the OpenCode service after replacing it. |
|
|
123
123
|
| `Azure DevOps refused … (HTTP 403 …)` | Add the missing PAT scope or project/repository access. |
|
|
124
124
|
| `network error (ConnectionRefused)` with a hint to set `azure.proxy` | dev.azure.com is reachable only through a proxy; set `azure.proxy` (see [proxies](AZURE_DEVOPS.md#proxies-and-tls-inspection)). |
|
|
125
125
|
| `the server's TLS certificate was not accepted (…)` | The proxy inspects HTTPS; set `azure.caFile` to its root CA certificate. |
|
|
126
126
|
| `A proxy refused … (HTTP 407)` / `A proxy or gateway answered …` | The proxy wants credentials in `azure.proxy`, or it blocks dev.azure.com. |
|
|
127
127
|
| `azpr_read_file failed: …` in a stage's tool errors | The model asked for a missing path or invalid range; the review continues and reports the gap. |
|
|
128
128
|
| `permission.rejected` … `cannot use paths outside the local OpenCode project` | A reviewer used a native tool on a repository path; it was refused instead of waiting for an approval and the model was pointed to the azpr tools. |
|
|
129
|
-
| `settings.json changed since OpenCode loaded it` | Restart OpenCode. Running commands were unaffected. |
|
|
129
|
+
| `settings.json changed since OpenCode loaded it` | Restart the OpenCode service. Running commands were unaffected. |
|
|
130
130
|
| `Host configuration changed private agent …` | Another config or plugin changed an `azpr-*` agent; resolve it and reload. |
|
|
131
131
|
| `No completed review is available for this conversation` | Run the comment command in the review's conversation, or run a new review. |
|
|
132
132
|
| `PR source commit changed after the review` | The PR got new commits; run a new review before commenting. |
|
|
@@ -138,7 +138,9 @@ Common receipts:
|
|
|
138
138
|
| `Automatic … skipped: another AZPR command is running in this conversation or on this PR` | Wait for that command, then run the `/pr-comment` command the notice names. |
|
|
139
139
|
| `Automatic comments are off for this review (stopped: …)` on a COMPLETE receipt | `/pr-stop`, a timeout or an unload arrived while the finished review's report was delivered. The review is kept; no comment step started. Run `/pr-comment <id>` to preview it. |
|
|
140
140
|
| `Unknown option after the PR URL` / `Use at most one of --preview, --publish or --no-comment` | Only these flags may follow the URL, at most one; start your context with a word. Nothing was started. |
|
|
141
|
-
| `SETUP REQUIRED` … `could not be used when OpenCode loaded AZPR: …` | The reason names the problem (no file yet, an unreadable file, invalid JSON, a setting that fails validation or an unusable PAT file) without its value. Fix it, then restart OpenCode. |
|
|
141
|
+
| `SETUP REQUIRED` … `could not be used when OpenCode loaded AZPR: …` | The reason names the problem (no file yet, an unreadable file, invalid JSON, a setting that fails validation or an unusable PAT file) without its value. Fix it, then restart the OpenCode service. |
|
|
142
|
+
| `No --pat-file was given, and the default PAT file … could not be used` | `/pr-setup` looked for the PAT in `${XDG_CONFIG_HOME:-~/.config}/azpr/pat` (or, with `--replace`, the PAT file already set). Create it as the [quickstart](QUICKSTART.md#2-save-the-pat-in-a-private-file-terminal) shows, or name your file with `--pat-file`. Nothing was saved. |
|
|
143
|
+
| `/pr-check` row `AZPR` WARNING: `Another AZPR entry is configured but not running` | Two `plugins` entries load AZPR, usually after `opencode plugin add` with a new version; OpenCode runs the first and lists the other as a duplicate. Remove the one you do not want (see [upgrading](../README.md#upgrading)). |
|
|
142
144
|
| `This review's private data is no longer available` | The review was evicted or its data removed; run a new review. |
|
|
143
145
|
| Skipped finding: `The comment planner repeated a checkpoint without progress` or `did not finish the page in 4 sessions` | The planner kept asking for more reading on that page; the finding has no inline comment but stays in the summary index, and the other comments were planned as usual. Inspect the page's planning stages; `/pr-comment <id>` (a preview) plans again. |
|
|
144
146
|
| `Stage inactivity watchdog stopped this stage: no activity for … s after …` (`failure=idle`, plus an inactivity notice) | The model stream, a tool or OpenCode stopped responding for `workflow.stageIdleSeconds`; the stage ran again in a new session. Repeated stops after `model request N was sent` point at the provider. Raise the setting only if a model really needs longer for one answer (live stages so far stayed under 151 s without any event). |
|
package/docs/ENTERPRISE.md
CHANGED
|
@@ -45,10 +45,11 @@ diagnostic settings. With `azure.patFile`, `settings.json` holds no secret:
|
|
|
45
45
|
AZPR opens the PAT file without following symbolic links and refuses it unless
|
|
46
46
|
it is a regular file owned by the OpenCode user with no group or other access,
|
|
47
47
|
and it reads the file at start and before each command, so a replaced PAT
|
|
48
|
-
needs a restart. The installer and `/pr-setup` create
|
|
49
|
-
`600`; source replacement preserves it, and native
|
|
50
|
-
write to it. Keep it outside shared profiles and Git,
|
|
51
|
-
restart OpenCode
|
|
48
|
+
needs a restart of the OpenCode service. The installer and `/pr-setup` create
|
|
49
|
+
`settings.json` with mode `600`; source replacement preserves it, and native
|
|
50
|
+
package updates do not write to it. Keep it outside shared profiles and Git,
|
|
51
|
+
and restart the OpenCode service (`opencode service restart`) after changing
|
|
52
|
+
it. A file only its owner can read protects the
|
|
52
53
|
PAT from other accounts, not from programs that run as the same user (an
|
|
53
54
|
agent's shell commands, for example), so keep the PAT's scopes minimal and its
|
|
54
55
|
lifetime short, and keep it out of environment variables that child processes
|
|
@@ -186,7 +187,37 @@ leaves review state in place. To remove local copies, stop OpenCode and handle
|
|
|
186
187
|
the installed settings/backups, state, diagnostics and OpenCode conversations
|
|
187
188
|
according to your team's retention needs.
|
|
188
189
|
|
|
189
|
-
##
|
|
190
|
+
## Company networks
|
|
191
|
+
|
|
192
|
+
Three kinds of connection leave your machine, and each is configured where it
|
|
193
|
+
is made. Set up the first before `opencode plugin add`:
|
|
194
|
+
|
|
195
|
+
| Connection | Made by | Configure |
|
|
196
|
+
| --- | --- | --- |
|
|
197
|
+
| Package download for `opencode plugin add` | The `opencode` command in your terminal | `HTTPS_PROXY` (and `HTTP_PROXY`, `NO_PROXY`) in that terminal, or `https-proxy` in your user `~/.npmrc`. OpenCode does not read a project's `.npmrc` or, by default, npm's global configuration. |
|
|
198
|
+
| Package download when a changed `plugins` entry or a start finds a version that is not installed yet | The OpenCode background service | The service's environment, set with `opencode service set env` |
|
|
199
|
+
| Model providers | The OpenCode background service | The service's environment, as in OpenCode's [network guide](https://opencode.ai/v2/docs/network) |
|
|
200
|
+
| Azure DevOps | AZPR, inside the OpenCode service | `azure.proxy` and `azure.caFile` below; with an empty `azure.proxy`, the service environment's proxy variables apply |
|
|
201
|
+
|
|
202
|
+
- When a terminal sets a proxy, keep `localhost,127.0.0.1,::1` in its
|
|
203
|
+
`NO_PROXY`: the `opencode` command reaches the background service over the
|
|
204
|
+
loopback interface. Keep your organization's existing exceptions too.
|
|
205
|
+
- A variable set with `opencode service set env` applies when the service
|
|
206
|
+
starts; setting one stops the running service, so start it again with
|
|
207
|
+
`opencode service start`. Exports in a terminal do not change a service that
|
|
208
|
+
is already running. Do not share the output of `opencode service get env`:
|
|
209
|
+
it shows the values, including proxy credentials.
|
|
210
|
+
- For a company CA, OpenCode reads a PEM file named by `NODE_EXTRA_CA_CERTS`
|
|
211
|
+
(in the terminal, and in the service environment); see OpenCode's
|
|
212
|
+
[network guide](https://opencode.ai/v2/docs/network). `azure.caFile` applies
|
|
213
|
+
only to AZPR's Azure DevOps requests and cannot fix a package-download
|
|
214
|
+
certificate error.
|
|
215
|
+
- Keep TLS verification on. A failed package download leaves nothing changed
|
|
216
|
+
when `opencode plugin add` makes it; when the service makes it, AZPR's
|
|
217
|
+
commands disappear until the package is available and the service restarts
|
|
218
|
+
(see [upgrading](../README.md#upgrading)).
|
|
219
|
+
|
|
220
|
+
### Azure DevOps requests
|
|
190
221
|
|
|
191
222
|
The following settings affect **AZPR's Azure DevOps requests only**. Configure
|
|
192
223
|
model-provider connectivity separately in the OpenCode environment.
|
|
@@ -197,7 +228,7 @@ model-provider connectivity separately in the OpenCode environment.
|
|
|
197
228
|
| `azure.caFile` | Absolute path to PEM CA certificates, added to the built-in trusted roots. Use this for your organization's TLS inspection CA. |
|
|
198
229
|
| `azure.verifyTls` | Defaults to `true`. Disabling certificate verification exposes the PAT to intercepted connections and produces a `/pr-check` warning. |
|
|
199
230
|
|
|
200
|
-
Restart OpenCode after changing transport settings or the CA file. These
|
|
231
|
+
Restart the OpenCode service after changing transport settings or the CA file. These
|
|
201
232
|
options depend on Bun's per-request transport support; an unsupported runtime
|
|
202
233
|
refuses to load them. If `azure.proxy` is empty, process-wide proxy environment
|
|
203
234
|
settings can still apply. A TLS-inspecting proxy can see the PAT and source
|