@bridge_gpt/mcp-server 0.2.72 → 0.2.73

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.
Files changed (146) hide show
  1. package/README.md +5 -5
  2. package/build/agent-launchers/claude-executor-adapter.js +3 -0
  3. package/build/agents.generated.js +6 -6
  4. package/build/bridge-permissions.js +27 -0
  5. package/build/ci-system-detection.js +50 -0
  6. package/build/ci-trigger-adapters.js +631 -0
  7. package/build/ci-trigger-install.js +106 -0
  8. package/build/codex-launcher-pin.js +33 -2
  9. package/build/codex-skill-adapter.js +3 -1
  10. package/build/command-host.js +33 -0
  11. package/build/commands.generated.js +7 -6
  12. package/build/conductor/bridge-api-client.js +842 -35
  13. package/build/conductor/bring-up-facts.js +18 -5
  14. package/build/conductor/command-drift-production.js +42 -17
  15. package/build/conductor/command-drift.js +47 -0
  16. package/build/conductor/declare-blocked.js +554 -0
  17. package/build/conductor/doctor.js +106 -21
  18. package/build/conductor/driver-commands.js +141 -0
  19. package/build/conductor/driver-guard.js +277 -0
  20. package/build/conductor/driver-lapse.js +321 -0
  21. package/build/conductor/driver-register.js +176 -0
  22. package/build/conductor/driver-release.js +174 -0
  23. package/build/conductor/driver-session-state.js +315 -0
  24. package/build/conductor/epic-branch-ci-inspection.js +222 -29
  25. package/build/conductor/epic-implementer-cli.js +166 -15
  26. package/build/conductor/epic-server-database.js +162 -0
  27. package/build/conductor/epic-server-guidance.js +278 -0
  28. package/build/conductor/epic-server-journal.js +239 -0
  29. package/build/conductor/epic-server-processes.js +324 -0
  30. package/build/conductor/epic-server-recipe.js +397 -0
  31. package/build/conductor/epic-server-runtime.js +1207 -0
  32. package/build/conductor/epic-server-sfcc.js +107 -0
  33. package/build/conductor/epic-server-state.js +427 -0
  34. package/build/conductor/epic-server.js +594 -0
  35. package/build/conductor/gate-discovery.js +150 -5
  36. package/build/conductor/gate-settings-review.js +224 -4
  37. package/build/conductor/launch-need-probes.js +6 -53
  38. package/build/conductor/launch-plan.js +313 -156
  39. package/build/conductor/prerequisite-inputs.js +879 -45
  40. package/build/conductor/readiness-assessment.js +16 -1
  41. package/build/conductor/readiness-cli.js +20 -9
  42. package/build/conductor/readiness-prerequisites.js +28 -9
  43. package/build/conductor/readiness-sections.js +133 -126
  44. package/build/conductor/readiness.js +1 -1
  45. package/build/conductor/recovery-cli.js +13 -2
  46. package/build/conductor/tools.js +6 -5
  47. package/build/conductor/wait-run-attention.js +2 -2
  48. package/build/conductor/wait-run-cli.js +208 -22
  49. package/build/conductor/worker-database-doctor-inspector.js +33 -2
  50. package/build/conductor/worker-setup-tally.js +27 -0
  51. package/build/credential-store.js +71 -1
  52. package/build/dependency-install-declarations.js +55 -0
  53. package/build/docs.generated.js +2 -2
  54. package/build/doctor.js +54 -3
  55. package/build/drive-epic-help.js +21 -2
  56. package/build/drive-epic.js +1811 -351
  57. package/build/engine-paths.js +20 -0
  58. package/build/epic-branch-ci-summary.js +140 -0
  59. package/build/epic-capability-statement.js +107 -0
  60. package/build/epic-ci-workflow-drift.js +30 -15
  61. package/build/epic-ci-workflow-install.js +110 -42
  62. package/build/epic-ci-workflow-v2.js +274 -0
  63. package/build/epic-ci-workflow.js +38 -12
  64. package/build/epic-implementer-bin.js +2101 -44
  65. package/build/epic-launch-context.js +607 -0
  66. package/build/epic-server-record.js +273 -0
  67. package/build/epic-shared/bridge-client.js +11 -3
  68. package/build/escalation-reachability.js +43 -0
  69. package/build/executor/ci-fix-test-runs.js +334 -0
  70. package/build/executor/completion-contract.js +8 -1
  71. package/build/executor/env.js +59 -22
  72. package/build/executor/epic-server-context.js +141 -0
  73. package/build/executor/gate-qualification-job.js +127 -26
  74. package/build/executor/http-client.js +52 -5
  75. package/build/executor/job-runner.js +423 -69
  76. package/build/executor/observation.js +8 -0
  77. package/build/executor/pre-pr-checks.js +363 -0
  78. package/build/executor/prompt-spec.js +114 -2
  79. package/build/executor/reconcile-overlap-job.js +5 -3
  80. package/build/executor/required-work-diagnostics.js +4 -2
  81. package/build/executor/required-work-ledger.js +936 -38
  82. package/build/executor/results.js +58 -0
  83. package/build/executor/terminal-mutation.js +8 -0
  84. package/build/executor/worker-command.js +72 -3
  85. package/build/executor/worker-database-config.js +281 -0
  86. package/build/executor/worker-database-target.js +16 -12
  87. package/build/executor/worker-database.js +320 -101
  88. package/build/executor/worker-finalization.js +7 -1
  89. package/build/executor/worker-resources.js +25 -3
  90. package/build/executor/worker-verification-guidance.js +18 -3
  91. package/build/executor/worktree.js +20 -1
  92. package/build/executor-launch.js +54 -2
  93. package/build/generated-assets-catalog.js +2 -2
  94. package/build/index.js +664 -335
  95. package/build/init.js +26 -11
  96. package/build/install-bridge-conductor-answers.js +465 -0
  97. package/build/install-bridge-conductor-apply.js +259 -0
  98. package/build/install-bridge-conductor-assessment.js +895 -0
  99. package/build/install-bridge-conductor-compact.js +161 -0
  100. package/build/install-bridge-conductor-contracts.js +63 -0
  101. package/build/install-bridge-conductor-gate.js +1197 -196
  102. package/build/install-bridge-conductor-setup.js +535 -79
  103. package/build/install-bridge-conductor.js +2885 -560
  104. package/build/install-bridge.js +199 -21
  105. package/build/install-maintenance.js +26 -3
  106. package/build/launcher-config-inspection.js +162 -1
  107. package/build/mcp-grant-candidates.js +767 -0
  108. package/build/mcp-grant-doctor.js +63 -0
  109. package/build/mcp-grant.js +288 -0
  110. package/build/mcp-host-targets.js +8 -0
  111. package/build/mcp-identity.js +23 -0
  112. package/build/mcp-invoke.js +126 -13
  113. package/build/mcp-presets.js +107 -0
  114. package/build/mcp-provisioning.js +134 -2
  115. package/build/mcp-registration-doctor.js +31 -2
  116. package/build/mcp-server-invocation.js +6 -1
  117. package/build/merge-workflow-install.js +234 -109
  118. package/build/pipelines.generated.js +5 -5
  119. package/build/plan-discovery.js +97 -4
  120. package/build/plan-execution-ledger.js +100 -7
  121. package/build/plan-generation-io.js +262 -0
  122. package/build/plan-generation.js +424 -0
  123. package/build/plane/build-freshness.js +6 -1
  124. package/build/plane/cli.js +75 -9
  125. package/build/plane/plane-freshness.js +17 -0
  126. package/build/plane/preflight.js +50 -10
  127. package/build/plane/shutdown.js +19 -0
  128. package/build/plane/terminal-run-cleanup.js +18 -4
  129. package/build/printed-remedy-commands.js +206 -12
  130. package/build/readiness-check.js +77 -0
  131. package/build/readiness-prerequisites.generated.js +122 -14
  132. package/build/readme.generated.js +1 -1
  133. package/build/repository-state-paths.js +38 -0
  134. package/build/run-unit-tests-launcher.js +8 -1
  135. package/build/setup-epic.js +1190 -196
  136. package/build/setup-progress.js +44 -0
  137. package/build/setup-question.js +122 -4
  138. package/build/third-party-mcp-targets.js +30 -0
  139. package/build/ticket-delivery-enrollment.js +9 -0
  140. package/build/upgrade-cli.js +85 -2
  141. package/build/v2-readiness-requirements.js +28 -1
  142. package/build/version.generated.js +3 -3
  143. package/docs/EPIC-IMPLEMENTER-INSTALL.md +9 -1
  144. package/docs/epic-implementer/getting-started.md +3 -1
  145. package/docs/epic-implementer/self-hosting.md +14 -1
  146. package/package.json +2 -2
