agent-dag 1.33.86 → 1.33.87

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,8 @@ import { dirname, join } from "node:path";
28
28
  import { fileURLToPath } from "node:url";
29
29
  import { npxFailureHint, npxFailureSummary, npxLaunch } from "../src/server/npx.mjs";
30
30
  import {
31
- bareSpecName, clearRestartFailure, installedVersion, npxRestartSpec, recordRestartFailure,
31
+ bareSpecName, claimRestartFailureKey, clearRestartFailure, installedVersion, npxRestartSpec,
32
+ recordRestartFailure,
32
33
  } from "../src/server/self-update.mjs";
33
34
  import { dieOfSignal, workerExitAction } from "../src/server/supervisor.mjs";
34
35
 
@@ -38,6 +39,15 @@ const PKG_ROOT = dirname(BIN_DIR);
38
39
 
39
40
  const VERSION = installedVersion(PKG_ROOT) ?? "?";
40
41
 
42
+ // Who the restart-failure note below belongs to. Several decks of the same
43
+ // package run out of one home directory — two `npx ccdeck` runs even share the
44
+ // _npx directory and therefore the version — so a note named after the package
45
+ // alone was read by every one of them, and a deck that had never asked for an
46
+ // update reported someone else's failed npx as its own. Our pid is unique among
47
+ // the decks alive on the machine, and putting it in our own environment is what
48
+ // carries it to the worker: launch() spawns with a copy of it.
49
+ claimRestartFailureKey();
50
+
41
51
  // The port the worker actually bound, which is not necessarily the one it was
42
52
  // asked for — the first launch falls back to a random port when 4317 is taken.
43
53
  // Re-launching without this is how a restart silently moves the deck out from