opencode-magi 0.0.0-dev-20261028021002 → 0.0.0-dev-20261104100346

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.
@@ -1,6 +1,7 @@
1
1
  Validate review findings for pull request #{pr} in {owner}/{repo}.
2
2
  Use the existing review session context.
3
3
  Vote on whether each listed finding is a valid reason to request changes.
4
+ Vote DISAGREE when a finding duplicates an issue already raised in any review thread in the existing review session context.
4
5
  Each finding's `body` contains the proposed review comment text.
5
6
 
6
7
  Findings to validate are provided in `<findings>`.
@@ -9,6 +9,9 @@ Request changes if a closing issue requirement is missing, only documented, only
9
9
  Do not approve solely because the PR improves the codebase if it claims to close an issue that remains incomplete.
10
10
  For referenced non-closing issues, use them as context only unless the PR body explicitly claims to complete them.
11
11
 
12
+ All review threads are provided in `<review>` for context.
13
+ Do not duplicate an issue already raised in any review thread as a finding. Use findings only for separate new issues.
14
+ Leave existing issues in their original threads for their owners to follow up. If you have no separate new findings and no reason to close the PR, return APPROVED.
12
15
  Every finding must target a valid right-side line in the PR diff.
13
16
  If the problem itself does not have an exact changed line, choose the nearest changed line that represents the cause, responsibility, missing implementation, or affected behavior. This includes but is not limited to missing validation, missing wiring, missing requirements, missing tests, missing documentation, affected configuration, or relevant call sites.
14
17
  Do not omit line. Do not create file-level or body-only findings.
@@ -22,18 +22,23 @@ export async function checkExistingReviews() {
22
22
  if (review.user.login !== this.config.account)
23
23
  return;
24
24
  const markers = marker.parse(review.body);
25
- const { body, reviewer, verdict } = markers.find(({ reviewer }) => reviewer === id) ?? {};
25
+ const { body, command, reviewer, verdict } = markers.find(({ reviewer }) => reviewer === id) ?? {};
26
26
  if (reviewer !== id || !verdict)
27
27
  return;
28
+ if (review.state === "DISMISSED" &&
29
+ (command !== "review" ||
30
+ !["APPROVED", "CHANGES_REQUESTED", "CLOSED"].includes(verdict)))
31
+ return;
32
+ const state = review.state === "DISMISSED" ? review.state : verdict;
28
33
  try {
29
34
  return {
30
35
  ...review,
31
36
  body: body ? decodeURIComponent(body) : "",
32
- state: verdict,
37
+ state,
33
38
  };
34
39
  }
35
40
  catch {
36
- return { ...review, body: "", state: verdict };
41
+ return { ...review, body: "", state };
37
42
  }
38
43
  }
39
44
  else {
@@ -43,10 +48,17 @@ export async function checkExistingReviews() {
43
48
  return review;
44
49
  if (review.state === "CHANGES_REQUESTED")
45
50
  return review;
46
- if (review.state !== "COMMENTED")
51
+ if (review.state !== "COMMENTED" && review.state !== "DISMISSED")
47
52
  return;
48
53
  const markers = marker.parse(review.body);
49
- const { reviewer, verdict } = markers[0] ?? {};
54
+ const { command, reviewer, verdict } = markers[0] ?? {};
55
+ if (review.state === "DISMISSED") {
56
+ if (command !== "review" ||
57
+ reviewer !== id ||
58
+ (verdict !== "APPROVED" && verdict !== "CHANGES_REQUESTED"))
59
+ return;
60
+ return review;
61
+ }
50
62
  if (reviewer !== id || verdict !== "CLOSED")
51
63
  return;
52
64
  return { ...review, state: "CLOSED" };
@@ -60,7 +72,7 @@ export async function checkExistingReviews() {
60
72
  submitted_at &&
61
73
  submitted_at.localeCompare(latestNonMergeCommit.commit.author.date) >= 0);
62
74
  const review = targetReviews.at(-1);
63
- if (latestReviews.length)
75
+ if (latestReviews.length && review?.state !== "DISMISSED")
64
76
  return [id, { account, review, status: "skip" }];
65
77
  else
66
78
  return [id, { account, review, status: "rereview" }];
@@ -369,20 +369,25 @@ function transformState(reviewer, id, accepted) {
369
369
  const prevOutput = outputs[outputs.length - 1];
370
370
  if (prevOutput?.verdict !== "CHANGES_REQUESTED")
371
371
  return reviewer;
372
+ const prevFindings = prevOutput.findings ?? prevOutput.newFindings;
373
+ if (!prevFindings?.length)
374
+ return reviewer;
372
375
  const nextOutput = { ...prevOutput };
373
- const findings = (prevOutput.findings ??
374
- prevOutput.newFindings ??
375
- []).map((finding, index) => ({
376
+ const findings = prevFindings.map((finding, index) => ({
376
377
  ...finding,
377
378
  state: accepted.has(`${id}:${index}`) ? "accepted" : "discarded",
378
379
  }));
379
380
  if (prevOutput.findings)
380
381
  nextOutput.findings = findings;
381
- else if (prevOutput.newFindings)
382
+ else
382
383
  nextOutput.newFindings = findings;
383
384
  outputs[outputs.length - 1] = nextOutput;
384
- if (!findings.some(({ state }) => state === "accepted"))
385
- outputs.push({ verdict: "APPROVED" });
385
+ if (!findings.some(({ state }) => state === "accepted") &&
386
+ !prevOutput.followUps?.length)
387
+ outputs.push(omitNullish({
388
+ resolves: prevOutput.resolves,
389
+ verdict: "APPROVED",
390
+ }));
386
391
  return { ...reviewer, outputs };
387
392
  }
388
393
  async function notifyVerdictChanges(prev, next, reason) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-magi",
3
- "version": "0.0.0-dev-20261028021002",
3
+ "version": "0.0.0-dev-20261104100346",
4
4
  "description": "Multi-agent PR review and merge orchestration plugin for OpenCode.",
5
5
  "license": "MIT",
6
6
  "author": "Hirotomo Yamada <hirotomo.yamada@avap.co.jp>",