opencode-magi 0.0.0-dev-20260522233932 → 0.0.0-dev-20260523030356

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.
@@ -458,8 +458,9 @@ export async function fetchPullRequestSafetyMeta(exec, repository, pr) {
458
458
  }
459
459
  return { author, changedFiles, files, labels };
460
460
  }
461
- export async function watchChecks(exec, repository, pr) {
462
- await exec(`gh pr checks ${pr} --repo ${shellQuote(repoSpecifier(repository))} --watch`);
461
+ export async function watchChecks(exec, repository, pr, options = {}) {
462
+ const requiredFlag = options.requiredOnly ? " --required" : "";
463
+ await exec(`gh pr checks ${pr} --repo ${shellQuote(repoSpecifier(repository))} --watch${requiredFlag}`);
463
464
  }
464
465
  export function isCancelledCheck(check) {
465
466
  return check.bucket === "cancel" || check.state === "CANCELLED";
@@ -469,8 +470,9 @@ export function isFailedCheck(check) {
469
470
  }
470
471
  export async function fetchPullRequestChecks(exec, repository, pr, options = {}) {
471
472
  let raw;
473
+ const requiredFlag = options.requiredOnly ? " --required" : "";
472
474
  try {
473
- raw = await exec(`gh pr checks ${pr} --repo ${shellQuote(repoSpecifier(repository))} --json name,state,bucket,link,workflow`);
475
+ raw = await exec(`gh pr checks ${pr} --repo ${shellQuote(repoSpecifier(repository))} --json name,state,bucket,link,workflow${requiredFlag}`);
474
476
  }
475
477
  catch (error) {
476
478
  if (options.tolerateMissingChecks &&
@@ -229,7 +229,7 @@ async function watchRerunRuns(exec, repository, checks) {
229
229
  await Promise.all(runIds.map((runId) => watchRun(exec, repository, runId)));
230
230
  }
231
231
  async function checksForHead(input) {
232
- const checks = await fetchPullRequestChecks(input.exec, input.repository, input.pr, { tolerateMissingChecks: Boolean(input.headSha) });
232
+ const checks = await fetchPullRequestChecks(input.exec, input.repository, input.pr, { requiredOnly: true, tolerateMissingChecks: Boolean(input.headSha) });
233
233
  const targetChecks = [];
234
234
  let hasAnyActionCheck = false;
235
235
  let hasTargetActionCheck = false;
@@ -254,7 +254,6 @@ async function checksForHead(input) {
254
254
  return {
255
255
  blocking: targetChecks.filter((check) => isFailedCheck(check) || isCancelledCheck(check)),
256
256
  hasAnyActionCheck,
257
- hasAnyCheck: checks.length > 0,
258
257
  hasPending: targetChecks.some(isPendingCheck),
259
258
  hasTargetActionCheck,
260
259
  };
@@ -463,15 +462,17 @@ export async function waitForChecksWithClassification(input) {
463
462
  await input.onProgress?.("waiting for CI checks");
464
463
  for (let attempt = 0;; attempt += 1) {
465
464
  try {
466
- await watchChecks(input.exec, input.repository, input.pr);
465
+ await watchChecks(input.exec, input.repository, input.pr, {
466
+ requiredOnly: true,
467
+ });
467
468
  }
468
469
  catch {
469
470
  // gh exits non-zero for pending checks too; re-read check state below.
470
471
  }
471
472
  const target = await readTargetChecks();
472
473
  const waitingForTargetHead = Boolean(input.headSha) &&
473
- (!target.hasAnyCheck ||
474
- (target.hasAnyActionCheck && !target.hasTargetActionCheck));
474
+ target.hasAnyActionCheck &&
475
+ !target.hasTargetActionCheck;
475
476
  if (!waitingForTargetHead && !target.hasPending) {
476
477
  await assignBlockingChecks(target.blocking);
477
478
  break;
@@ -552,8 +553,11 @@ export async function waitForChecksWithClassification(input) {
552
553
  try {
553
554
  await input.onProgress?.("waiting for rerun CI checks");
554
555
  await watchRerunRuns(input.exec, input.repository, rerunnable);
555
- if (input.wait)
556
- await watchChecks(input.exec, input.repository, input.pr);
556
+ if (input.wait) {
557
+ await watchChecks(input.exec, input.repository, input.pr, {
558
+ requiredOnly: true,
559
+ });
560
+ }
557
561
  }
558
562
  catch {
559
563
  // Re-read the PR checks below so stale failed checks are not trusted.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-magi",
3
- "version": "0.0.0-dev-20260522233932",
3
+ "version": "0.0.0-dev-20260523030356",
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>",