opencode-azure-devops-pr-review 0.4.3 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -45,6 +45,15 @@ is an actual capture excerpt with identifying UI removed and its text unchanged.
45
45
 
46
46
  </details>
47
47
 
48
+ ## Watch the workflow
49
+
50
+ [![Real OpenCode run: a review starts and a panel beside the conversation lists its sessions, with a step at its foot that stops the run; the panel then shows the report and the comment preview rendered, with the next step at its foot, and the findings as a list.](docs/assets/terminal-panel-teaser.gif)](docs/DEMO.md#the-terminal-panel)
51
+
52
+ *A 15-second edit of a real OpenCode 2.3.0 session on a dedicated test PR.
53
+ Waiting time is shortened, so the length is not the review duration.
54
+ [Recording details and other walkthroughs](docs/DEMO.md), among them
55
+ [adjusting findings before publishing](docs/DEMO.md#adjust-findings-before-publishing).*
56
+
48
57
  ## Your first review
49
58
 
50
59
  1. Install the npm package using OpenCode's plugin manager (already installed?
@@ -52,15 +61,16 @@ is an actual capture excerpt with identifying UI removed and its text unchanged.
52
61
  [company networks](docs/ENTERPRISE.md#company-networks) first):
53
62
 
54
63
  ```sh
55
- opencode plugin add opencode-azure-devops-pr-review@0.4.3
64
+ opencode plugin add opencode-azure-devops-pr-review@0.4.5
56
65
  ```
57
66
 
58
67
  2. In OpenCode's terminal UI, type `/pr-setup`. Dialogs ask for your Azure
59
68
  DevOps organization, a proxy if your network needs one, your token (PAT) and
60
69
  a model. AZPR checks the token with Azure DevOps, saves it in a file only
61
70
  you can read, and is ready at once: no restart. The
62
- [quickstart](docs/QUICKSTART.md) walks through it; in another client, such
63
- as the desktop app, see
71
+ [quickstart](docs/QUICKSTART.md#3-set-azpr-up-opencodes-terminal-ui) walks
72
+ through it with a recording of the dialogs; in another client, such as the
73
+ desktop app, see
64
74
  [without the terminal UI](docs/QUICKSTART.md#without-the-terminal-ui).
65
75
  3. In one OpenCode conversation, check access, then review:
66
76
 
@@ -80,12 +90,20 @@ For a lighter first pass, use `/pr-quick <PR URL>`; its findings are not
80
90
  independently verified. Every command answers `--help` with its options,
81
91
  without a model.
82
92
 
93
+ In OpenCode's terminal UI a [panel](#terminal-panel) opens beside the
94
+ conversation: it shows the report and the preview rendered, and at its foot
95
+ what you can do next, without typing a command. While the review runs that is
96
+ **Stop this run…**. After the preview, pick **Post N comments…** there, or
97
+ leave findings out first with **Adjust findings…**. Stopping and posting
98
+ always ask once more.
99
+
83
100
  <details>
84
101
  <summary>Optional: adjust findings and publish after reading the preview</summary>
85
102
 
86
- Read the preview; it ends with the commands for the next step. Before
87
- publishing, you can leave findings out or change their severity, using the
88
- finding IDs the preview and the report show:
103
+ Read the preview; it ends with the commands for the next step, and the
104
+ terminal panel lists the same steps at its foot, to pick. Before publishing,
105
+ you can leave findings out or change their severity, using the finding IDs the
106
+ preview and the report show:
89
107
 
90
108
  ```text
91
109
  /pr-comment --exclude F-1,R-2 leave two findings out
@@ -137,6 +155,33 @@ to your selected model providers, and review records are saved locally. See
137
155
  [team setup and data handling](docs/ENTERPRISE.md) and
138
156
  [content-search limits](docs/AZURE_DEVOPS.md#who-calls-what).
139
157
 
158
+ ## Choose a review
159
+
160
+ | Command | Best starting point | What runs |
161
+ | --- | --- | --- |
162
+ | `/pr-quick` | Small or routine changes | One reviewer per shard covers function and risk. Findings are **reported, not independently verified**. |
163
+ | `/pr-review` | Changes that need an independent second check | Functional and risk reviewers, followed by separate verification sessions. |
164
+ | `/pr-deep` | Important or risky changes worth a stronger model | The same verified pipeline as `/pr-review`, run with the stronger models you set in `models.deep`; usually slower and costlier. |
165
+
166
+ All three modes use the same Azure comment layout. Quick comments disclose their
167
+ method. Separate verification adds scrutiny; it does not guarantee correct
168
+ findings or complete defect coverage. Mixing models is a choice about capability
169
+ and cost, not a proven accuracy improvement. See [model configuration](#configuration).
170
+
171
+ <details>
172
+ <summary>Sessions, model requests and cost</summary>
173
+
174
+ For a small PR that fits in one shard and one comment-planning page, quick
175
+ usually needs one review session plus one planning session; review needs two
176
+ reviewer sessions, a verifier and comment planning, plus a short severity
177
+ rating when `models.review.rater` is set.
178
+ **Sessions are not API requests:** each can make multiple requests, and repairs, retries, larger PRs
179
+ and extra planning pages add work. Previewing comments also uses a model.
180
+ See [measured runs and their limits](docs/VALIDATION.md) for cost and timing
181
+ examples, rather than treating a session count as a price guarantee.
182
+
183
+ </details>
184
+
140
185
  ## Benchmark results
141
186
 
142
187
  On Martian's open [Code Review Bench](https://codereview.withmartian.com),
@@ -211,6 +256,14 @@ the [validation record](docs/VALIDATION.md#martian-code-review-bench-2026-11-05-
211
256
 
212
257
  ### Checked on a second benchmark
213
258
 
259
+ Two later releases were checked on ReviewBench's test set, which was not used
260
+ to write their changes: recall stayed within the run-to-run variation, and
261
+ agreement with the judge on which findings deserve an inline comment rose from
262
+ 70.0 (0.3.5) to 83.0 (0.3.7).
263
+
264
+ <details>
265
+ <summary>The ReviewBench runs of 0.3.5, 0.3.6 and 0.3.7</summary>
266
+
214
267
  0.3.6 changed two reviewer instructions because of issues this run missed:
215
268
  defects in code a pull request moves unchanged, and findings dropped because
216
269
  the behavior might be intended. They were written after reading three of the
@@ -249,40 +302,6 @@ medium issues found by 0.6, both within the variation allowed for 0.3.6. The
249
302
  runs and their limits are under
250
303
  [severity from verified harm](docs/VALIDATION.md#severity-from-verified-harm-2026-11-11-and-12).
251
304
 
252
- ## Watch the workflow
253
-
254
- [![Real OpenCode run: a review starts, a panel beside the conversation lists its sessions, then shows the report and the comment preview rendered.](docs/assets/terminal-panel-teaser.gif)](docs/DEMO.md#the-terminal-panel)
255
-
256
- *A 15-second edit of a real OpenCode 2.3.0 session on a dedicated test PR.
257
- Waiting time is shortened, so the length is not the review duration.
258
- [Recording details and other walkthroughs](docs/DEMO.md), among them
259
- [adjusting findings before publishing](docs/DEMO.md#adjust-findings-before-publishing).*
260
-
261
- ## Choose a review
262
-
263
- | Command | Best starting point | What runs |
264
- | --- | --- | --- |
265
- | `/pr-quick` | Small or routine changes | One reviewer per shard covers function and risk. Findings are **reported, not independently verified**. |
266
- | `/pr-review` | Changes that need an independent second check | Functional and risk reviewers, followed by separate verification sessions. |
267
- | `/pr-deep` | Important or risky changes worth a stronger model | The same verified pipeline as `/pr-review`, run with the stronger models you set in `models.deep`; usually slower and costlier. |
268
-
269
- All three modes use the same Azure comment layout. Quick comments disclose their
270
- method. Separate verification adds scrutiny; it does not guarantee correct
271
- findings or complete defect coverage. Mixing models is a choice about capability
272
- and cost, not a proven accuracy improvement. See [model configuration](#configuration).
273
-
274
- <details>
275
- <summary>Sessions, model requests and cost</summary>
276
-
277
- For a small PR that fits in one shard and one comment-planning page, quick
278
- usually needs one review session plus one planning session; review needs two
279
- reviewer sessions, a verifier and comment planning, plus a short severity
280
- rating when `models.review.rater` is set.
281
- **Sessions are not API requests:** each can make multiple requests, and repairs, retries, larger PRs
282
- and extra planning pages add work. Previewing comments also uses a model.
283
- See [measured runs and their limits](docs/VALIDATION.md) for cost and timing
284
- examples, rather than treating a session count as a price guarantee.
285
-
286
305
  </details>
287
306
 
288
307
  ## Is this the right workflow?
@@ -325,11 +344,18 @@ for both quick and verified reviews.
325
344
  | Install AZPR and run a first review | [Step-by-step quickstart](docs/QUICKSTART.md) |
326
345
  | Upgrade an existing installation | [Upgrade instructions](#upgrading) |
327
346
  | Choose models, language or settings | [Configuration](#configuration) |
347
+ | Look up one setting | [All settings and defaults](#all-settings-and-defaults) |
348
+ | Look up a command or a status | [Commands](#commands) |
349
+ | Read reports and pick the next step beside the conversation | [Terminal panel](#terminal-panel) |
328
350
  | Adjust, preview or publish comments | [Commenting guide](docs/COMMENTING.md) |
329
351
  | Set up a company proxy or understand data handling | [Team setup](docs/ENTERPRISE.md) |
330
352
  | Understand what has been tested | [Validation and limitations](docs/VALIDATION.md) |
331
353
  | Troubleshoot or contribute | [Debugging](docs/DEBUGGING.md) · [Contributing](CONTRIBUTING.md) |
332
354
 
355
+ The sections below are reference: how reviews work, installation and
356
+ upgrading, configuration with every setting, the commands, the terminal panel,
357
+ comments, and what is kept on your machine.
358
+
333
359
  ## How reviews work
334
360
 
335
361
  <details>
@@ -387,7 +413,8 @@ acknowledge `STARTED` and continue in the current OpenCode process; short
387
413
  `PROGRESS` notices and a final receipt return to the invoking conversation.
388
414
  They start no response of that conversation's own model; when you prompt it
389
415
  later, it reads them together with your prompt, in one request. Use
390
- the displayed `/pr-stop <run-id>` to cancel. `/pr-setup` (including `--help`),
416
+ the displayed `/pr-stop <run-id>` to cancel, or **Stop this run…** at the
417
+ foot of the [terminal panel](#terminal-panel). `/pr-setup` (including `--help`),
391
418
  `/pr-stop`, `/pr-comment --show`, an adjustment that changes nothing and a
392
419
  refused command answer directly, without a background run.
393
420
  Completed reviews, previews and publication ledgers are saved privately and
@@ -408,14 +435,14 @@ Azure DevOps REST API with the runtime's built-in `fetch`.
408
435
  Install the npm package with OpenCode's plugin manager:
409
436
 
410
437
  ```sh
411
- opencode plugin add opencode-azure-devops-pr-review@0.4.3
438
+ opencode plugin add opencode-azure-devops-pr-review@0.4.5
412
439
  ```
413
440
 
414
441
  The same release is also a versioned Git package, which needs Git but not the
415
442
  npm registry:
416
443
 
417
444
  ```sh
418
- opencode plugin add 'github:WTLAIB/opencode-azure-devops-pr-review-v2#v0.4.3'
445
+ opencode plugin add 'github:WTLAIB/opencode-azure-devops-pr-review-v2#v0.4.5'
419
446
  ```
420
447
 
421
448
  Add only one of them. OpenCode 2.3.0 loads the plugin into a running OpenCode
@@ -430,7 +457,7 @@ To select another configuration file, use an absolute path in the host config:
430
457
  ```json
431
458
  {
432
459
  "plugins": [{
433
- "package": "opencode-azure-devops-pr-review@0.4.3",
460
+ "package": "opencode-azure-devops-pr-review@0.4.5",
434
461
  "options": { "settingsFile": "/absolute/path/to/azpr/settings.json" }
435
462
  }]
436
463
  }
@@ -455,7 +482,7 @@ For an entry that `opencode plugin add` created, add the new version and,
455
482
  only when that succeeds, remove the previous one:
456
483
 
457
484
  ```sh
458
- opencode plugin add opencode-azure-devops-pr-review@0.4.3 &&
485
+ opencode plugin add opencode-azure-devops-pr-review@0.4.5 &&
459
486
  opencode plugin remove opencode-azure-devops-pr-review@PREVIOUS_VERSION
460
487
  ```
461
488
 
@@ -487,7 +514,9 @@ the first one (`Unknown setting settings.terminalPanel`) instead of starting. `o
487
514
  show a single `azpr` row with the new version (from 0.3.1, `/pr-check` names
488
515
  it too); if it still shows the previous one, run `opencode service restart`.
489
516
  Exact versions stay pinned, so `opencode plugin update` leaves them unchanged.
490
- See the [0.4.3 release notes](docs/releases/v0.4.3.md) for what changed, the
517
+ See the [0.4.5 release notes](docs/releases/v0.4.5.md) for what changed, the
518
+ [0.4.4 release notes](docs/releases/v0.4.4.md) for the steps at the panel's foot, the
519
+ [0.4.3 release notes](docs/releases/v0.4.3.md) for setup in the terminal UI, the
491
520
  [0.4.0 release notes](docs/releases/v0.4.0.md) for commands without review IDs and the
492
521
  [0.2.0 release notes](docs/releases/v0.2.0.md) for automatic comments. A
493
522
  preview follows each COMPLETE review unless `afterReview` says otherwise;
@@ -499,8 +528,8 @@ review command flag.
499
528
  <details>
500
529
  <summary>Source installation and replacement</summary>
501
530
 
502
- Download the [v0.4.3 source archive](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/archive/refs/tags/v0.4.3.tar.gz)
503
- and extract it, or check out tag `v0.4.3`. The installer needs POSIX `sh` and
531
+ Download the [v0.4.5 source archive](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/archive/refs/tags/v0.4.5.tar.gz)
532
+ and extract it, or check out tag `v0.4.5`. The installer needs POSIX `sh` and
504
533
  Python 3's standard library. From that source directory:
505
534
 
506
535
  ```sh
@@ -527,7 +556,7 @@ sh install.sh --config-dir /absolute/path/to/v2-opencode-config --replace
527
556
  ### Manual copying without Git
528
557
 
529
558
  Keep these relative paths under one source directory, then run its installer.
530
- These **35 files** include the runtime and its license:
559
+ These **36 files** include the runtime and its license:
531
560
 
532
561
  <details>
533
562
  <summary>Show the required files</summary>
@@ -558,6 +587,7 @@ src/review-work.mjs
558
587
  src/store.mjs
559
588
  src/tui-model.mjs
560
589
  src/tui-setup.mjs
590
+ src/tui-actions.mjs
561
591
  src/tui.js
562
592
  src/prompts/common.md
563
593
  src/prompts/functional.md
@@ -594,6 +624,12 @@ they started with.
594
624
  In OpenCode's terminal UI, `/pr-setup` without options opens dialogs. The
595
625
  command palette has them too ("AZPR: settings").
596
626
 
627
+ [![The dialogs of a first setup in OpenCode's terminal UI: the organization, a proxy that Enter skips, the token in a field that shows only bullets and a count, a model from OpenCode's list, what will be saved, and "AZPR is set up".](docs/assets/setup-dialogs.gif)](docs/QUICKSTART.md#3-set-azpr-up-opencodes-terminal-ui)
628
+
629
+ *AZPR's dialogs in OpenCode 2.3.0's terminal UI, recorded with a test
630
+ organization and token and a stand-in for Azure DevOps; waiting time is
631
+ shortened.*
632
+
597
633
  - **First setup.** Your organization (its name, or the URL of a pull request);
598
634
  a proxy, only if your network needs one (Enter skips it; after a proxy, the
599
635
  CA certificate file of a company that inspects HTTPS, which Enter skips
@@ -620,7 +656,18 @@ command palette has them too ("AZPR: settings").
620
656
  saved for the organization it was checked for; the two are saved together,
621
657
  the new token in a new file beside the first, and AZPR says where the
622
658
  earlier token still is.
623
- The other settings are in the settings file, which the list names.
659
+ The list says what each model is for, and the deep model's dialog what makes
660
+ one: a model stronger than the review model, or the same model with a higher
661
+ variant.
662
+ The other settings are in the settings file, which the list names together
663
+ with the section that describes them all:
664
+ [all settings and defaults](#all-settings-and-defaults).
665
+
666
+ ![OpenCode's terminal UI with the list of AZPR's settings open: the organization, the access token, the proxy and the CA certificate file, then the review, quick and deep models, each with what it is for and its value.](docs/assets/setup-settings.png)
667
+
668
+ *The list goes on below what is shown: the settings of reviews, of the terminal
669
+ UI and of diagnostics, and the settings file. Recorded like the picture above,
670
+ with test values.*
624
671
 
625
672
  The dialogs only ask. The plugin's server part checks every answer, writes
626
673
  the two files, and is the only part that contacts Azure DevOps. Other OpenCode
@@ -693,10 +740,12 @@ Model IDs use `provider/model` form and must exist in OpenCode. To choose a
693
740
  model variant such as a reasoning effort, use OpenCode's `provider/model#variant`
694
741
  form (for example `provider/model#high`); `/pr-check` reports a variant the
695
742
  model does not offer. Without a variant the model's default is used. `/pr-deep`
696
- needs all three deep models and never falls back to the review models; choose
697
- models stronger than the review models there, since the models are the only
698
- difference from `/pr-review`. The [benchmark results](#benchmark-results)
699
- include a measured choice for `models.deep`. Likewise `/pr-quick` needs `models.quick.reviewer`,
743
+ needs all three deep models and never falls back to the review models; make
744
+ them stronger than the review models, since the models are the only
745
+ difference from `/pr-review`: a stronger model, or the same model with a
746
+ higher variant (`provider/model#high`), which reasons longer. The
747
+ [benchmark results](#benchmark-results) include a measured choice for
748
+ `models.deep` and compare the effort levels of one model. Likewise `/pr-quick` needs `models.quick.reviewer`,
700
749
  and a command checks only the models it uses, so an unavailable quick model
701
750
  never blocks `/pr-review`. Comment planning uses the review's risk model
702
751
  (`models.deep.risk` for a deep review, the quick reviewer for a quick review).
@@ -734,6 +783,9 @@ reviewer's confidence, the size of the fix or the kind of issue:
734
783
  - **low** (can wait): anything else, such as a recoverable failure that only a
735
784
  rare trigger reaches, or an issue with no effect on behavior.
736
785
 
786
+ <details>
787
+ <summary>More on severity, and on what counts as a finding</summary>
788
+
737
789
  A rare trigger lowers the severity; it does not keep a defect out of the
738
790
  findings. Neither does the code's history: a defect on lines the PR adds or
739
791
  moves is a finding even when the same code existed before (a function moved to
@@ -763,10 +815,13 @@ that each need their own fix is one finding per place. Identical copies of one f
763
815
  count as one place when one reviewer has them; in a large PR split into shards,
764
816
  copies that different reviewers get can each produce a finding.
765
817
 
818
+ </details>
819
+
766
820
  ### All settings and defaults
767
821
 
768
- <details>
769
- <summary>Show the settings reference</summary>
822
+ Every setting is in the settings file, each at its default until you change
823
+ it; `/pr-setup` names the file and changes the common ones. After a change,
824
+ restart the OpenCode service.
770
825
 
771
826
  | Setting | Default and meaning |
772
827
  | --- | --- |
@@ -804,8 +859,6 @@ into `azure`). There is deliberately no per-stage step cap; see the
804
859
  (`workflow.stageIdleSeconds`) is not one: it stops only a stage that stopped
805
860
  working.
806
861
 
807
- </details>
808
-
809
862
  ### Azure DevOps access
810
863
 
811
864
  AZPR talks to the Azure DevOps Services REST API itself (api-version 7.1). Create
@@ -853,12 +906,13 @@ troubleshooting.
853
906
  | `/pr-review <PR URL> [flag] [context]` | Sharded functional and risk reviews, then sharded verification. |
854
907
  | `/pr-deep <PR URL> [flag] [context]` | The same review with the stronger models of `models.deep`; usually slower and costlier. |
855
908
  | `/pr-quick <PR URL> [flag] [context]` | One reviewer per shard for both focuses, no verification; findings are reported, not verified. |
856
- | `/pr-stop [run-id]` | Cancel this conversation's active command. |
909
+ | `/pr-stop [run-id]` | Cancel this conversation's active command. The terminal panel offers the same while a run is under way (**Stop this run…**). |
857
910
  | `/pr-comment [review-id]` | Preview comments for this conversation's current review. |
858
911
  | `/pr-comment [review-id] --publish` | Post the saved preview. A review that was never adjusted is planned first if needed; an adjusted one needs its new preview. Safe to repeat. |
859
912
  | `/pr-comment [review-id] --show` | Show the saved preview again; no model or Azure DevOps request. |
860
913
  | `/pr-comment [review-id] --exclude <IDs>` / `--severity <ID=level,…>` / `--reset` | Leave findings out or change their severity after reading the preview, then preview again, for example `--exclude F-1,R-2` (see [adjusting findings](docs/COMMENTING.md#adjusting-findings-after-a-preview)). |
861
914
  | `/pr-comment --list` | The reviews saved for this conversation, with their IDs, PRs and state; no model or Azure DevOps request. |
915
+ | `/pr-comment … --seen <word>` | What the terminal panel adds to the commands it sends: the word names the preview and the adjustments its step was offered for, and the command is refused when they have changed since. A typed command needs none. |
862
916
  | `/<command> --help` | The command's usage and examples; no model or Azure DevOps request. |
863
917
 
864
918
  A `/pr-comment` command without a review ID acts on the conversation's
@@ -877,7 +931,8 @@ an option (`--no-coment`, `-p`) is refused, so start your context with a word.
877
931
  Text after the URL (and the flag) is supplementary context for that command
878
932
  only. PR content, comments and tool responses are untrusted data.
879
933
 
880
- Status meanings:
934
+ <details>
935
+ <summary>Status meanings: COMPLETE, STALE, PARTIAL, and what a quick review states</summary>
881
936
 
882
937
  - **COMPLETE**: verification produced structured decisions and no source-commit
883
938
  change was detected. Findings without a usable decision are listed as
@@ -908,6 +963,8 @@ A failed final version recheck adds a warning; it does not by itself prevent
908
963
  COMPLETE in any review mode. Read the receipt warnings. Publication separately
909
964
  rechecks that the PR's source commit is unchanged before posting.
910
965
 
966
+ </details>
967
+
911
968
  In OpenCode's terminal UI, `/pr-panel` shows or hides the
912
969
  [terminal panel](#terminal-panel); it runs no model and makes no Azure DevOps
913
970
  request.
@@ -917,9 +974,12 @@ request.
917
974
  OpenCode shows what a plugin tells a conversation as plain text, so a report
918
975
  or a comment preview appears there as Markdown source. In OpenCode's terminal
919
976
  UI, AZPR therefore adds a panel beside the conversation: it shows the newest
920
- report or preview rendered, and lists the sessions of the review so that you
921
- can open one. The [recording of a real review](docs/DEMO.md#the-terminal-panel)
922
- shows both side by side.
977
+ report or preview rendered, lists the sessions of the review so that you can
978
+ open one, and lists at its foot what you can do next (stop a run that is
979
+ under way; after a preview, post it or adjust its findings), so that you pick
980
+ a step instead of typing its command. The
981
+ [recording of a real review](docs/DEMO.md#the-terminal-panel) shows the report
982
+ and the conversation side by side.
923
983
 
924
984
  - **It opens by itself** when a review or a comment run starts and when a
925
985
  report or preview arrives, in the conversation that is on screen. The
@@ -932,26 +992,71 @@ shows both side by side.
932
992
  ```
933
993
 
934
994
  - **Sessions.** While a review runs, each of its sessions is a row with its
935
- state. Click a row to open that session; OpenCode opens it in a tab, and the
995
+ state: `running` while its model works, `finished` once it has answered, and
996
+ the stage's result (`complete`, `failed`) when the run's receipt names it.
997
+ Click a row to open that session; OpenCode opens it in a tab, and the
936
998
  panel is there again when you return to the conversation. After the review
937
999
  the rows are the sessions that still exist (see
938
1000
  [retention](#retention-and-privacy)), first the one that holds the report.
939
1001
  OpenCode's own session list has them too.
940
1002
  - **Report or preview.** Below the sessions: the report of the review, then
941
1003
  the comment preview once one is planned, and the saved preview again after
942
- `/pr-comment --show`. A check (`/pr-check`) shows its table there too.
1004
+ `/pr-comment --show`. A check (`/pr-check`) shows its table there too. A
1005
+ preview that is planned again is shown from its beginning.
1006
+ - **What you can do next** is one row at the foot of the panel, where reading
1007
+ ends. It stays in place while the text scrolls and is level with OpenCode's
1008
+ status bar:
1009
+
1010
+ ```text
1011
+ [p] Post 4 comments… [a] Adjust findings… [u] Reset adjustments
1012
+ ```
1013
+
1014
+ Click one, or press its key while the panel has the keyboard; the keys are
1015
+ drawn dim while they would only type a letter into the prompt. A label that
1016
+ ends in `…` asks before anything is sent: posting asks once more, with "No,
1017
+ post nothing" first, and adjusting opens the findings as a list, where you
1018
+ pick one to leave it out or to choose its level and then apply everything
1019
+ at once (**apply** at the foot of the list, `ctrl+s`, or the list's last
1020
+ row). **Reset adjustments** is there once you have adjusted something and
1021
+ clears all of it. After a review that no preview follows by itself
1022
+ (`afterReview: none`), the row offers **Preview comments** (`c`) instead of
1023
+ posting. Each of them sends the `/pr-comment` command you would type, for
1024
+ the review shown, and its STARTED notice and receipt follow as always. A
1025
+ click there leaves the keyboard with the prompt. If the preview is planned
1026
+ again, or another session comes on screen, while a question is open, the
1027
+ answer is not acted on and the panel says so. Each command also says which
1028
+ preview and adjustments it was picked for (`--seen`), and AZPR refuses it
1029
+ when they are others by now, for instance after a command typed in the
1030
+ review's own session or in another client: nothing is posted that you have
1031
+ not read.
1032
+
1033
+ While a run is under way (a review, a preview that is being planned, a
1034
+ publication), the row offers one thing instead:
1035
+
1036
+ ```text
1037
+ [s] Stop this run…
1038
+ ```
1039
+
1040
+ It asks first, with "No, let it run" first, and then sends `/pr-stop` for
1041
+ that run, as if you had typed it: the run ends with its `CANCELLED`
1042
+ receipt, and requests that were already sent may still be billed. If the
1043
+ run has ended while the question was open, nothing is sent and the panel
1044
+ says so. A run that an earlier AZPR started is stopped by typing the
1045
+ command its STARTED notice shows.
943
1046
  - **Keys.** `/pr-panel` shows and hides the panel; it is the panel's only
944
- command. A click inside it gives it the keyboard: the arrow keys or `j` and
945
- `k`, Page Up and Page Down, Home and End scroll, and Escape or `q` closes
946
- it.
1047
+ command. A click inside its text gives it the keyboard: the arrow keys or
1048
+ `j` and `k`, Page Up and Page Down, Home and End scroll, `p`, `a`, `u`,
1049
+ `c` and `s` pick what the foot offers, and Escape or `q` closes it.
947
1050
  - **A narrow terminal** (fewer than 108 columns) has no room for two panes,
948
1051
  and OpenCode would show the panel in place of the conversation. There the
949
1052
  panel does not open by itself; it says that something is ready, and
950
1053
  `/pr-panel` shows it full screen.
951
1054
 
952
- The panel only reads what AZPR already put into your conversation and into the
953
- session that holds a report. It sends no prompt, starts no review and posts
954
- nothing; `/pr-comment --publish` is still a command you type. It comes with
1055
+ The panel shows what AZPR already put into your conversation and into the
1056
+ session that holds a report. It sends nothing by itself and never a prompt:
1057
+ the one thing it sends is the command of a step you pick (`/pr-comment`, or
1058
+ `/pr-stop` for a run under way), which AZPR takes like a typed one, and
1059
+ posting and stopping always ask first. It comes with
955
1060
  the package and needs no setup; `terminalPanel` is its one setting. Other
956
1061
  OpenCode clients, such as the desktop app, do not load it and show AZPR's
957
1062
  notices as before. The same terminal part brings the
@@ -977,8 +1082,9 @@ them into one comment under fixed rules (see [commenting](docs/COMMENTING.md)).
977
1082
  ### Adjusting findings after a preview
978
1083
 
979
1084
  When a preview contains findings you disagree with, leave them out or change
980
- their severity, then read the new preview. Several IDs go in one list,
981
- separated by commas:
1085
+ their severity, then read the new preview. In the terminal UI, **Adjust
1086
+ findings…** at the foot of the panel does this from a list of the findings.
1087
+ With commands, several IDs go in one list, separated by commas:
982
1088
 
983
1089
  ```text
984
1090
  /pr-comment --exclude F-1,R-2 leave F-1 and R-2 out
@@ -1044,7 +1150,16 @@ findings to comment on gets one notice instead, with no planning, model
1044
1150
  request or comment. When another AZPR command is running in the conversation
1045
1151
  or on the PR, the step is skipped and the notice names the command to run.
1046
1152
 
1047
- Automatic publication posts as the PAT owner, item by item. A comment (or the
1153
+ Automatic publication posts as the PAT owner, item by item, and holds back
1154
+ for a person every item whose text could notify someone, load content or run a
1155
+ script; a plan that would post nothing new posts nothing (`NOTHING_TO_POST`).
1156
+ A command you type, such as `/pr-comment --publish`, posts every item of the
1157
+ saved preview, held ones included.
1158
+
1159
+ <details>
1160
+ <summary>What automatic publication holds back, exactly</summary>
1161
+
1162
+ A comment (or the
1048
1163
  summary) whose text contains an `@<…>` mention, an image, HTML that embeds
1049
1164
  content or runs a script (such as `<img>`, `<iframe>`, `<script>`, or an
1050
1165
  `on…=`, `src=` or `style=` attribute, read as a browser reads a tag), HTML
@@ -1075,6 +1190,8 @@ each time). Publication itself still rechecks that the PR's source commit is
1075
1190
  unchanged. A command you type, such as `/pr-comment --publish`, posts
1076
1191
  every item of the saved preview, held ones included.
1077
1192
 
1193
+ </details>
1194
+
1078
1195
  ### Publication
1079
1196
 
1080
1197
  Publication is runtime code: it refuses a changed source commit, lists every
@@ -1113,6 +1230,15 @@ every later run. While debug is enabled every session is kept until its
1113
1230
  review is evicted, so turn `debug.enabled` off for everyday use if the list
1114
1231
  gets long. A review that an OpenCode restart interrupts leaves its sessions in
1115
1232
  the list; delete those yourself. Your own conversations are never deleted.
1233
+ A conversation nobody named yet, which OpenCode lists as **New session**, is
1234
+ named after the PR when its first check or review starts
1235
+ (`AZPR: PR #123 (repository)`): an AZPR command never makes the conversation's
1236
+ own model run, which is what names a conversation otherwise. A conversation
1237
+ that has a name keeps it. OpenCode has no rename that applies only to an
1238
+ unnamed conversation, so AZPR follows the renames OpenCode reports: a name
1239
+ that you or OpenCode's model give in that very moment is written back where
1240
+ AZPR's own may have replaced it. What that cannot rule out is said in
1241
+ [the architecture](docs/ARCHITECTURE.md#authorization-and-isolation).
1116
1242
  In the terminal UI you need not look for these sessions in the list: the
1117
1243
  [terminal panel](#terminal-panel) names those of the latest review and opens
1118
1244
  the one you click.
@@ -1136,6 +1262,8 @@ node tests/host-v2-comment-scale.mjs /absolute/path/to/opencode --cleanup
1136
1262
  node tests/host-v2-background-compaction.mjs /absolute/path/to/opencode --cleanup
1137
1263
  node tests/host-v2-tui-panel.mjs /absolute/path/to/opencode
1138
1264
  node tests/host-v2-tui-panel.mjs /absolute/path/to/opencode --native
1265
+ node tests/host-v2-tui-setup.mjs /absolute/path/to/opencode
1266
+ node tests/host-v2-tui-setup.mjs /absolute/path/to/opencode --native
1139
1267
  sh uninstall.sh --config-dir /absolute/path/to/v2-opencode-config
1140
1268
  sh uninstall.sh --config-dir /absolute/path/to/v2-opencode-config --apply
1141
1269
  ```
@@ -1144,17 +1272,17 @@ The host fixtures run a real OpenCode binary with a loopback fake model provider
1144
1272
  and a loopback fake Azure DevOps REST service in disposable directories under
1145
1273
  `.local/`. They keep debug on to read its records, and debug keeps every
1146
1274
  private session; the two `--cleanup` runs turn it off, so that each run deletes
1147
- its sessions as an installation with default settings does. The two
1148
- `host-v2-tui-panel` runs drive the real terminal UI in `tmux`, which they need,
1149
- once installed from source and once as OpenCode's plugin manager installs the
1150
- package. `npm ci` installs the compiler of the terminal panel's JSX, which only
1275
+ its sessions as an installation with default settings does. The
1276
+ `host-v2-tui-panel` and `host-v2-tui-setup` runs drive the real terminal UI in
1277
+ `tmux`, which they need, each once installed from source and once as
1278
+ OpenCode's plugin manager installs the package. `npm ci` installs the compiler of the terminal panel's JSX, which only
1151
1279
  `npm run check` and `npm run build:tui` use; the installed plugin has no
1152
1280
  dependency and is not built on your machine.
1153
1281
  Uninstall without `--apply` previews; `--apply` archives only this package under
1154
1282
  `azpr-v2-backups` and leaves the private state directory for you to delete.
1155
1283
  For a native installation, remove the entry you added, for example
1156
- `opencode plugin remove opencode-azure-devops-pr-review@0.4.3` or
1157
- `opencode plugin remove 'github:WTLAIB/opencode-azure-devops-pr-review-v2#v0.4.3'`;
1284
+ `opencode plugin remove opencode-azure-devops-pr-review@0.4.5` or
1285
+ `opencode plugin remove 'github:WTLAIB/opencode-azure-devops-pr-review-v2#v0.4.5'`;
1158
1286
  the external settings, PAT file and private review state remain available.
1159
1287
 
1160
1288
  [Architecture](docs/ARCHITECTURE.md), [commenting](docs/COMMENTING.md),
@@ -1167,7 +1295,7 @@ or personal model selections.
1167
1295
  ## License and releases
1168
1296
 
1169
1297
  [MIT](LICENSE), copyright 2026 WTLAIB. See the [changelog](CHANGELOG.md) for the
1170
- release scope, [v0.4.3](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/releases/tag/v0.4.3)
1298
+ release scope, [v0.4.5](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/releases/tag/v0.4.5)
1171
1299
  for downloads, the [npm package](https://www.npmjs.com/package/opencode-azure-devops-pr-review),
1172
1300
  [v0.2.0](https://github.com/WTLAIB/opencode-azure-devops-pr-review-v2/releases/tag/v0.2.0)
1173
1301
  for the recorded demonstration, and [releasing](docs/RELEASING.md) for the
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "opencode-azure-devops-pr-review",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
4
4
  "type": "module",
5
5
  "description": "Azure DevOps PR reviews from a URL in OpenCode, with no checkout, configurable models, separate verification, and comment previews you can adjust before posting",
6
6
  "scripts": {
7
7
  "test": "node --test tests/*.test.mjs",
8
- "check": "node --check src/session.mjs && node --check src/runtime.mjs && node --check src/comment-data.mjs && node --check src/comment-work.mjs && node --check src/comments.mjs && node --check src/config.mjs && node --check src/output.mjs && node --check src/diagnostics.mjs && node --check src/attribution.mjs && node --check src/host.mjs && node --check src/tool-queue.mjs && node --check src/azure.mjs && node --check src/diff.mjs && node --check src/search.mjs && node --check src/review-tools.mjs && node --check src/review-work.mjs && node --check src/store.mjs && node --check src/plugin.js && node --check src/setup.mjs && node --check src/tui-model.mjs && node --check src/tui-setup.mjs && node --check src/tui.js && node --check server.js && node --check scripts/build-tui.mjs && node scripts/build-tui.mjs --check && sh -n install.sh && sh -n uninstall.sh",
8
+ "check": "node --check src/session.mjs && node --check src/runtime.mjs && node --check src/comment-data.mjs && node --check src/comment-work.mjs && node --check src/comments.mjs && node --check src/config.mjs && node --check src/output.mjs && node --check src/diagnostics.mjs && node --check src/attribution.mjs && node --check src/host.mjs && node --check src/tool-queue.mjs && node --check src/azure.mjs && node --check src/diff.mjs && node --check src/search.mjs && node --check src/review-tools.mjs && node --check src/review-work.mjs && node --check src/store.mjs && node --check src/plugin.js && node --check src/setup.mjs && node --check src/tui-model.mjs && node --check src/tui-setup.mjs && node --check src/tui-actions.mjs && node --check src/tui.js && node --check server.js && node --check scripts/build-tui.mjs && node scripts/build-tui.mjs --check && sh -n install.sh && sh -n uninstall.sh",
9
9
  "build:tui": "node scripts/build-tui.mjs"
10
10
  },
11
11
  "engines": {
@@ -65,6 +65,15 @@ export function describeReview(review) {
65
65
  return `review ${review.id} (/pr-${review.profile}) of PR #${snapshot.prId ?? '?'}${snapshot.project && snapshot.repository ? ` in ${snapshot.project}/${snapshot.repository}` : ''}`;
66
66
  }
67
67
 
68
+ /**
69
+ * The name of a conversation whose first AZPR command names a PR, where nobody named it yet: the PR by its
70
+ * number and repository, which come from the URL the person typed. The PR's own title is text from the PR
71
+ * and is not used.
72
+ */
73
+ export function conversationTitle(target) {
74
+ return `AZPR: PR #${target.pullRequestId} (${String(target.repository).slice(0, 60)})`;
75
+ }
76
+
68
77
  /** Models per role, aggregated over shards and retries. */
69
78
  export function reviewProvenance(run) {
70
79
  const rows = new Map();