opencode-azure-devops-pr-review 0.2.2 → 0.2.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/AGENTS.md +6 -3
- package/CHANGELOG.md +20 -0
- package/CONTRIBUTING.md +4 -3
- package/README.md +22 -16
- package/docs/ARCHITECTURE.md +11 -5
- package/docs/AZURE_DEVOPS.md +3 -0
- package/docs/DEBUGGING.md +7 -6
- package/docs/ENTERPRISE.md +1 -1
- package/docs/QUICKSTART.md +7 -7
- package/docs/RELEASING.md +2 -2
- package/docs/ROADMAP.md +5 -3
- package/docs/VALIDATION.md +124 -6
- package/docs/releases/v0.2.3.md +93 -0
- package/install.sh +1 -1
- package/package.json +1 -1
- package/src/azure.mjs +15 -6
- package/src/host.mjs +9 -8
- package/src/runtime.mjs +7 -6
- package/src/session.mjs +10 -3
package/AGENTS.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# AI development guide
|
|
2
2
|
|
|
3
3
|
This repository targets the OpenCode V2 plugin API (tested with
|
|
4
|
-
`@opencode/cli@2.1.
|
|
4
|
+
`@opencode/cli@2.1.4`), the Azure DevOps Services REST API (api-version 7.1)
|
|
5
5
|
and Ubuntu 22.04. Public source and documentation use English. Follow the user's
|
|
6
6
|
conversation language and current authorization scope.
|
|
7
7
|
|
|
@@ -73,7 +73,9 @@ settings, backups and failure records. Never upload `.local/`.
|
|
|
73
73
|
- All AZPR Azure DevOps traffic shares the queue in `tool-queue.mjs` (concurrency and
|
|
74
74
|
per-call timeout). Release slots in `finally`; never depend on a hook running.
|
|
75
75
|
- Large PRs are handled by sharding, not by compaction: private sessions may not
|
|
76
|
-
compact, and a compaction
|
|
76
|
+
compact, and a compaction the host attempts in a reviewer's turn means "split
|
|
77
|
+
this shard". A refused background summary (`experimental.background_compaction`)
|
|
78
|
+
ends nothing, so the turn's own failure decides its class.
|
|
77
79
|
- There is deliberately no default whole-run timeout and no per-stage step cap;
|
|
78
80
|
see the roadmap's Deferred section before adding either.
|
|
79
81
|
|
|
@@ -131,7 +133,8 @@ Detect capabilities; do not assume them.
|
|
|
131
133
|
|
|
132
134
|
Run `npm run check` and `npm test`. For changes touching hooks, sessions, tools, Azure access or
|
|
133
135
|
publication, also run `node tests/host-v2-smoke.mjs <opencode binary>` (fresh and
|
|
134
|
-
`--replace`)
|
|
136
|
+
`--replace`), `node tests/host-v2-comment-scale.mjs <opencode binary>` and
|
|
137
|
+
`node tests/host-v2-background-compaction.mjs <opencode binary>`.
|
|
135
138
|
For package entry points, first-run setup or settings-path changes, also run
|
|
136
139
|
`node tests/host-v2-smoke.mjs <opencode binary> --native`; this installs the
|
|
137
140
|
packed artifact through OpenCode's plugin manager in an isolated profile.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.3 — 2026-10-24
|
|
4
|
+
|
|
5
|
+
- The tested host is OpenCode CLI 2.1.4. OpenCode 2.1.3 and later embed Bun
|
|
6
|
+
1.4.4, which reports a proxy that refuses the CONNECT tunnel as an
|
|
7
|
+
`ERR_PROXY_TUNNEL` error instead of returning the proxy's answer. AZPR maps
|
|
8
|
+
it to the earlier messages and retry rules: a missing proxy password is again
|
|
9
|
+
explained as HTTP 407 without retries, and a refused tunnel never leaves a
|
|
10
|
+
comment write uncertain.
|
|
11
|
+
- Azure DevOps calls keep the configured `azure.callTimeoutSeconds`. The
|
|
12
|
+
runtime's fetch gave up on a silent request after about six minutes by
|
|
13
|
+
itself, so a longer setting ended early with a retried network error.
|
|
14
|
+
- With OpenCode's opt-in `experimental.background_compaction`, a refused
|
|
15
|
+
background summary no longer turns a later failure into a context-overflow
|
|
16
|
+
split. A permanent error such as HTTP 401 stops the stage without new
|
|
17
|
+
sessions, and a failed follow-up keeps the answer it followed.
|
|
18
|
+
- The README states that AZPR is an independent community project, not built
|
|
19
|
+
by or affiliated with the OpenCode team.
|
|
20
|
+
- A fifth exact-host fixture covers background compaction followed by a
|
|
21
|
+
permanent failure; CI runs it.
|
|
22
|
+
|
|
3
23
|
## 0.2.2 — 2026-10-23
|
|
4
24
|
|
|
5
25
|
- The README leads with reviewing Azure DevOps PRs from a URL without a local
|
package/CONTRIBUTING.md
CHANGED
|
@@ -29,7 +29,7 @@ can go straight to a pull request.
|
|
|
29
29
|
## Work locally
|
|
30
30
|
|
|
31
31
|
Use Node.js 22.12 or later, POSIX `sh`, Python 3 and Git. The current host
|
|
32
|
-
acceptance target is OpenCode V2 `@opencode/cli@2.1.
|
|
32
|
+
acceptance target is OpenCode V2 `@opencode/cli@2.1.4` on Ubuntu 22.04; other
|
|
33
33
|
environments are not yet validated. The runtime has no npm dependencies or
|
|
34
34
|
build step. From your checkout:
|
|
35
35
|
|
|
@@ -45,16 +45,17 @@ findings and independently verified findings. Add a focused regression test
|
|
|
45
45
|
when fixing behavior, and update the relevant documentation when it changes.
|
|
46
46
|
|
|
47
47
|
Changes to hooks, sessions, tools, Azure access or publication also need all
|
|
48
|
-
|
|
48
|
+
five host fixture runs. Install the tested host into a disposable local directory
|
|
49
49
|
without changing your everyday OpenCode installation:
|
|
50
50
|
|
|
51
51
|
```sh
|
|
52
|
-
npm install --prefix "$PWD/.local/contributor-host" --no-audit --no-fund @opencode/cli@2.1.
|
|
52
|
+
npm install --prefix "$PWD/.local/contributor-host" --no-audit --no-fund @opencode/cli@2.1.4
|
|
53
53
|
AZPR_TEST_HOST="$PWD/.local/contributor-host/node_modules/.bin/opencode"
|
|
54
54
|
node tests/host-v2-smoke.mjs "$AZPR_TEST_HOST"
|
|
55
55
|
node tests/host-v2-smoke.mjs "$AZPR_TEST_HOST" --replace
|
|
56
56
|
node tests/host-v2-smoke.mjs "$AZPR_TEST_HOST" --native
|
|
57
57
|
node tests/host-v2-comment-scale.mjs "$AZPR_TEST_HOST"
|
|
58
|
+
node tests/host-v2-background-compaction.mjs "$AZPR_TEST_HOST"
|
|
58
59
|
```
|
|
59
60
|
|
|
60
61
|
The fixtures need `openssl` and use isolated configuration, a fake model
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
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
|
|
|
@@ -12,10 +12,13 @@ managing a local clone of each project. AZPR uses your OpenCode models to inspec
|
|
|
12
12
|
the changes, check findings, and prepare inline comments you can preview before
|
|
13
13
|
publishing. No MCP server or CI pipeline setup is required.
|
|
14
14
|
|
|
15
|
+
AZPR is an independent community project. It is not built by or affiliated with
|
|
16
|
+
the OpenCode team.
|
|
17
|
+
|
|
15
18
|
[Get started](docs/QUICKSTART.md) · [See the demo](docs/DEMO.md) ·
|
|
16
19
|
[Team setup and data handling](docs/ENTERPRISE.md) ·
|
|
17
20
|
[Validation and limitations](docs/VALIDATION.md) ·
|
|
18
|
-
[Download v0.2.
|
|
21
|
+
[Download v0.2.3](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/releases/tag/v0.2.3)
|
|
19
22
|
|
|
20
23
|
[](docs/DEMO.md)
|
|
21
24
|
|
|
@@ -55,7 +58,7 @@ for proxy authentication and retention.
|
|
|
55
58
|
1. Install the npm package using OpenCode's plugin manager:
|
|
56
59
|
|
|
57
60
|
```sh
|
|
58
|
-
opencode plugin add opencode-azure-devops-pr-review@0.2.
|
|
61
|
+
opencode plugin add opencode-azure-devops-pr-review@0.2.3
|
|
59
62
|
```
|
|
60
63
|
|
|
61
64
|
2. Follow the [quickstart](docs/QUICKSTART.md) to save your PAT in a private
|
|
@@ -130,7 +133,7 @@ general review-accuracy score.
|
|
|
130
133
|
|
|
131
134
|
| Component | Tested target |
|
|
132
135
|
| --- | --- |
|
|
133
|
-
| OpenCode | **OpenCode CLI 2.1.
|
|
136
|
+
| OpenCode | **OpenCode CLI 2.1.4** (`@opencode/cli`; V2 plugin API). OpenCode 1.x is not supported. |
|
|
134
137
|
| Operating system | **Ubuntu 22.04** (validation environment: WSL2). Other operating systems are not yet validated. |
|
|
135
138
|
| Azure | **Azure DevOps Services**, REST API **7.1**. Azure DevOps Server is not supported by the current URL handling. |
|
|
136
139
|
| 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. |
|
|
@@ -152,7 +155,9 @@ for both quick and verified reviews.
|
|
|
152
155
|
read-only tools at exact commits.
|
|
153
156
|
2. Two full-scope reviewers (functional and risk) review the changed files in
|
|
154
157
|
bounded **shards**. A shard that fills its model context is split in half
|
|
155
|
-
and run again instead of failing.
|
|
158
|
+
and run again instead of failing. Reviewer sessions never compact, so
|
|
159
|
+
OpenCode's opt-in `experimental.background_compaction` does not apply to
|
|
160
|
+
them: AZPR refuses its summary requests before anything is sent.
|
|
156
161
|
3. A verifier independently re-checks every candidate finding against the
|
|
157
162
|
source, sharded by finding. Answers that break the output contract get a
|
|
158
163
|
short **correction turn** in the same session; whatever is still unusable is
|
|
@@ -205,14 +210,14 @@ Azure DevOps REST API with the runtime's built-in `fetch`.
|
|
|
205
210
|
Install the npm package with OpenCode's plugin manager:
|
|
206
211
|
|
|
207
212
|
```sh
|
|
208
|
-
opencode plugin add opencode-azure-devops-pr-review@0.2.
|
|
213
|
+
opencode plugin add opencode-azure-devops-pr-review@0.2.3
|
|
209
214
|
```
|
|
210
215
|
|
|
211
216
|
The same release is also a versioned Git package, which needs Git but not the
|
|
212
217
|
npm registry:
|
|
213
218
|
|
|
214
219
|
```sh
|
|
215
|
-
opencode plugin add 'github:WTLAIB/opencode-azure-devops-pr-review-v2#v0.2.
|
|
220
|
+
opencode plugin add 'github:WTLAIB/opencode-azure-devops-pr-review-v2#v0.2.3'
|
|
216
221
|
```
|
|
217
222
|
|
|
218
223
|
Add only one of them. Restart OpenCode, then run `/pr-setup` for setup instructions. Native packages
|
|
@@ -223,7 +228,7 @@ To select another configuration file, use an absolute path in the host config:
|
|
|
223
228
|
```json
|
|
224
229
|
{
|
|
225
230
|
"plugins": [{
|
|
226
|
-
"package": "opencode-azure-devops-pr-review@0.2.
|
|
231
|
+
"package": "opencode-azure-devops-pr-review@0.2.3",
|
|
227
232
|
"options": { "settingsFile": "/absolute/path/to/azpr/settings.json" }
|
|
228
233
|
}]
|
|
229
234
|
}
|
|
@@ -236,14 +241,14 @@ permissions, archive the old installation with its uninstaller, then add the
|
|
|
236
241
|
package. Keep the PAT file and private state directory in place.
|
|
237
242
|
|
|
238
243
|
To upgrade a native installation, change the version in its existing `plugins`
|
|
239
|
-
entry, for example from `#v0.2.
|
|
244
|
+
entry, for example from `#v0.2.2` to `#v0.2.3` for the Git package. To move a
|
|
240
245
|
Git installation to npm, replace that entry's Git specification with
|
|
241
|
-
`opencode-azure-devops-pr-review@0.2.
|
|
246
|
+
`opencode-azure-devops-pr-review@0.2.3`. Both use the same external settings.
|
|
242
247
|
Preserve any `options.settingsFile` and other options; keep one AZPR entry.
|
|
243
248
|
Restart the OpenCode service to load the new version. External settings, the
|
|
244
249
|
PAT file and review records stay in place. Exact versions stay pinned, so
|
|
245
250
|
`opencode plugin update` leaves them unchanged. See the
|
|
246
|
-
[0.2.
|
|
251
|
+
[0.2.3 release notes](docs/releases/v0.2.3.md) for upgrade details and the
|
|
247
252
|
[0.2.0 release notes](docs/releases/v0.2.0.md) for automatic comments, which
|
|
248
253
|
remain disabled unless you configure `afterReview` or request them with a
|
|
249
254
|
review command flag.
|
|
@@ -253,8 +258,8 @@ review command flag.
|
|
|
253
258
|
<details>
|
|
254
259
|
<summary>Source installation and replacement</summary>
|
|
255
260
|
|
|
256
|
-
Download the [v0.2.
|
|
257
|
-
and extract it, or check out tag `v0.2.
|
|
261
|
+
Download the [v0.2.3 source archive](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/archive/refs/tags/v0.2.3.tar.gz)
|
|
262
|
+
and extract it, or check out tag `v0.2.3`. The installer needs POSIX `sh` and
|
|
258
263
|
Python 3's standard library. From that source directory:
|
|
259
264
|
|
|
260
265
|
```sh
|
|
@@ -623,6 +628,7 @@ node tests/host-v2-smoke.mjs /absolute/path/to/opencode
|
|
|
623
628
|
node tests/host-v2-smoke.mjs /absolute/path/to/opencode --replace
|
|
624
629
|
node tests/host-v2-smoke.mjs /absolute/path/to/opencode --native
|
|
625
630
|
node tests/host-v2-comment-scale.mjs /absolute/path/to/opencode
|
|
631
|
+
node tests/host-v2-background-compaction.mjs /absolute/path/to/opencode
|
|
626
632
|
sh uninstall.sh --config-dir /absolute/path/to/v2-opencode-config
|
|
627
633
|
sh uninstall.sh --config-dir /absolute/path/to/v2-opencode-config --apply
|
|
628
634
|
```
|
|
@@ -633,8 +639,8 @@ and a loopback fake Azure DevOps REST service in disposable directories under
|
|
|
633
639
|
Uninstall without `--apply` previews; `--apply` archives only this package under
|
|
634
640
|
`azpr-v2-backups` and leaves the private state directory for you to delete.
|
|
635
641
|
For a native installation, remove the entry you added, for example
|
|
636
|
-
`opencode plugin remove opencode-azure-devops-pr-review@0.2.
|
|
637
|
-
`opencode plugin remove 'github:WTLAIB/opencode-azure-devops-pr-review-v2#v0.2.
|
|
642
|
+
`opencode plugin remove opencode-azure-devops-pr-review@0.2.3` or
|
|
643
|
+
`opencode plugin remove 'github:WTLAIB/opencode-azure-devops-pr-review-v2#v0.2.3'`;
|
|
638
644
|
the external settings, PAT file and private review state remain available.
|
|
639
645
|
|
|
640
646
|
[Architecture](docs/ARCHITECTURE.md), [commenting](docs/COMMENTING.md),
|
|
@@ -647,7 +653,7 @@ or personal model selections.
|
|
|
647
653
|
## License and releases
|
|
648
654
|
|
|
649
655
|
[MIT](LICENSE), copyright 2026 WTLAIB. See the [changelog](CHANGELOG.md) for the
|
|
650
|
-
release scope, [v0.2.
|
|
656
|
+
release scope, [v0.2.3](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/releases/tag/v0.2.3)
|
|
651
657
|
for downloads, the [npm package](https://www.npmjs.com/package/opencode-azure-devops-pr-review),
|
|
652
658
|
[v0.2.0](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/releases/tag/v0.2.0)
|
|
653
659
|
for the recorded demonstration, and [releasing](docs/RELEASING.md) for the
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -113,9 +113,14 @@ After preflight, hooks never re-read settings or catalogs.
|
|
|
113
113
|
reviewer files every concrete defect it finds as a finding: a role's focus
|
|
114
114
|
orders its attention and is not a filter, and `report` carries exclusions,
|
|
115
115
|
advice and limitations only.
|
|
116
|
-
3. **Overflow** — private sessions may not compact. A compaction
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
3. **Overflow** — private sessions may not compact. A compaction the host
|
|
117
|
+
attempts in a reviewer's turn opens its message first and is refused, which
|
|
118
|
+
ends the turn; that message (or a 413) marks the stage as `overflow`, and the
|
|
119
|
+
runtime splits that shard in half and runs both halves (labels
|
|
120
|
+
`shard 1/5a`, `1/5b`). OpenCode's opt-in `experimental.background_compaction`
|
|
121
|
+
(2.1.4) asks for a summary through the same request before the context is
|
|
122
|
+
full and publishes nothing; it is refused before anything is sent and the
|
|
123
|
+
turn goes on, so a later failure is classified by its own cause.
|
|
119
124
|
4. **Verification** — findings are grouped by file into shards of at most
|
|
120
125
|
`workflow.shardFindings`; shards end only between files, so every finding on
|
|
121
126
|
a file reaches the same verifier (a file is split only when it alone has
|
|
@@ -321,7 +326,8 @@ private session gets a grant with the run, role, model and a pending prompt
|
|
|
321
326
|
removed. Ordinary sessions lose only AZPR's tools. Comment pages that read too
|
|
322
327
|
much get their tools removed to force a checkpoint.
|
|
323
328
|
- `model.request`: only primary requests after an authorized context; compaction,
|
|
324
|
-
generation and title requests are refused (compaction
|
|
329
|
+
generation and title requests are refused (a compaction the host attempts
|
|
330
|
+
in the turn ends it as overflow).
|
|
325
331
|
- `retry`: host retries continue only while the grant is active; the announced
|
|
326
332
|
wait does not count as inactivity. OpenCode prepares the resend again
|
|
327
333
|
(`context`, then `model.request`), so it passes the primary-request check.
|
|
@@ -372,6 +378,6 @@ Without `permission.hook` the project boundary for native read tools is left to
|
|
|
372
378
|
the host's own permission rules; `/pr-check` shows a WARNING row and reviews
|
|
373
379
|
still run.
|
|
374
380
|
Receipts note when the detected OpenCode version differs from the tested one
|
|
375
|
-
(`TESTED_HOST_VERSION`, 2.1.
|
|
381
|
+
(`TESTED_HOST_VERSION`, 2.1.4).
|
|
376
382
|
REST paths and the pinned api-version live only in `azure.mjs`; see
|
|
377
383
|
[Azure DevOps access](AZURE_DEVOPS.md) for the API list and version policy.
|
package/docs/AZURE_DEVOPS.md
CHANGED
|
@@ -176,6 +176,9 @@ but AZPR accepts only Azure DevOps Services URLs (`dev.azure.com/<org>` and
|
|
|
176
176
|
|
|
177
177
|
- All calls share one queue (`azure.concurrency`) with a per-call timeout
|
|
178
178
|
(`azure.callTimeoutSeconds`) that aborts the HTTP request and frees the slot.
|
|
179
|
+
AZPR switches off the runtime's own idle limit for these requests (Bun's
|
|
180
|
+
fetch would end a call that receives nothing for five to six minutes), so a
|
|
181
|
+
longer timeout takes effect.
|
|
179
182
|
- Reads retry network errors, timeouts, throttling (429, honouring
|
|
180
183
|
`Retry-After` up to 60 seconds) and 5xx responses twice with backoff.
|
|
181
184
|
- Writes are never retried. A write whose outcome is unknown (timeout, a lost
|
package/docs/DEBUGGING.md
CHANGED
|
@@ -6,12 +6,13 @@ acceptance, Azure source validity or report quality.
|
|
|
6
6
|
|
|
7
7
|
## A startup slash command becomes an ordinary prompt
|
|
8
8
|
|
|
9
|
-
On OpenCode 2.1.2, `opencode --prompt "/pr-review ..."` can
|
|
10
|
-
native Git package's command catalog has loaded. The host then
|
|
11
|
-
as an ordinary model prompt; AZPR has not received the command.
|
|
12
|
-
in local native-package TUI acceptance failures
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
On OpenCode 2.1.2 through 2.1.4, `opencode --prompt "/pr-review ..."` can
|
|
10
|
+
submit before a native Git package's command catalog has loaded. The host then
|
|
11
|
+
treats the text as an ordinary model prompt; AZPR has not received the command.
|
|
12
|
+
This was observed in local native-package TUI acceptance failures on 2.1.2 and
|
|
13
|
+
matches the host's
|
|
14
|
+
[startup submission](https://github.com/anomalyco/opencode/blob/v2.1.4/packages/tui/src/routes/home.tsx#L62)
|
|
15
|
+
and [command classification](https://github.com/anomalyco/opencode/blob/v2.1.4/packages/tui/src/component/prompt/index.tsx#L1153).
|
|
15
16
|
|
|
16
17
|
Start the TUI normally and wait for `/pr-review` to appear in slash-command
|
|
17
18
|
completion before submitting it. A command admitted by AZPR emits its own
|
package/docs/ENTERPRISE.md
CHANGED
|
@@ -6,7 +6,7 @@ MCP dependency. Start with the [quickstart](QUICKSTART.md), then use
|
|
|
6
6
|
this page to understand access, data flow and local retention before reviewing
|
|
7
7
|
your team's repositories.
|
|
8
8
|
|
|
9
|
-
The tested environment is **OpenCode V2 `@opencode/cli` 2.1.
|
|
9
|
+
The tested environment is **OpenCode V2 `@opencode/cli` 2.1.4 on Ubuntu
|
|
10
10
|
22.04**. Azure DevOps Server URLs are not supported. See
|
|
11
11
|
[current validation](VALIDATION.md) for the distinction between isolated tests
|
|
12
12
|
with fake services and runs against real Azure DevOps and model providers.
|
package/docs/QUICKSTART.md
CHANGED
|
@@ -5,7 +5,7 @@ Use a small, active Azure DevOps Services PR for the first run.
|
|
|
5
5
|
|
|
6
6
|
## 1. Check the prerequisites
|
|
7
7
|
|
|
8
|
-
- **OpenCode CLI 2.1.
|
|
8
|
+
- **OpenCode CLI 2.1.4** (`@opencode/cli`, V2 plugin API), tested on **Ubuntu
|
|
9
9
|
22.04.5 LTS (WSL2)**. Other host versions and operating systems are not
|
|
10
10
|
validated; see [validation](VALIDATION.md). OpenCode 1.x is not supported.
|
|
11
11
|
- An authenticated OpenCode model with tool support. Copy its exact
|
|
@@ -24,15 +24,15 @@ Check the host version:
|
|
|
24
24
|
opencode --version
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
## 2. Install v0.2.
|
|
27
|
+
## 2. Install v0.2.3
|
|
28
28
|
|
|
29
|
-
Already using an earlier version? Follow the [upgrade instructions](releases/v0.2.
|
|
29
|
+
Already using an earlier version? Follow the [upgrade instructions](releases/v0.2.3.md#upgrading)
|
|
30
30
|
to preserve your current configuration and use one AZPR installation.
|
|
31
31
|
|
|
32
32
|
In your terminal:
|
|
33
33
|
|
|
34
34
|
```sh
|
|
35
|
-
opencode plugin add opencode-azure-devops-pr-review@0.2.
|
|
35
|
+
opencode plugin add opencode-azure-devops-pr-review@0.2.3
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
Restart OpenCode and open an ordinary conversation. This is the host's native
|
|
@@ -40,7 +40,7 @@ package installation; no npm account or separate build is needed. The
|
|
|
40
40
|
plugin exposes `/pr-setup` even before its review configuration exists.
|
|
41
41
|
|
|
42
42
|
To install the same release from Git instead of the npm registry, use
|
|
43
|
-
`opencode plugin add 'github:WTLAIB/opencode-azure-devops-pr-review-v2#v0.2.
|
|
43
|
+
`opencode plugin add 'github:WTLAIB/opencode-azure-devops-pr-review-v2#v0.2.3'`.
|
|
44
44
|
Add only one of the two.
|
|
45
45
|
|
|
46
46
|
For an existing source installation, keep using `install.sh --replace`, or
|
|
@@ -48,7 +48,7 @@ follow the migration notes in [installation](../README.md#native-package-npm-or-
|
|
|
48
48
|
Do not load both copies in the same OpenCode profile.
|
|
49
49
|
|
|
50
50
|
Prefer a source archive? Download and extract the
|
|
51
|
-
[v0.2.
|
|
51
|
+
[v0.2.3 archive](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/archive/refs/tags/v0.2.3.tar.gz),
|
|
52
52
|
then run `sh install.sh --config-dir /absolute/path/to/your/opencode-config`
|
|
53
53
|
inside it. That directory must be the one your OpenCode actually loads. The
|
|
54
54
|
source installer creates starter settings; add `--replace` to the setup
|
|
@@ -135,7 +135,7 @@ row says whether `/pr-deep` is set up (see below).
|
|
|
135
135
|
|
|
136
136
|
On a host without `permission.hook`, **Project boundary WARNING** means the
|
|
137
137
|
host's own permission rules control where native read tools can read; reviews
|
|
138
|
-
remain available. The tested OpenCode 2.1.
|
|
138
|
+
remain available. The tested OpenCode 2.1.4 host has that hook. `READY` is an
|
|
139
139
|
access check, not a security audit or an approval of the PR.
|
|
140
140
|
|
|
141
141
|
## 5. Run a review and preview its comments
|
package/docs/RELEASING.md
CHANGED
|
@@ -11,8 +11,8 @@ source tree and contain the same runtime.
|
|
|
11
11
|
and download links to that version.
|
|
12
12
|
2. Run `npm run check` and `npm test`. Follow `AGENTS.md` for required host
|
|
13
13
|
checks. Release validation includes fresh and replacement source installs,
|
|
14
|
-
`host-v2-smoke.mjs --native`,
|
|
15
|
-
documented host. Keep simulated services and live model/Azure results distinct.
|
|
14
|
+
`host-v2-smoke.mjs --native`, `host-v2-comment-scale.mjs` and
|
|
15
|
+
`host-v2-background-compaction.mjs` on the exact documented host. Keep simulated services and live model/Azure results distinct.
|
|
16
16
|
3. Inspect `npm pack --dry-run --json`: the entry, runtime modules, prompts,
|
|
17
17
|
configuration example and license must be present; private settings, `.local/`,
|
|
18
18
|
credentials, diagnostics and temporary recordings must be absent. The native
|
package/docs/ROADMAP.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Roadmap
|
|
2
2
|
|
|
3
|
-
Tested with OpenCode CLI 2.1.
|
|
3
|
+
Tested with OpenCode CLI 2.1.4, the Azure DevOps Services REST API
|
|
4
4
|
(api-version 7.1) and Ubuntu 22.04. [Current validation](VALIDATION.md) records what this revision was tested
|
|
5
5
|
with; [validation history](VALIDATION_HISTORY.md) keeps earlier results.
|
|
6
6
|
|
|
@@ -42,8 +42,10 @@ with; [validation history](VALIDATION_HISTORY.md) keeps earlier results.
|
|
|
42
42
|
is STALE. Publication rechecks the head before writing.
|
|
43
43
|
- **Sharded reviews.** Initial reviews run per file shard with disjoint finding-ID
|
|
44
44
|
ranges; verification runs per finding shard; parallelism is bounded.
|
|
45
|
-
- **Context overflow is recovered.** A
|
|
46
|
-
|
|
45
|
+
- **Context overflow is recovered.** A compaction the host attempts in a
|
|
46
|
+
reviewer's turn is refused, which ends the turn as overflow, and the shard is
|
|
47
|
+
split and rerun (validated on the real host). A refused background summary
|
|
48
|
+
(`experimental.background_compaction`) leaves the turn's own failure to decide.
|
|
47
49
|
- **Correction turns.** Answers that break the output contract are corrected in
|
|
48
50
|
the same session (`workflow.repairAttempts`); remaining problems degrade per
|
|
49
51
|
item (UNREVIEWED, NEEDS_INFO, skipped comments) instead of failing the review.
|
package/docs/VALIDATION.md
CHANGED
|
@@ -1,12 +1,41 @@
|
|
|
1
1
|
# Validation
|
|
2
2
|
|
|
3
3
|
This page records validation of the Azure DevOps REST implementation and the
|
|
4
|
-
0.1.0, 0.2.0, 0.2.1 and 0.2.
|
|
4
|
+
0.1.0, 0.2.0, 0.2.1, 0.2.2 and 0.2.3 distributions. Host integration, provider
|
|
5
5
|
admission, source fidelity, model quality and publication are separate claims; a
|
|
6
6
|
passing fixture establishes only the first. Earlier revisions and their live
|
|
7
7
|
acceptance runs, including the MCP-based runs, are preserved in
|
|
8
8
|
[validation history](VALIDATION_HISTORY.md).
|
|
9
9
|
|
|
10
|
+
## 0.2.3 release acceptance (2026-10-24)
|
|
11
|
+
|
|
12
|
+
Environment: Ubuntu 22.04.5 under WSL2, Node 22.23.3 and OpenCode CLI 2.1.4.
|
|
13
|
+
This release carries the OpenCode 2.1.4 changes recorded
|
|
14
|
+
[below](#opencode-214-the-tested-host-2026-10-24): the refused-tunnel mapping,
|
|
15
|
+
the Azure DevOps call timeout and the overflow classification after a refused
|
|
16
|
+
background summary. Prompts, settings and installers are unchanged from 0.2.2.
|
|
17
|
+
|
|
18
|
+
- `npm run check` and **394 offline tests** passed.
|
|
19
|
+
- All five real-host fixture runs passed with isolated profiles and fake model
|
|
20
|
+
and Azure services: fresh source installation, replacement installation,
|
|
21
|
+
native packed package installation, comment scale, and background
|
|
22
|
+
compaction followed by a permanent failure. The fresh and native runs
|
|
23
|
+
include the authenticating proxy, the untrusted certificate and the 407. The
|
|
24
|
+
scale fixture split the overflowing shard and used eight planning sessions
|
|
25
|
+
with at most two in flight; its largest provider request was 33,419
|
|
26
|
+
characters. The background-compaction fixture ran one functional session,
|
|
27
|
+
classified permanent.
|
|
28
|
+
- `npm pack --dry-run --json` lists **70 files** (about 882 KB), including the
|
|
29
|
+
entry, runtime, prompts, configuration example and schema, license and the
|
|
30
|
+
new release notes. It excludes tests, private settings and `.local/` records.
|
|
31
|
+
- The release notes use absolute HTTPS links; the relative links and anchors
|
|
32
|
+
of the README, quickstart, changelog and the changed guides resolve.
|
|
33
|
+
- These fixtures make no paid-model request or real Azure publication. The
|
|
34
|
+
live reviews on 2.1.4 preceded the call-timeout and background-summary
|
|
35
|
+
changes. Public Git installation, archive acceptance, and post-publication
|
|
36
|
+
registry integrity and native installation are checked on the pushed commit
|
|
37
|
+
and the published package as the [releasing guide](RELEASING.md) describes.
|
|
38
|
+
|
|
10
39
|
## 0.2.2 release acceptance (2026-10-23)
|
|
11
40
|
|
|
12
41
|
Environment: Ubuntu 22.04.5 under WSL2, Node 22.23.3 and OpenCode CLI 2.1.2.
|
|
@@ -438,8 +467,9 @@ acceptance above for the subsequent native package and recorded live run.
|
|
|
438
467
|
Ubuntu 22.04.5 LTS (WSL2, kernel 6.18), Node 22.23.3, OpenCode CLI 2.0.22,
|
|
439
468
|
Azure DevOps Services REST api-version 7.1. Date: 2026-10-10. From
|
|
440
469
|
2026-10-17 the tested host was OpenCode CLI 2.0.32
|
|
441
|
-
([below](#opencode-2032-2026-10-17))
|
|
442
|
-
([below](#opencode-212-
|
|
470
|
+
([below](#opencode-2032-2026-10-17)), from 2026-10-22 2.1.2
|
|
471
|
+
([below](#opencode-212-2026-10-22)); since 2026-10-24 it is 2.1.4
|
|
472
|
+
([below](#opencode-214-the-tested-host-2026-10-24)).
|
|
443
473
|
|
|
444
474
|
## Offline tests
|
|
445
475
|
|
|
@@ -578,6 +608,19 @@ provider's own text, classified as permanent, and, end to end, a 429 quota
|
|
|
578
608
|
failure that starts no second session and says why in the receipt; and the
|
|
579
609
|
tested host version. Removing the quota rule from a copy of the code made
|
|
580
610
|
these tests fail.
|
|
611
|
+
The move to OpenCode 2.1.4 (2026-10-24) adds tests for a proxy that refuses
|
|
612
|
+
the CONNECT tunnel as Bun 1.4.4 reports it, a rejection with
|
|
613
|
+
`ERR_PROXY_TUNNEL` and the proxy's status: 407, 403 and 502 keep the messages
|
|
614
|
+
and retry rules of the answers Bun 1.4.2 returned, and a refused tunnel never
|
|
615
|
+
makes a write uncertain. Removing the mapping, the not-sent code or the
|
|
616
|
+
not-forwarded flag from a copy of the code made these tests fail. Every Azure
|
|
617
|
+
DevOps request now also asks the runtime for no idle limit of its own
|
|
618
|
+
(`timeout: false`), so `azure.callTimeoutSeconds` alone ends a silent call;
|
|
619
|
+
removing the option made its test fail. A refused background summary no longer
|
|
620
|
+
marks a stage as overflow: tests cover it followed by an HTTP 401 in the first
|
|
621
|
+
turn and in a follow-up (permanent, no split, the earlier answer stands) and a
|
|
622
|
+
failed turn with and without the host's compaction message. The previous code
|
|
623
|
+
failed them.
|
|
581
624
|
|
|
582
625
|
## REST API version check
|
|
583
626
|
|
|
@@ -631,10 +674,85 @@ rule so the offline runtime tests catch a regression.
|
|
|
631
674
|
| Largest provider request | 31,136 characters (27,185 before the duplicate rules and the diff and search tools) |
|
|
632
675
|
| REST calls | 74 |
|
|
633
676
|
|
|
634
|
-
## OpenCode 2.1.
|
|
677
|
+
## OpenCode 2.1.4, the tested host (2026-10-24)
|
|
678
|
+
|
|
679
|
+
Since 2026-10-24 the tested host is OpenCode CLI 2.1.4 (`TESTED_HOST_VERSION`;
|
|
680
|
+
CI runs the exact-host fixtures with it). 2.1.3 was not tested on its own.
|
|
681
|
+
Reviewing the 137 commits from `v2.1.2` to `v2.1.4` of the OpenCode source and
|
|
682
|
+
running the fixtures found one change AZPR had to absorb, in the proxy
|
|
683
|
+
behaviour of the embedded runtime:
|
|
684
|
+
|
|
685
|
+
| Area | 2.1.2 → 2.1.4 |
|
|
686
|
+
| --- | --- |
|
|
687
|
+
| Plugin context | Every method AZPR calls is unchanged; the plugin package changed only its types. |
|
|
688
|
+
| Hooks AZPR uses | `prompt`, `context`, `model.request` (kinds `primary`, `compaction`, `generate` and `title`), `retry`, `permission.evaluate` and the tool hooks keep their shapes, as do the token counts on assistant messages. |
|
|
689
|
+
| Host constants | The continuation text, the streamed event names and the permission defaults are unchanged. |
|
|
690
|
+
| Runtime | The embedded Bun moved from 1.4.2 to 1.4.4. When a proxy refuses the CONNECT tunnel, for example with HTTP 407, `fetch` now rejects with `ERR_PROXY_TUNNEL` and the proxy's status instead of returning the proxy's answer, and it resets the proxy connection. AZPR maps the rejection to the same proxy messages and retry rules as before, and a refused tunnel never makes a write uncertain. A refused connection is now `ECONNREFUSED` rather than `ConnectionRefused`; AZPR already recognized both. |
|
|
691
|
+
| Compaction | `experimental.background_compaction` (off by default) prepares summaries through the same `compaction` request, which AZPR refuses for private reviewers before anything is sent; the turn goes on. A compaction the host attempts in the turn opens its message first and ends the turn, so overflow is now read from the failed turn's messages (see below). More provider context-overflow errors now reach AZPR as compaction attempts and therefore split the shard. |
|
|
692
|
+
| Models | With a ChatGPT sign-in, the OpenAI context caps moved into a built-in plugin with the same input limits (272,000 tokens; 500,000 for gpt-6.1-sol). A session without its own model now uses its agent's model; AZPR always sets both. |
|
|
693
|
+
| New tools | The experimental TUI terminal tools and client-hosted MCP tools are outside the private roles' allowlist, so reviewers neither see nor run them. |
|
|
694
|
+
|
|
695
|
+
- Exact-host fixtures with 2.1.4 installed into a disposable prefix: with only
|
|
696
|
+
the tested version changed, the fresh and native runs failed in the proxy
|
|
697
|
+
step. The 407 check received `ERR_PROXY_TUNNEL`, AZPR retried it as a
|
|
698
|
+
network error, and the fixture proxy stopped on the reset connection; the
|
|
699
|
+
replacement and comment-scale runs passed. With the mapping and a fixture
|
|
700
|
+
proxy that tolerates a reset, all four passed: fresh, replacement, native
|
|
701
|
+
and comment scale.
|
|
702
|
+
- An external review of this revision found that a refused background summary
|
|
703
|
+
still marked its stage as overflow. On the exact host with background
|
|
704
|
+
compaction on, a functional reviewer whose first response passed the
|
|
705
|
+
background threshold and whose next request failed with HTTP 401 was split
|
|
706
|
+
into new sessions that failed the same way: 7 functional sessions for 4
|
|
707
|
+
files. Overflow is now read from the failed turn's messages. The new
|
|
708
|
+
`host-v2-background-compaction.mjs` fixture passes with one functional
|
|
709
|
+
session classified permanent and fails with the previous code; the other
|
|
710
|
+
four fixtures still pass, including the refused foreground compaction and
|
|
711
|
+
split at scale, whose failed turn holds the host's compaction message (still
|
|
712
|
+
`running` when the turn ended).
|
|
713
|
+
- A probe in each runtime (`BUN_BE_BUN=1 opencode`) showed the difference: for
|
|
714
|
+
407, 403 and 502 answers to CONNECT, Bun 1.4.2 resolves with that status and
|
|
715
|
+
Bun 1.4.4 rejects with `ERR_PROXY_TUNNEL` carrying it; a proxy that closes
|
|
716
|
+
without an answer gives ECONNRESET in both.
|
|
717
|
+
- The same probe found that `fetch` in both runtimes ends a request that
|
|
718
|
+
receives nothing after about 370 seconds unless it passes `timeout: false`.
|
|
719
|
+
`azure.callTimeoutSeconds` accepts up to 1,800 seconds, so a longer setting
|
|
720
|
+
used to end at that point with a retried network error. AZPR now passes
|
|
721
|
+
`timeout: false`, and its own per-call timeout decides. In 2.1.4's runtime,
|
|
722
|
+
AZPR's client sent one comment write to a silent server with a 400-second
|
|
723
|
+
timeout: without the option it ended at 372 seconds with `network error (23)`,
|
|
724
|
+
with it through AZPR's per-call timeout (413 seconds by the wall clock).
|
|
725
|
+
- Upgrade: `npm install -g @opencode/cli@2.1.4`; the background service,
|
|
726
|
+
still running 2.1.2, was then stopped and its database copied before 2.1.4
|
|
727
|
+
first opened it, and the service was started on 2.1.4. With this revision
|
|
728
|
+
`/pr-check` on the 1-file PR was READY without a host notice.
|
|
635
729
|
|
|
636
|
-
|
|
637
|
-
|
|
730
|
+
Live on the upgraded background service with this revision (gpt-6-luna for
|
|
731
|
+
quick and review, `workflow.parallelSessions` 8, each review followed by a
|
|
732
|
+
comment preview; nothing was posted):
|
|
733
|
+
|
|
734
|
+
| PR | Mode | Review | Sessions / requests | Input (cached) | Findings | Preview (inline) |
|
|
735
|
+
| --- | --- | --- | --- | --- | --- | --- |
|
|
736
|
+
| PR #2, 1 file | quick | COMPLETE, 48 s | 1 / 6 | 39 K (60 %) | the 3 known defects | 7 s (0; the PR's threads already discuss all 3) |
|
|
737
|
+
| | review | COMPLETE, 75 s | 3 / 12 | 84 K (52 %) | the 3 known defects | 7 s (0; already discussed) |
|
|
738
|
+
| PR #4, 35 files | quick | COMPLETE, 36 s | 2 / 7 | 167 K (52 %) | no candidate for either seeded regression | 3 s (0) |
|
|
739
|
+
| | review | COMPLETE, 75 s | 5 / 15 | 309 K (55 %) | the seeded regression in the diff | 10 s (1) |
|
|
740
|
+
| PR #3, 316 files | quick | COMPLETE, 136 s | 13 / 51 | 1.81 M (66 %) | all 24 seeded policy defects | 74 s (23) |
|
|
741
|
+
| | review | COMPLETE, 297 s | 30 / 128, 1 correction | 4.45 M (72 %) | all 24 seeded policy defects, no other finding | 98 s (30) |
|
|
742
|
+
|
|
743
|
+
All six reviews and previews completed with no AZPR retry, failed stage,
|
|
744
|
+
inactivity stop, tool timeout, blocked tool, host retry, rejected model request
|
|
745
|
+
or Azure DevOps retry; one reviewer once called a diff tool without its path
|
|
746
|
+
and got the host's argument error. The results stay within gpt-6-luna's range
|
|
747
|
+
on 2.1.2: which of the two seeded regressions in the 35-file PR a run finds
|
|
748
|
+
still varies between runs. These live runs preceded the `timeout: false`
|
|
749
|
+
change, which the fixtures and the probe above cover.
|
|
750
|
+
|
|
751
|
+
## OpenCode 2.1.2 (2026-10-22)
|
|
752
|
+
|
|
753
|
+
From 2026-10-22 to 2026-10-24 the tested host was OpenCode CLI 2.1.2, which
|
|
754
|
+
the user's company ran then (`TESTED_HOST_VERSION`; CI ran the exact-host
|
|
755
|
+
fixtures with it).
|
|
638
756
|
2.1.0 and 2.1.1 were not tested. Reviewing the 146 commits from `v2.0.32` to
|
|
639
757
|
`v2.1.2` of the OpenCode source found nothing AZPR depends on changed:
|
|
640
758
|
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Azure DevOps PR Review for OpenCode — 0.2.3
|
|
2
|
+
|
|
3
|
+
This release moves the tested host to OpenCode CLI 2.1.4 and fixes three
|
|
4
|
+
behaviors that OpenCode 2.1.3 and later expose: how a refused proxy tunnel is
|
|
5
|
+
reported, how long a silent Azure DevOps call may wait, and how a refused
|
|
6
|
+
background summary affects a failed stage. Prompts, settings and installation
|
|
7
|
+
are unchanged.
|
|
8
|
+
|
|
9
|
+
## What changed
|
|
10
|
+
|
|
11
|
+
- **Proxy refusals are explained again.** OpenCode 2.1.3 and later embed Bun
|
|
12
|
+
1.4.4, which rejects a request with `ERR_PROXY_TUNNEL` when a proxy refuses
|
|
13
|
+
the CONNECT tunnel, where Bun 1.4.2 returned the proxy's answer. AZPR treated
|
|
14
|
+
the rejection as a network error and retried it. It now gives the earlier
|
|
15
|
+
messages and retry rules: a missing proxy password is explained as HTTP 407
|
|
16
|
+
without retries, a blocked destination names the proxy, and a refused tunnel
|
|
17
|
+
never leaves a comment write uncertain.
|
|
18
|
+
- **Azure DevOps calls keep their configured timeout.** The runtime's fetch
|
|
19
|
+
ended a request that received nothing for about six minutes by itself, while
|
|
20
|
+
`azure.callTimeoutSeconds` accepts up to 1,800 seconds. AZPR now switches that
|
|
21
|
+
limit off for its requests, so the configured timeout decides.
|
|
22
|
+
- **Background compaction no longer splits a failed stage.** With OpenCode's
|
|
23
|
+
opt-in `experimental.background_compaction`, the host asks for a summary
|
|
24
|
+
before a reviewer's context is full. AZPR refuses it as before, but the
|
|
25
|
+
refusal also marked the stage as overflowing: a later permanent failure,
|
|
26
|
+
such as an expired provider key, split the shard into new sessions that
|
|
27
|
+
failed the same way, and a failed follow-up discarded the answer it
|
|
28
|
+
followed. Overflow is now read from the failed turn itself.
|
|
29
|
+
- The README states that AZPR is an independent community project, not built
|
|
30
|
+
by or affiliated with the OpenCode team.
|
|
31
|
+
|
|
32
|
+
## Installation
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
opencode plugin add opencode-azure-devops-pr-review@0.2.3
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Alternatively, install the same release from Git:
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
opencode plugin add 'github:WTLAIB/opencode-azure-devops-pr-review-v2#v0.2.3'
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Add only one of them. Follow the
|
|
45
|
+
[quickstart](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/blob/v0.2.3/docs/QUICKSTART.md)
|
|
46
|
+
for a private PAT file, `/pr-setup`, a service restart and the first review.
|
|
47
|
+
|
|
48
|
+
## Upgrading
|
|
49
|
+
|
|
50
|
+
Upgrade OpenCode to 2.1.4 first if you can: the receipts of other versions add
|
|
51
|
+
a host notice, and those versions are not validated. Stop the OpenCode service
|
|
52
|
+
and copy its database before upgrading OpenCode, so that you can go back.
|
|
53
|
+
|
|
54
|
+
To update a native installation, edit its existing entry in the OpenCode
|
|
55
|
+
configuration's `plugins` list:
|
|
56
|
+
|
|
57
|
+
- For npm, change the package specification to
|
|
58
|
+
`opencode-azure-devops-pr-review@0.2.3`.
|
|
59
|
+
- For Git, change the tag suffix to `#v0.2.3`.
|
|
60
|
+
|
|
61
|
+
If the entry is an object, change only `package`; preserve `options.settingsFile`
|
|
62
|
+
and any other options. Keep one AZPR entry and restart the OpenCode service.
|
|
63
|
+
External settings, the PAT file and review records remain in place; a working
|
|
64
|
+
configuration needs no new `/pr-setup`. Exact version pins are not advanced by
|
|
65
|
+
`opencode plugin update`.
|
|
66
|
+
|
|
67
|
+
For a source installation, extract the new archive and run its installer with
|
|
68
|
+
`--replace` to retain settings:
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
sh install.sh --config-dir /absolute/path/to/v2-opencode-config --replace
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Coming from 0.1.0, see the
|
|
75
|
+
[0.2.0 upgrade notes](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/blob/v0.2.0/docs/releases/v0.2.0.md#upgrading-from-010)
|
|
76
|
+
for automatic comments, which remain disabled unless configured or requested.
|
|
77
|
+
|
|
78
|
+
## Compatibility and release assets
|
|
79
|
+
|
|
80
|
+
The tested target is OpenCode CLI **2.1.4** (V2 plugin API), Node.js
|
|
81
|
+
**22.23.3**, Ubuntu **22.04.5** under WSL2, and Azure DevOps Services REST API
|
|
82
|
+
**7.1**. OpenCode 1.x and Azure DevOps Server are not supported; other operating
|
|
83
|
+
systems remain unvalidated. See the
|
|
84
|
+
[validation record](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/blob/v0.2.3/docs/VALIDATION.md),
|
|
85
|
+
including live reviews on OpenCode 2.1.4.
|
|
86
|
+
|
|
87
|
+
The npm package comes from this tag and has no dependencies or install scripts.
|
|
88
|
+
Release assets are `opencode-azure-devops-pr-review-v2-0.2.3.tar.gz` and
|
|
89
|
+
`SHA256SUMS`; verify the source archive with `sha256sum -c SHA256SUMS`. The
|
|
90
|
+
existing demonstration remains attached to
|
|
91
|
+
[v0.2.0](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/releases/tag/v0.2.0),
|
|
92
|
+
with its original recording context documented in the
|
|
93
|
+
[demo guide](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/blob/v0.2.3/docs/DEMO.md).
|
package/install.sh
CHANGED
|
@@ -159,7 +159,7 @@ mv -- "$stage/new/$target" "$root/$target"
|
|
|
159
159
|
success=1
|
|
160
160
|
# Informational output only; an unwritable output must not fail a completed install.
|
|
161
161
|
{
|
|
162
|
-
printf '\nAzure PR Review installed (target host: @opencode/cli 2.1.
|
|
162
|
+
printf '\nAzure PR Review installed (target host: @opencode/cli 2.1.4; Ubuntu 22.04).\nSettings: %s\n' "$root/plugins/azpr-v2/settings.json"
|
|
163
163
|
printf 'No installation backup is retained after success. Existing older backups are untouched.\n'
|
|
164
164
|
cat <<'TXT'
|
|
165
165
|
1. Configure models.review.functional/risk/verifier. Configure all three models.deep roles to enable /pr-deep, the same review with models stronger than models.review for the PRs that need them, and models.quick.reviewer to enable /pr-quick.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-azure-devops-pr-review",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.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",
|
|
6
6
|
"scripts": {
|
package/src/azure.mjs
CHANGED
|
@@ -249,8 +249,10 @@ function retryAfterMs(header) {
|
|
|
249
249
|
return Number.isFinite(ms) && ms > 0 ? Math.min(ms, MAX_RETRY_AFTER_MS) : undefined;
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
-
// Fetch error codes: Bun (OpenCode's runtime) reports e.g. ConnectionRefused where Node
|
|
253
|
-
|
|
252
|
+
// Fetch error codes: Bun 1.4.2 (OpenCode's runtime through 2.1.2) reports e.g. ConnectionRefused where Node and
|
|
253
|
+
// Bun 1.4.4 report ECONNREFUSED.
|
|
254
|
+
// ERR_PROXY_TUNNEL: the proxy refused the CONNECT tunnel, so nothing reached Azure DevOps.
|
|
255
|
+
const NOT_SENT_CODES = /^(?:ECONNREFUSED|ConnectionRefused|FailedToOpenSocket|ENOTFOUND|EAI_AGAIN|ERR_PROXY_TUNNEL)$/;
|
|
254
256
|
const UNREACHABLE_CODES = /^(?:ECONNREFUSED|ConnectionRefused|FailedToOpenSocket|ENOTFOUND|EAI_AGAIN|ETIMEDOUT|ENETUNREACH|EHOSTUNREACH)$/;
|
|
255
257
|
const CERTIFICATE_CODES = /^(?:UNABLE_TO_GET_ISSUER_CERT(?:_LOCALLY)?|UNABLE_TO_VERIFY_LEAF_SIGNATURE|SELF_SIGNED_CERT_IN_CHAIN|DEPTH_ZERO_SELF_SIGNED_CERT|CERT_[A-Z_]+|ERR_TLS_CERT_ALTNAME_INVALID)$/;
|
|
256
258
|
// Azure DevOps marks every response it serves; a proxy's own answer does not carry this header.
|
|
@@ -296,15 +298,15 @@ export function createAzureClient({ organization, pat, baseUrl = DEFAULT_BASE_UR
|
|
|
296
298
|
signal.addEventListener('abort', stop, { once: true });
|
|
297
299
|
});
|
|
298
300
|
|
|
299
|
-
/** An answer from a proxy or gateway instead of Azure DevOps. */
|
|
300
|
-
function intermediaryFailure(status, label, method) {
|
|
301
|
+
/** An answer from a proxy or gateway instead of Azure DevOps; `forwarded` is false when it refused the tunnel. */
|
|
302
|
+
function intermediaryFailure(status, label, method, forwarded = true) {
|
|
301
303
|
if (status === 407) {
|
|
302
304
|
return new AzureError(`A proxy refused ${label}: it requires authentication (HTTP 407).`, { kind: 'proxy', status,
|
|
303
305
|
hint: 'Put the proxy user name and password in azure.proxy (http://user:password@host:port, percent-encoded) and restart OpenCode.' });
|
|
304
306
|
}
|
|
305
307
|
// A gateway that already forwarded a write may have delivered it.
|
|
306
308
|
return new AzureError(`A proxy or gateway answered ${label} with HTTP ${status} instead of Azure DevOps (no Azure DevOps response headers).`, {
|
|
307
|
-
kind: 'proxy', status, transient: status === 429 || status >= 500, uncertain: method !== 'GET' && status >= 500,
|
|
309
|
+
kind: 'proxy', status, transient: status === 429 || status >= 500, uncertain: forwarded && method !== 'GET' && status >= 500,
|
|
308
310
|
hint: proxyName ? `Check that the proxy ${proxyName} (azure.proxy) allows dev.azure.com.`
|
|
309
311
|
: 'Check the proxy or firewall between OpenCode and dev.azure.com; set azure.proxy if this network requires one.' });
|
|
310
312
|
}
|
|
@@ -330,7 +332,10 @@ export function createAzureClient({ organization, pat, baseUrl = DEFAULT_BASE_UR
|
|
|
330
332
|
let response;
|
|
331
333
|
try {
|
|
332
334
|
response = await fetchImpl(url, {
|
|
333
|
-
|
|
335
|
+
// Bun's fetch gives up on its own after five to six minutes without data (370 s in Bun 1.4.2 and
|
|
336
|
+
// 1.4.4); the queue's per-call timeout (azure.callTimeoutSeconds, up to 30 minutes) aborts through
|
|
337
|
+
// `signal` instead. Node's fetch ignores the option.
|
|
338
|
+
method, redirect: 'manual', signal, timeout: false,
|
|
334
339
|
headers: { authorization, accept: accept === 'json' ? 'application/json' : 'application/octet-stream',
|
|
335
340
|
...(body === undefined ? {} : { 'content-type': 'application/json' }) },
|
|
336
341
|
...(body === undefined ? {} : { body: JSON.stringify(body) }),
|
|
@@ -340,6 +345,10 @@ export function createAzureClient({ organization, pat, baseUrl = DEFAULT_BASE_UR
|
|
|
340
345
|
if (signal?.aborted) throw signal.reason instanceof Error ? signal.reason : error;
|
|
341
346
|
const code = error?.cause?.code ?? error?.code;
|
|
342
347
|
const known = typeof code === 'string' ? code : '';
|
|
348
|
+
// Bun 1.4.4 (OpenCode 2.1.3 and later) rejects with the proxy's status when it refuses the
|
|
349
|
+
// CONNECT tunnel; Bun 1.4.2 returned that answer as a response.
|
|
350
|
+
const tunnelStatus = known === 'ERR_PROXY_TUNNEL' ? error?.status ?? error?.cause?.status : undefined;
|
|
351
|
+
if (Number.isInteger(tunnelStatus) && tunnelStatus >= 400) throw intermediaryFailure(tunnelStatus, label, method, false);
|
|
343
352
|
// A rejected certificate fails the handshake before anything is sent; retrying cannot help.
|
|
344
353
|
if (CERTIFICATE_CODES.test(known)) {
|
|
345
354
|
throw new AzureError(`Azure DevOps ${label} failed: the server's TLS certificate was not accepted (${clean(known)}).`, { kind: 'tls', code: known, cause: error,
|
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.1.
|
|
9
|
+
export const TESTED_HOST_VERSION = '2.1.4';
|
|
10
10
|
|
|
11
|
-
// Text OpenCode (2.0.32 through 2.1.
|
|
11
|
+
// Text OpenCode (2.0.32 through 2.1.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
|
|
@@ -49,9 +49,9 @@ export function hostCapabilities(context) {
|
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* Session events that show a turn progressing while no hook runs. OpenCode
|
|
52
|
-
* 2.1.2
|
|
53
|
-
* or tool-call input; the projected session context shows the text
|
|
54
|
-
* the step ends.
|
|
52
|
+
* 2.1.2 and 2.1.4 emit one delta event per streamed chunk of answer text,
|
|
53
|
+
* reasoning or tool-call input; the projected session context shows the text
|
|
54
|
+
* only once the step ends.
|
|
55
55
|
*/
|
|
56
56
|
const PROGRESS_EVENTS = new Map([
|
|
57
57
|
...['started', 'delta', 'ended'].map(phase => [`session.text.${phase}`, 'model output was streamed']),
|
|
@@ -71,9 +71,10 @@ export function sessionProgress(event) {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
|
-
* OpenCode runs plugins on Bun (1.4.2 in 2.0.32 and 2.1.2
|
|
75
|
-
* per-request `proxy` and `tls` options. Node's fetch
|
|
76
|
-
* a configured proxy would be bypassed; callers
|
|
74
|
+
* OpenCode runs plugins on Bun (1.4.2 in 2.0.32 and 2.1.2, 1.4.4 in 2.1.4),
|
|
75
|
+
* whose fetch accepts per-request `proxy` and `tls` options. Node's fetch
|
|
76
|
+
* silently ignores both, so a configured proxy would be bypassed; callers
|
|
77
|
+
* refuse instead.
|
|
77
78
|
*/
|
|
78
79
|
export const fetchTransportSupported = () => typeof process.versions?.bun === 'string';
|
|
79
80
|
|
package/src/runtime.mjs
CHANGED
|
@@ -501,7 +501,7 @@ export async function setupAzurePrReview(context, baseDirectory = DEFAULT_DIR, o
|
|
|
501
501
|
requestKinds: { primary: 0, compaction: 0, generate: 0, title: 0, unknown: 0 }, rejectedRequests: 0, retryEvents: [],
|
|
502
502
|
toolCalls: new Map(), completedTools: new Set(), terminalTools: new Map(), failedTools: new Set(),
|
|
503
503
|
returnedTools: new Set(), reportedToolErrors: new Set(), truncatedTools: new Set(), blockedNativeCalls: new Map(),
|
|
504
|
-
toolArgumentCharacters: new Map(), toolTimeouts: 0,
|
|
504
|
+
toolArgumentCharacters: new Map(), toolTimeouts: 0,
|
|
505
505
|
visibleCharacters: input.length, checkpointRequested: false,
|
|
506
506
|
// The planning page whose sessions this grant serves; its tool evidence is that page's.
|
|
507
507
|
commentPage: payload.commentWork?.page ?? null,
|
|
@@ -531,7 +531,7 @@ export async function setupAzurePrReview(context, baseDirectory = DEFAULT_DIR, o
|
|
|
531
531
|
catch (error) {
|
|
532
532
|
// A follow-up is optional: when it or a later turn fails, the answer it
|
|
533
533
|
// followed stands. Cancellation and context overflow keep their rules.
|
|
534
|
-
const failureClass = runSignal.aborted ? 'cancelled' : watch.error ? 'idle' : classifyFailure(error
|
|
534
|
+
const failureClass = runSignal.aborted ? 'cancelled' : watch.error ? 'idle' : classifyFailure(error);
|
|
535
535
|
if (!followUp || ['cancelled', 'overflow'].includes(failureClass)) throw error;
|
|
536
536
|
Object.assign(followUp, { outcome: 'failed', failureClass, error: errorText(watch.error ?? error).slice(0, 300) });
|
|
537
537
|
if (error?.response && settings.debug.enabled) await run.debug.write(`${stem}.response-${followUp.turn === turn ? 'follow-up' : 'repair'}${turn}.json`, diagnosticResponse(error.response));
|
|
@@ -594,7 +594,7 @@ export async function setupAzurePrReview(context, baseDirectory = DEFAULT_DIR, o
|
|
|
594
594
|
record.error = errorText(error);
|
|
595
595
|
if (error?.execution) record.execution = { ...error.execution, authorizedPrimaryRequests: g.calls };
|
|
596
596
|
if (idle) record.idleStop = watch.idleStop;
|
|
597
|
-
const failureClass = runSignal.aborted ? 'cancelled' : idle ? 'idle' : classifyFailure(error
|
|
597
|
+
const failureClass = runSignal.aborted ? 'cancelled' : idle ? 'idle' : classifyFailure(error);
|
|
598
598
|
record.failureClass = failureClass;
|
|
599
599
|
if (error instanceof Error) error.failureClass = failureClass;
|
|
600
600
|
grants.delete(made.id);
|
|
@@ -1119,10 +1119,11 @@ export async function setupAzurePrReview(context, baseDirectory = DEFAULT_DIR, o
|
|
|
1119
1119
|
if (observed) observed.requestKinds[kind]++;
|
|
1120
1120
|
try {
|
|
1121
1121
|
const g = authorize(event.sessionID, event.agent, event.model);
|
|
1122
|
+
// Refused before anything is sent. Whether the stage overflowed is read from its failed turn: a
|
|
1123
|
+
// compaction OpenCode attempts there ends it, a background summary (OpenCode 2.1.4) does not.
|
|
1122
1124
|
if (event.kind !== 'primary') {
|
|
1123
|
-
if (event.kind === 'compaction') g.compactionRequested = true;
|
|
1124
1125
|
throw new Error(event.kind === 'compaction'
|
|
1125
|
-
? '[AZPR] Private review compaction is not authorized;
|
|
1126
|
+
? '[AZPR] Private review compaction is not authorized; a reviewer whose context fills is split into smaller sessions instead.'
|
|
1126
1127
|
: '[AZPR] Auxiliary model requests are not authorized for private reviewers.');
|
|
1127
1128
|
}
|
|
1128
1129
|
if (!g.admitted || !g.primaryPrepared) throw new Error('[AZPR] Model request has no authorized primary context.');
|
|
@@ -1152,7 +1153,7 @@ export async function setupAzurePrReview(context, baseDirectory = DEFAULT_DIR, o
|
|
|
1152
1153
|
// Enforce the shell setting and the project boundary, regardless of
|
|
1153
1154
|
// permission rules the host appends after this plugin. Outside the
|
|
1154
1155
|
// project only AZPR's own private data is readable; the host's default
|
|
1155
|
-
// for other paths is not trusted (OpenCode 2.0.22 asked; 2.0.31 through 2.1.
|
|
1156
|
+
// for other paths is not trusted (OpenCode 2.0.22 asked; 2.0.31 through 2.1.4 allow).
|
|
1156
1157
|
// Private reviewers run unattended: a request that would wait for
|
|
1157
1158
|
// approval is refused at once. Only shell keeps host approvals, and only
|
|
1158
1159
|
// when the user allowed it (shell: "ask" or "inherit").
|
package/src/session.mjs
CHANGED
|
@@ -165,15 +165,18 @@ export function restartIndex(texts) {
|
|
|
165
165
|
|
|
166
166
|
/**
|
|
167
167
|
* Classify a failed stage for the runtime's retry policy.
|
|
168
|
-
* - overflow: the host
|
|
168
|
+
* - overflow: the host attempted compaction in the failed turn (context full) or
|
|
169
|
+
* the provider rejected size. A refused background summary
|
|
170
|
+
* (`experimental.background_compaction`) is not evidence: the turn went on, so
|
|
171
|
+
* its own failure decides.
|
|
169
172
|
* - transient: interrupted streams, provider 408/409/425/429/5xx, missing idle,
|
|
170
173
|
* unexpected host messages.
|
|
171
174
|
* - permanent: everything else (authentication, bad request, a used-up quota or
|
|
172
175
|
* free-model limit, whatever its HTTP status, cancellation).
|
|
173
176
|
*/
|
|
174
|
-
export function classifyFailure(error
|
|
175
|
-
if (compactionRequested) return 'overflow';
|
|
177
|
+
export function classifyFailure(error) {
|
|
176
178
|
const execution = error?.execution;
|
|
179
|
+
if (execution?.compaction) return 'overflow';
|
|
177
180
|
if (execution?.interrupted || execution?.provider?.exhausted) return 'permanent';
|
|
178
181
|
const status = execution?.provider?.status;
|
|
179
182
|
if (status === 413) return 'overflow';
|
|
@@ -231,6 +234,10 @@ export async function requestReview(context, { sessionID, text, role, model, met
|
|
|
231
234
|
terminalOutcome: terminal?.type === 'idle' ? outcome(terminal.outcome) : 'missing-idle',
|
|
232
235
|
assistantResponses: assistants.length, lastFinish: finish,
|
|
233
236
|
interrupted: session.outcome === 'interrupted' || terminal?.outcome === 'interrupted' || final?.error?.type === 'aborted' };
|
|
237
|
+
// OpenCode opens a compaction's message before it asks for the summary, so a compaction it attempted in this
|
|
238
|
+
// turn, which AZPR refuses, shows here. A background summary (OpenCode 2.1.4) publishes nothing.
|
|
239
|
+
const compaction = turn.filter(message => message?.type === 'compaction').at(-1);
|
|
240
|
+
if (compaction) execution.compaction = ['running', 'completed', 'failed'].includes(compaction.status) ? compaction.status : 'unknown';
|
|
234
241
|
const provider = !execution.interrupted && providerFailure(final, assistants);
|
|
235
242
|
if (provider) execution.provider = provider;
|
|
236
243
|
const hint = provider?.exhausted
|