opencode-magi 0.0.0-dev-20260522233932 → 0.0.0-dev-20260523030821
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/dist/github/commands.js
CHANGED
|
@@ -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
|
-
|
|
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 &&
|
package/dist/orchestrator/ci.js
CHANGED
|
@@ -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
|
-
|
|
474
|
-
|
|
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.
|
|
@@ -156,7 +156,7 @@ async function runVote(input) {
|
|
|
156
156
|
parse: input.parse,
|
|
157
157
|
permission: input.agent.permission,
|
|
158
158
|
prompt,
|
|
159
|
-
repairAttempts: 3,
|
|
159
|
+
repairAttempts: input.run.config.output?.repairAttempts ?? 3,
|
|
160
160
|
schemaName: input.schemaName,
|
|
161
161
|
signal: input.signal,
|
|
162
162
|
title: `Magi triage ${input.schemaName} #${input.issue} (${input.agent.key})`,
|
|
@@ -484,7 +484,7 @@ async function classifyMentionReplies(input) {
|
|
|
484
484
|
parse: parseTriageCommentClassificationOutput,
|
|
485
485
|
permission: agent.permission,
|
|
486
486
|
prompt,
|
|
487
|
-
repairAttempts: 3,
|
|
487
|
+
repairAttempts: input.input.config.output?.repairAttempts ?? 3,
|
|
488
488
|
schemaName: "triage comment classification",
|
|
489
489
|
signal: input.input.signal,
|
|
490
490
|
title: `Magi triage comment classification #${input.input.issue} (${agent.key})`,
|
|
@@ -823,7 +823,7 @@ async function createImplementationPr(input) {
|
|
|
823
823
|
parse: parseTriageCreatePrOutput,
|
|
824
824
|
permission: creator.permission,
|
|
825
825
|
prompt,
|
|
826
|
-
repairAttempts: 3,
|
|
826
|
+
repairAttempts: input.input.config.output?.repairAttempts ?? 3,
|
|
827
827
|
schemaName: "triage create PR",
|
|
828
828
|
signal: input.input.signal,
|
|
829
829
|
title: `Magi triage create PR #${input.issue.number}`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-magi",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20260523030821",
|
|
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>",
|