opencode-magi 0.0.0-dev-20260522075502 → 0.0.0-dev-20260522081829

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.
@@ -403,6 +403,7 @@ function extractQuestionRequest(properties) {
403
403
  export class MagiRunManager {
404
404
  input;
405
405
  active = new Map();
406
+ activeTriageRuns = 0;
406
407
  countedToolParts = new Map();
407
408
  controllers = new Map();
408
409
  eventLastUpdates = new Map();
@@ -410,6 +411,7 @@ export class MagiRunManager {
410
411
  runPaths = new Map();
411
412
  outputDirs = new Set();
412
413
  sessionToRun = new Map();
414
+ triageQueue = [];
413
415
  constructor(input) {
414
416
  this.input = input;
415
417
  }
@@ -581,11 +583,38 @@ export class MagiRunManager {
581
583
  });
582
584
  if (input.sync)
583
585
  return this.executeSync(state, controller, execute, input.timeoutMs);
584
- void execute().catch(async (error) => {
585
- await this.failRun(runId, error);
586
+ this.triageQueue.push({
587
+ execute,
588
+ repository: input.repository,
589
+ runId,
586
590
  });
591
+ this.drainTriageQueue();
587
592
  return state;
588
593
  }
594
+ drainTriageQueue() {
595
+ while (this.triageQueue.length) {
596
+ const next = this.triageQueue[0];
597
+ if (!next)
598
+ return;
599
+ const limit = next.repository.triage?.concurrency.runs ?? 1;
600
+ if (this.activeTriageRuns >= limit)
601
+ return;
602
+ this.triageQueue.shift();
603
+ const state = this.active.get(next.runId);
604
+ if (!state || state.status === "cancelled")
605
+ continue;
606
+ this.activeTriageRuns += 1;
607
+ void next
608
+ .execute()
609
+ .catch(async (error) => {
610
+ await this.failRun(next.runId, error);
611
+ })
612
+ .finally(() => {
613
+ this.activeTriageRuns -= 1;
614
+ this.drainTriageQueue();
615
+ });
616
+ }
617
+ }
589
618
  async status(input = {}) {
590
619
  const timeoutMs = input.timeoutMs;
591
620
  const startedAt = Date.now();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-magi",
3
- "version": "0.0.0-dev-20260522075502",
3
+ "version": "0.0.0-dev-20260522081829",
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>",