@@ -802,7 +802,11 @@ export async function validateWorkerFinalization(input) {
802
802
  }
803
803
  }
804
804
  const hold = job.job_type === "ci_fix" ? null : confirmedDeliveryHold(deliveryOutcome, trimmedHeadSha, remoteSha);
805
- if (hold) {
805
+ // BAPI-1590: a hold with an attached PR at exactly the proven origin tip is not a
806
+ // dead end. Fall through to the unchanged PR contract and let the server judge the
807
+ // report; a missing PR or a different PR head keeps the hold failure.
808
+ const heldAtMatchingPr = hold !== null && observedPr !== undefined && observedPr.head_sha.toLowerCase() === remoteSha.toLowerCase();
809
+ if (hold && !heldAtMatchingPr) {
806
810
  return { ok: false, failure: deliveryHoldFailure(job, trimmedBranch, hold, observedPr) };
807
811
  }
808
812
  let contract = evaluatePrContract(pr, trimmedHeadSha, covered);
@@ -839,6 +843,8 @@ export async function validateWorkerFinalization(input) {
839
843
  prNumber: pr.prNumber,
840
844
  // Only when a fresh assessment was requested, so the legacy success shape is unchanged.
841
845
  ...(input.refreshDeliveryOutcome !== undefined && deliveryOutcome !== undefined ? { deliveryOutcome } : {}),
846
+ // BAPI-1590: only after the PR contract above succeeded for the hold let through.
847
+ ...(heldAtMatchingPr && hold ? { heldAtOpenPr: hold } : {}),
842
848
  // BAPI-1311: the verified origin tip — proven equal to the worker's HEAD above
843
849
  // whenever that HEAD was known. Only for a caller that asked for it.
844
850
  ...(input.exposePushedHead === true ? { pushedHeadSha: remoteSha } : {}),
@@ -19,6 +19,10 @@ import { resolveExecutorStateDir } from "./job-log-registry.js";
19
19
  import { hostIdentityDigest } from "./process-containment.js";
20
20
  import { createDefaultWorkerCliLauncherDeps, createWorkerCliLauncher, } from "./worker-cli-launcher.js";
21
21
  import { createDefaultWorkerDatabaseDeps, dropWorkerDatabase, provisionWorkerDatabase, sweepOrphanedWorkerDatabases, } from "./worker-database.js";
22
+ /** Retain reasons that mean an executor-owned database may still exist. */
23
+ const OWNED_RETAIN_REASONS = new Set([
24
+ "owner_alive", "owner_unknown", "ownership_changed", "drop_failed",
25
+ ]);
22
26
  /**
23
27
  * The production worker resources, bound to this executor process: its pid, its
24
28
  * host identity, its state directory, and the operator checkout it runs from
@@ -35,12 +39,13 @@ export function createProductionWorkerResources(input) {
35
39
  // Built lazily, once: constructing the deps touches nothing, but there is no
36
40
  // reason to do even that for an executor that never claims a worker job.
37
41
  let databaseDeps;
38
- const dbDeps = () => (databaseDeps ??= createDefaultWorkerDatabaseDeps({ stateDir, env: input.env }));
42
+ const dbDeps = () => (databaseDeps ??= input.databaseDeps ?? createDefaultWorkerDatabaseDeps({ stateDir, env: input.env }));
39
43
  let launcherDeps;
40
44
  const cliDeps = () => (launcherDeps ??= createDefaultWorkerCliLauncherDeps({ stateDir }));
41
45
  return {
42
46
  provisionDatabase: (request) => provisionWorkerDatabase({
43
47
  jobId: request.jobId,
48
+ config: request.config,
44
49
  operatorRepositoryRoot: input.cwd,
45
50
  worktreePath: request.worktreePath,
46
51
  executorPid,
@@ -51,8 +56,25 @@ export function createProductionWorkerResources(input) {
51
56
  ? { workerEnv: request.workerEnv }
52
57
  : {}),
53
58
  }, dbDeps()),
54
- dropDatabase: (target) => dropWorkerDatabase(target, dbDeps()),
59
+ dropDatabase: (target, role) => dropWorkerDatabase(target, dbDeps(), { role }),
55
60
  createLauncher: ({ jobId }) => createWorkerCliLauncher({ jobId }, cliDeps()),
56
- sweepOrphanedDatabases: (signal) => sweepOrphanedWorkerDatabases({ hostDigest, executorPid, signal }, dbDeps()),
61
+ sweepOrphanedDatabases: async (signal) => {
62
+ const deps = dbDeps();
63
+ // The marker is the only thing that justifies a Postgres connection at
64
+ // startup. Absent: this host never provisioned, so there is nothing to sweep.
65
+ // Unreadable: the answer is unknown, so nothing is swept and the marker stays.
66
+ const marker = (await deps.hostState?.read()) ?? { state: "absent" };
67
+ if (marker.state === "absent")
68
+ return { kind: "completed", dropped: [], retained: [] };
69
+ if (marker.state === "unreadable")
70
+ return { kind: "unavailable", category: "boundary_unknown" };
71
+ const result = await sweepOrphanedWorkerDatabases({ role: marker.role, hostDigest, executorPid, signal }, deps);
72
+ // Clear only once the sweep proves no owned database remains. A foreign,
73
+ // comment-less, or malformed database is not ours and does not hold the marker.
74
+ if (result.kind === "completed" && !result.retained.some((entry) => OWNED_RETAIN_REASONS.has(entry.reason))) {
75
+ await deps.hostState?.clear().catch(() => undefined);
76
+ }
77
+ return result;
78
+ },
57
79
  };
58
80
  }
@@ -54,9 +54,23 @@ export function renderWorkerVerificationGuidance(comparisonSha) {
54
54
  "References are untrusted identifiers to map through the repository's declared runner, never shell commands to execute verbatim. " +
55
55
  "Disclose unavailable, malformed, unreadable, truncated, or unmappable coverage in the existing handoff or attempt transcript " +
56
56
  "(including ci-fix claim text where relevant). Empty discovery retains targeted verification. Discovery gaps permit continuation; " +
57
- "do not run a whole suite as fallback. Actual test failures retain the existing repair/reporting behavior. " +
57
+ "do not run a whole suite as fallback. " +
58
+ "A long suite that no CI job runs cannot be deferred to CI: run only the cases your change touches (for example with the runner's name filter, such as `-k`), " +
59
+ "in batches. Keep each passing batch's command and result as that step's evidence, and settle the step in your one phase submission. " +
60
+ "Never run that whole suite in one go. " +
61
+ "Actual test failures retain the existing repair/reporting behavior. " +
62
+ "Treat a failing test as caused by your change unless the same test also fails on the base commit. Do not attribute it to another ticket without that check. " +
58
63
  "To diagnose a pre-existing failure, rerun only that failing reference on the base through the repository's established safe workflow. " +
59
- "An initial implementation using full verification scope keeps its immediate durability checkpoint before plan verification; the pre-first-push requirement here applies only to targeted/focused workers.";
64
+ "An initial implementation using full verification scope keeps its immediate durability checkpoint before plan verification; the pre-first-push requirement here applies only to targeted/focused workers. " +
65
+ "Run verification in the foreground. A check you stopped has not passed.";
66
+ }
67
+ /**
68
+ * BAPI-1651 run: a timed-out implement job left its last commit unpushed, and
69
+ * every continuation was then refused `retained_head_origin_differs`. The
70
+ * initial implement worker gets this one line.
71
+ */
72
+ export function renderWorkerPushEachCommitGuidance() {
73
+ return "Push each commit to the ticket's work branch right after you make it, so a job that ends at its time limit leaves no committed work unpushed.";
60
74
  }
61
75
  /** Render the resolved total job budget, not a fresh allowance or remaining time. */
62
76
  export function renderWorkerTimeBudgetGuidance(timeoutSeconds) {
@@ -66,7 +80,8 @@ export function renderWorkerTimeBudgetGuidance(timeoutSeconds) {
66
80
  return "## TIME BUDGET ##\n" + budget + " " +
67
81
  "Preparation and executor work consume this same total budget; this is not a fresh worker allowance or measured remaining time. " +
68
82
  "Local verification must leave room for commit, push, the single renewal pass, and `.conductor/result.json`. " +
69
- "Do not start a verification command that cannot finish within the remaining budget.";
83
+ "Do not start a verification command that cannot finish within the remaining budget. " +
84
+ "Prefer foreground verification. Stopping a task does not make its check pass.";
70
85
  }
71
86
  /**
72
87
  * BAPI-1533: the compact test-invocation rule a PUSHING continuation worker gets
@@ -62,7 +62,7 @@ export async function configureExecutorBranch(worktreePath, branch, deps) {
62
62
  (pushUrls.length === 1 && pushUrls[0] !== urls[0]))
63
63
  return failure;
64
64
  for (const [key, value] of [[`branch.${branch}.remote`, "origin"], [`branch.${branch}.merge`, `refs/heads/${branch}`]]) {
65
- if ((await deps.runCommand("git", ["config", "--local", key, value], { cwd: worktreePath })).exitCode !== 0)
65
+ if (!await writeLocalConfigWithLockRetry(worktreePath, key, value, deps))
66
66
  return failure;
67
67
  }
68
68
  return null;
@@ -71,6 +71,25 @@ export async function configureExecutorBranch(worktreePath, branch, deps) {
71
71
  return failure;
72
72
  }
73
73
  }
74
+ /** Total attempts for one `git config --local` write that hits git's config lock. */
75
+ export const CONFIG_LOCK_WRITE_ATTEMPTS = 4;
76
+ /**
77
+ * Write one local config value. Executors that claim jobs in the same second
78
+ * share one `.git/config`, so git can refuse a write with "could not lock config
79
+ * file". Only that failure is retried, a bounded number of times, after a short
80
+ * random delay. Any other failure returns false at once.
81
+ */
82
+ async function writeLocalConfigWithLockRetry(worktreePath, key, value, deps) {
83
+ for (let attempt = 1;; attempt += 1) {
84
+ const result = await deps.runCommand("git", ["config", "--local", key, value], { cwd: worktreePath });
85
+ if (result.exitCode === 0)
86
+ return true;
87
+ const lockFailure = /could not lock config file/i.test(result.stderr ?? "");
88
+ if (!lockFailure || attempt >= CONFIG_LOCK_WRITE_ATTEMPTS)
89
+ return false;
90
+ await deps.sleep(50 + Math.floor(Math.random() * 200));
91
+ }
92
+ }
74
93
  /**
75
94
  * BAPI-941: emit the per-spawn `claude-review` workflow-drift advisory for an
76
95
  * executor worker. Returns `void` and swallows everything — a diagnostic that
@@ -43,6 +43,7 @@
43
43
  * that executor instance's own heartbeat is fresh. Anything short of that and
44
44
  * uncertain is refused rather than signalled or duplicated.
45
45
  */
46
+ import { PARALLEL_LIMIT_CHANGE_ADVISORY } from "./conductor/launch-plan.js";
46
47
  import { spawn as nodeSpawn } from "node:child_process";
47
48
  import { mkdir, open, readFile, stat, unlink } from "node:fs/promises";
48
49
  import os from "node:os";
@@ -228,6 +229,9 @@ export function runExecutorArgs(args) {
228
229
  "--executor-id",
229
230
  args.executorId,
230
231
  "--exit-when-run-terminal",
232
+ ...(args.maxConcurrent !== undefined && args.maxConcurrent > 1
233
+ ? ["--max-concurrent", String(args.maxConcurrent)]
234
+ : []),
231
235
  ];
232
236
  }
233
237
  /**
@@ -289,6 +293,15 @@ export function parseRunExecutorRecord(raw) {
289
293
  }
290
294
  if (!isValidExecutorEpicRunId(r.epicRunId))
291
295
  return null;
296
+ // BAPI-1581 — absent reads as 1; a present value must be the positive integer
297
+ // the executor's own `--max-concurrent` accepts, else the record is untrusted.
298
+ let maxConcurrent = 1;
299
+ if (r.maxConcurrent !== undefined) {
300
+ if (typeof r.maxConcurrent !== "number" || !Number.isInteger(r.maxConcurrent) || r.maxConcurrent < 1) {
301
+ return null;
302
+ }
303
+ maxConcurrent = r.maxConcurrent;
304
+ }
292
305
  return {
293
306
  version: RUN_EXECUTOR_RECORD_VERSION,
294
307
  pid: r.pid,
@@ -297,8 +310,25 @@ export function parseRunExecutorRecord(raw) {
297
310
  baseUrl: r.baseUrl,
298
311
  startedAt: r.startedAt,
299
312
  logPath: r.logPath,
313
+ maxConcurrent,
300
314
  };
301
315
  }
316
+ /**
317
+ * BAPI-1581 — explain a reused executor whose capacity differs from the run's
318
+ * stored limit. Returns `undefined` when they match or no limit was requested.
319
+ * Never an action: a running executor is not stopped, resized, or restarted.
320
+ */
321
+ export function describeReusedExecutorCapacity(actual, requested) {
322
+ if (requested === undefined || requested === actual)
323
+ return undefined;
324
+ if (actual < requested) {
325
+ return (`The reused executor serves ${actual} job${actual === 1 ? "" : "s"} at a time while the run limit is ` +
326
+ `${requested}. ${PARALLEL_LIMIT_CHANGE_ADVISORY} To get higher local capacity, stop this executor ` +
327
+ "and run drive-epic again.");
328
+ }
329
+ return (`The reused executor can serve ${actual} jobs at a time while the run limit is ${requested}; ` +
330
+ "the queue admits only the run limit, so the extra slots stay idle.");
331
+ }
302
332
  /**
303
333
  * Is the recorded pid still THIS executor?
304
334
  *
@@ -497,6 +527,7 @@ export async function ensureRunExecutor(args, deps) {
497
527
  epicRunId,
498
528
  baseUrl: access.baseUrl,
499
529
  executorId,
530
+ ...(args.maxConcurrent !== undefined ? { maxConcurrent: args.maxConcurrent } : {}),
500
531
  });
501
532
  const fail = (reason, message, executorMayBeRunning = false) => ({
502
533
  ok: false,
@@ -563,6 +594,10 @@ export async function ensureRunExecutor(args, deps) {
563
594
  pid: existing.pid,
564
595
  logPath: existing.logPath,
565
596
  recordPath: paths.record,
597
+ ...((existing.maxConcurrent ?? 1) > 1 ? { maxConcurrent: existing.maxConcurrent } : {}),
598
+ ...(describeReusedExecutorCapacity(existing.maxConcurrent ?? 1, args.maxConcurrent) !== undefined
599
+ ? { capacityNotice: describeReusedExecutorCapacity(existing.maxConcurrent ?? 1, args.maxConcurrent) }
600
+ : {}),
566
601
  };
567
602
  }
568
603
  return fail("existing-executor-unconfirmed", `an executor for run ${epicRunId} is already running (pid ${existing.pid}), but its ` +
@@ -606,7 +641,13 @@ export async function ensureRunExecutor(args, deps) {
606
641
  paths.log,
607
642
  deps.nodeExecutable,
608
643
  prepared.entrypoint,
609
- ...runExecutorArgs({ repoName, epicRunId, baseUrl: access.baseUrl, executorId }),
644
+ ...runExecutorArgs({
645
+ repoName,
646
+ epicRunId,
647
+ baseUrl: access.baseUrl,
648
+ executorId,
649
+ ...(args.maxConcurrent !== undefined ? { maxConcurrent: args.maxConcurrent } : {}),
650
+ }),
610
651
  ], { cwd: prepared.repoRoot, env: childEnv, detached: true });
611
652
  }
612
653
  catch {
@@ -627,6 +668,9 @@ export async function ensureRunExecutor(args, deps) {
627
668
  baseUrl: access.baseUrl,
628
669
  startedAt: new Date(spawnedAtMs).toISOString(),
629
670
  logPath: paths.log,
671
+ // BAPI-1581 — the actual capacity of the process just spawned; omitted at 1,
672
+ // which an absent key already means, so a legacy record stays byte-identical.
673
+ ...(args.maxConcurrent !== undefined && args.maxConcurrent > 1 ? { maxConcurrent: args.maxConcurrent } : {}),
630
674
  };
631
675
  try {
632
676
  await deps.writeFile(paths.record, `${JSON.stringify(record, null, 2)}\n`);
@@ -651,7 +695,15 @@ export async function ensureRunExecutor(args, deps) {
651
695
  ? `the executor (pid ${pid}) exited before it sent a heartbeat`
652
696
  : `no heartbeat from the executor (pid ${pid}) arrived within ${timeoutSeconds}s`, !exited);
653
697
  }
654
- return { ok: true, outcome: "started", executorId, pid, logPath: paths.log, recordPath: paths.record };
698
+ return {
699
+ ok: true,
700
+ outcome: "started",
701
+ executorId,
702
+ pid,
703
+ logPath: paths.log,
704
+ recordPath: paths.record,
705
+ ...((record.maxConcurrent ?? 1) > 1 ? { maxConcurrent: record.maxConcurrent } : {}),
706
+ };
655
707
  }
656
708
  finally {
657
709
  try {
@@ -1,7 +1,7 @@
1
1
  import { COMMANDS } from "./commands.generated.js";
2
2
  import { AGENTS } from "./agents.generated.js";
3
3
  import { DOCS, DOC_METADATA } from "./docs.generated.js";
4
- import { renderCommandForHost } from "./command-host.js";
4
+ import { renderCommandForHost, stripClaudeOnlyFrontmatter } from "./command-host.js";
5
5
  import { codexSkillAssets } from "./codex-skill-adapter.js";
6
6
  import { reconstructAgentMarkdown, translateAgentToCopilot, translateCommandToCopilot } from "./agent-utils.js";
7
7
  export const WORKFLOW_HOSTS = ["claude", "cursor", "codex", "copilot"];
@@ -23,7 +23,7 @@ export function buildPackagedAssetCatalog() {
23
23
  try {
24
24
  add(`.claude/commands/${filename}`, renderCommandForHost(filename, content, "claude-code"), "command", ["claude"], [workflow]);
25
25
  add(`.cursor/commands/${filename}`, renderCommandForHost(filename, content, "cursor"), "command", ["cursor"], [workflow]);
26
- const copilot = translateCommandToCopilot(filename, content);
26
+ const copilot = translateCommandToCopilot(filename, stripClaudeOnlyFrontmatter(content));
27
27
  add(`.github/prompts/${workflow}.prompt.md`, copilot.prompt, "prompt", ["copilot"], [workflow]);
28
28
  add(`.github/skills/${workflow}/SKILL.md`, copilot.skill, "skill", ["copilot"], [workflow]);
29
29
  }