agent-dag 1.33.60 → 1.33.61

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/bin/agent-dag.js CHANGED
@@ -28,7 +28,7 @@ import { dirname, join } from "node:path";
28
28
  import { fileURLToPath } from "node:url";
29
29
  import { spawnSpec } from "../src/server/exec.mjs";
30
30
  import { installedVersion, npxRestartSpec } from "../src/server/self-update.mjs";
31
- import { workerExitAction } from "../src/server/supervisor.mjs";
31
+ import { dieOfSignal, workerExitAction } from "../src/server/supervisor.mjs";
32
32
 
33
33
  const BIN_DIR = dirname(fileURLToPath(import.meta.url));
34
34
  const WORKER = join(BIN_DIR, "deck.js");
@@ -94,8 +94,11 @@ function launch(respawn) {
94
94
  return;
95
95
  }
96
96
  // Anything else is the worker's own verdict and belongs to whoever started
97
- // us — including the ccdeck wrapper, which exits with our code in turn.
98
- if (signal) process.kill(process.pid, signal);
97
+ // us — including the ccdeck wrapper, which exits with our code in turn. A
98
+ // worker killed by a signal is reported by dying of the same one; doing
99
+ // that naively re-enters the handlers below and exits 0 — see
100
+ // supervisor.mjs.
101
+ if (signal) dieOfSignal(signal);
99
102
  else process.exit(next.code);
100
103
  });
101
104
 
@@ -182,7 +185,7 @@ function launchNpx() {
182
185
  clearInterval(probe);
183
186
  child = null;
184
187
  if (stopping || served) {
185
- if (signal) process.kill(process.pid, signal);
188
+ if (signal) dieOfSignal(signal);
186
189
  else process.exit(code ?? 0);
187
190
  return;
188
191
  }