@algosuite/vo-mcp 0.2.0-beta.66 → 0.2.0-beta.67

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.
@@ -2440,8 +2440,6 @@ var DEFAULT_DRAIN_CHECK_MS = 3e4;
2440
2440
  var MAX_DRAIN_CAP_MS = 6 * 60 * 60 * 1e3;
2441
2441
  var MIN_DRAIN_CHECK_MS = 1e3;
2442
2442
  var MAX_DRAIN_CHECK_MS = 5 * 60 * 1e3;
2443
- var UPDATE_RESTART_ERROR_MESSAGE = "runner update restart after drain timeout";
2444
- var UPDATE_RESTART_RESULT = "runner_update_restart";
2445
2443
  var sleepMs = (ms) => new Promise((resolve5) => setTimeout(resolve5, ms));
2446
2444
  function positiveNumber(raw) {
2447
2445
  if (raw === void 0 || raw === null || String(raw).trim() === "") return null;
@@ -2489,34 +2487,13 @@ function describeBusy(active) {
2489
2487
  const ids = active.ids.length > 0 ? ` [${active.ids.join(", ")}]` : " [ids unavailable]";
2490
2488
  return `${active.count} active task(s)${ids}`;
2491
2489
  }
2492
- async function markCappedTasks({ active, failInFlightTask, log }) {
2493
- if (active.ids.length === 0) {
2494
- if (active.count > 0 || !active.known) {
2495
- log(`update drain cap reached with ${describeBusy(active)} \u2014 cannot annotate tasks the runner did not name`);
2496
- }
2497
- return [];
2498
- }
2499
- const marked = [];
2500
- for (const taskId of active.ids) {
2501
- try {
2502
- await failInFlightTask(taskId, {
2503
- message: UPDATE_RESTART_ERROR_MESSAGE,
2504
- result: UPDATE_RESTART_RESULT,
2505
- runnerId: active.runnerId,
2506
- runnerInstanceId: active.runnerInstanceId
2507
- });
2508
- marked.push(taskId);
2509
- } catch (error) {
2510
- log(`could not mark task ${taskId} before update restart: ${error instanceof Error ? error.message : String(error)}`);
2511
- }
2512
- }
2513
- return marked;
2490
+ function describeDeferral(active) {
2491
+ if (!active.known) return "status unreadable from a running child (assumed busy)";
2492
+ return `${active.count} active task(s)`;
2514
2493
  }
2515
2494
  async function awaitRunnerUpdateDrain({
2516
2495
  readStatus,
2517
2496
  isChildRunning = () => true,
2518
- failInFlightTask = async () => {
2519
- },
2520
2497
  drainable = false,
2521
2498
  env = {},
2522
2499
  now = Date.now,
@@ -2565,15 +2542,18 @@ async function awaitRunnerUpdateDrain({
2565
2542
  return { proceed: true, detail: "runner idle", capped: false, waitedMs: elapsedMs, checks, markedTaskIds: [] };
2566
2543
  }
2567
2544
  if (step.action === "cap") {
2568
- log(`update drain cap reached after ${Math.round(elapsedMs / 1e3)}s (cap ${Math.round(capMs / 1e3)}s) \u2014 ${describeBusy(active)}; marking task(s) before restart`);
2569
- const markedTaskIds = await markCappedTasks({ active, failInFlightTask, log });
2545
+ log(`update drain cap reached after ${Math.round(elapsedMs / 1e3)}s (cap ${Math.round(capMs / 1e3)}s) \u2014 ${describeBusy(active)}; deferring update until idle`);
2570
2546
  return {
2571
- proceed: true,
2547
+ proceed: false,
2572
2548
  capped: true,
2573
- detail: `update restart applied after drain cap; marked ${markedTaskIds.length} task(s) as "${UPDATE_RESTART_ERROR_MESSAGE}"`,
2549
+ // This reaches the runner-control `detail` field; keep it bounded and
2550
+ // reserve task IDs for the local log above.
2551
+ detail: `deferred safely: update drain cap reached with ${describeDeferral(active)}; retry when the runner is idle`,
2574
2552
  waitedMs: elapsedMs,
2575
2553
  checks,
2576
- markedTaskIds
2554
+ // Kept for result-shape compatibility; a safe deferral never writes
2555
+ // a terminal task outcome or stops the child.
2556
+ markedTaskIds: []
2577
2557
  };
2578
2558
  }
2579
2559
  const fingerprint = `${step.busy}:${active.ids.join(",")}`;
@@ -3694,7 +3674,6 @@ async function main() {
3694
3674
  drainable: bundledAction,
3695
3675
  env: process.env,
3696
3676
  isChildRunning: () => supervisorChildIsRunning(child),
3697
- failInFlightTask: (taskId, patch) => client.postProgress(taskId, { status: "failed", message: patch.message, result: patch.result, ...patch.runnerId ? { runner_id: patch.runnerId } : {}, ...patch.runnerInstanceId ? { runner_instance_id: patch.runnerInstanceId } : {} }),
3698
3677
  log: (message) => console.warn(`[vo-runner supervisor] ${message}`)
3699
3678
  });
3700
3679
  if (!drain.proceed) {