@integrity-labs/agt-cli 0.28.130 → 0.28.131

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.
@@ -100,7 +100,7 @@ async function spawnPairSession(session) {
100
100
  return { ok: true };
101
101
  } catch {
102
102
  }
103
- const { resolveClaudeBinary } = await import("./persistent-session-YU3FIAUK.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-6MR7EVEN.js");
104
104
  const claudeBin = resolveClaudeBinary();
105
105
  const pairEnv = {
106
106
  ...process.env,
@@ -373,4 +373,4 @@ export {
373
373
  startClaudePair,
374
374
  submitClaudePairCode
375
375
  };
376
- //# sourceMappingURL=claude-pair-runtime-F5KZNGVO.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-NJDB2EPV.js.map
@@ -28,7 +28,7 @@ import {
28
28
  requireHost,
29
29
  safeWriteJsonAtomic,
30
30
  setConfigHash
31
- } from "../chunk-RTSX4A54.js";
31
+ } from "../chunk-N5N3CA6W.js";
32
32
  import {
33
33
  getProjectDir as getProjectDir2,
34
34
  getReadyTasks,
@@ -72,7 +72,7 @@ import {
72
72
  takeZombieDetection,
73
73
  transcriptActivityAgeSeconds,
74
74
  writeEgressAllowlist
75
- } from "../chunk-XBF7ACI5.js";
75
+ } from "../chunk-U3CDNNEK.js";
76
76
  import {
77
77
  FLAGS_SCHEMA_VERSION,
78
78
  FLAG_REGISTRY,
@@ -374,16 +374,38 @@ function findMcpChildrenForAgent(args) {
374
374
  return matched;
375
375
  }
376
376
  function reapStaleMcpChildren(args) {
377
- const { log: log2, codeName, serverKeys, mcpJson, graceMs = 5e3 } = args;
377
+ const { log: log2, codeName, serverKeys, mcpJson, graceMs = 5e3, isolated = false } = args;
378
378
  if (serverKeys.length === 0) return [];
379
- const runPs = args.runPs ?? (() => execFileSync("ps", ["-eo", "pid,ppid,args"], { encoding: "utf-8", timeout: 5e3 }));
380
- const killProcess = args.killProcess ?? ((pid, signal) => {
379
+ const runPs = args.runPs ?? (isolated ? () => execFileSync("docker", ["exec", `agt-${codeName}`, "ps", "-eo", "pid,ppid,args"], {
380
+ encoding: "utf-8",
381
+ timeout: 8e3
382
+ }) : () => execFileSync("ps", ["-eo", "pid,ppid,args"], { encoding: "utf-8", timeout: 5e3 }));
383
+ const killProcess = args.killProcess ?? (isolated ? (pid, signal) => {
384
+ try {
385
+ execFileSync(
386
+ "docker",
387
+ ["exec", `agt-${codeName}`, "kill", signal === "SIGKILL" ? "-KILL" : "-TERM", String(pid)],
388
+ { timeout: 8e3, stdio: "ignore" }
389
+ );
390
+ } catch {
391
+ }
392
+ } : (pid, signal) => {
381
393
  try {
382
394
  process.kill(pid, signal);
383
395
  } catch {
384
396
  }
385
397
  });
386
- const isAlive = args.isAlive ?? ((pid) => {
398
+ const isAlive = args.isAlive ?? (isolated ? (pid) => {
399
+ try {
400
+ execFileSync("docker", ["exec", `agt-${codeName}`, "kill", "-0", String(pid)], {
401
+ timeout: 8e3,
402
+ stdio: "ignore"
403
+ });
404
+ return true;
405
+ } catch {
406
+ return false;
407
+ }
408
+ } : (pid) => {
387
409
  try {
388
410
  process.kill(pid, 0);
389
411
  return true;
@@ -399,7 +421,7 @@ function reapStaleMcpChildren(args) {
399
421
  return [];
400
422
  }
401
423
  const rows = parsePsRows(psOutput);
402
- const targets = findMcpChildrenForAgent({ rows, codeName, serverKeys, mcpJson });
424
+ const targets = findMcpChildrenForAgent({ rows, codeName, serverKeys, mcpJson, inContainer: isolated });
403
425
  if (targets.length === 0) return [];
404
426
  const byPid = new Map(rows.map((r) => [r.pid, r]));
405
427
  const describe = (pid) => {
@@ -437,7 +459,8 @@ function reapStaleMcpChildren(args) {
437
459
  rows: parsePsRows(freshPsOutput),
438
460
  codeName,
439
461
  serverKeys,
440
- mcpJson
462
+ mcpJson,
463
+ inContainer: isolated
441
464
  })
442
465
  );
443
466
  const stragglers = targets.filter((pid) => isAlive(pid) && stillOwned.has(pid));
@@ -7017,7 +7040,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
7017
7040
  var lastVersionCheckAt = 0;
7018
7041
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
7019
7042
  var lastResponsivenessProbeAt = 0;
7020
- var agtCliVersion = true ? "0.28.130" : "dev";
7043
+ var agtCliVersion = true ? "0.28.131" : "dev";
7021
7044
  function resolveBrewPath(execFileSync4) {
7022
7045
  try {
7023
7046
  const out = execFileSync4("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -8144,7 +8167,7 @@ async function pollCycle() {
8144
8167
  }
8145
8168
  try {
8146
8169
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
8147
- const { collectDiagnostics } = await import("../persistent-session-YU3FIAUK.js");
8170
+ const { collectDiagnostics } = await import("../persistent-session-6MR7EVEN.js");
8148
8171
  const diagCodeNames = [...agentState.persistentSessionAgents];
8149
8172
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
8150
8173
  let tailscaleHostname;
@@ -8245,7 +8268,7 @@ async function pollCycle() {
8245
8268
  const {
8246
8269
  collectResponsivenessProbes,
8247
8270
  getResponsivenessIntervalMs
8248
- } = await import("../responsiveness-probe-TN5JW2NM.js");
8271
+ } = await import("../responsiveness-probe-GWJ6TKO2.js");
8249
8272
  const probeIntervalMs = getResponsivenessIntervalMs();
8250
8273
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
8251
8274
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -8277,7 +8300,7 @@ async function pollCycle() {
8277
8300
  collectResponsivenessProbes,
8278
8301
  livePendingInboundOldestAgeSeconds,
8279
8302
  parkPendingInbound
8280
- } = await import("../responsiveness-probe-TN5JW2NM.js");
8303
+ } = await import("../responsiveness-probe-GWJ6TKO2.js");
8281
8304
  const { getProjectDir: wedgeProjectDir } = await import("../claude-scheduler-FATCLHDM.js");
8282
8305
  const wedgeNow = /* @__PURE__ */ new Date();
8283
8306
  const liveAgents = agentState.persistentSessionAgents;
@@ -8550,7 +8573,9 @@ async function pollCycle() {
8550
8573
  await healthCheckGateways(agentStates);
8551
8574
  if (Date.now() - lastChannelSweepAt >= CHANNEL_SWEEP_INTERVAL_MS) {
8552
8575
  lastChannelSweepAt = Date.now();
8553
- const agentCodeNames = new Set(agentStates.map((a) => a.codeName));
8576
+ const agentCodeNames = new Set(
8577
+ agentStates.map((a) => a.codeName).filter((c) => isolationMode(c) !== "docker")
8578
+ );
8554
8579
  sweepChannelProcesses({
8555
8580
  agentCodeNames,
8556
8581
  dryRun: CHANNEL_SWEEP_DRY_RUN,
@@ -9695,7 +9720,11 @@ async function processAgent(agent, agentStates) {
9695
9720
  log,
9696
9721
  codeName: agent.code_name,
9697
9722
  serverKeys: affectedServerKeys,
9698
- mcpJson: mcpJsonForReap
9723
+ mcpJson: mcpJsonForReap,
9724
+ // ENG-6670: enumerate + signal in the container PID namespace
9725
+ // for Docker-isolated agents (host ps can't see in-container
9726
+ // children; a host kill on a container pid would be wrong).
9727
+ isolated: isolationMode(agent.code_name) === "docker"
9699
9728
  });
9700
9729
  }
9701
9730
  const names = integrations.map((i) => i.display_name || i.definition_id).join(", ");
@@ -11820,7 +11849,7 @@ async function processClaudePairSessions(agents) {
11820
11849
  killPairSession,
11821
11850
  pairTmuxSession,
11822
11851
  finalizeClaudePairOnboarding
11823
- } = await import("../claude-pair-runtime-F5KZNGVO.js");
11852
+ } = await import("../claude-pair-runtime-NJDB2EPV.js");
11824
11853
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
11825
11854
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
11826
11855
  const killed = await killPairSession(pairTmuxSession(pairId));