@integrity-labs/agt-cli 0.28.279 → 0.28.281

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.
@@ -18,7 +18,7 @@ import {
18
18
  resolveConnectivityProbe,
19
19
  worseConnectivityOutcome,
20
20
  wrapScheduledTaskPrompt
21
- } from "./chunk-7USLYY43.js";
21
+ } from "./chunk-C4QMCOAN.js";
22
22
  import {
23
23
  parsePsRows
24
24
  } from "./chunk-XWVM4KPK.js";
@@ -5882,7 +5882,7 @@ function requireHost() {
5882
5882
  }
5883
5883
 
5884
5884
  // src/lib/api-client.ts
5885
- var agtCliVersion = true ? "0.28.279" : "dev";
5885
+ var agtCliVersion = true ? "0.28.281" : "dev";
5886
5886
  var lastConfigHash = null;
5887
5887
  function setConfigHash(hash) {
5888
5888
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -8162,4 +8162,4 @@ export {
8162
8162
  managerInstallSystemUnitCommand,
8163
8163
  managerUninstallSystemUnitCommand
8164
8164
  };
8165
- //# sourceMappingURL=chunk-LCCC2AGQ.js.map
8165
+ //# sourceMappingURL=chunk-QVAOI4TB.js.map
@@ -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-SZ4TUGED.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-7H3IYXXP.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-EXW6NBLU.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-JOYTDNXZ.js.map
@@ -38,7 +38,7 @@ import {
38
38
  requireHost,
39
39
  safeWriteJsonAtomic,
40
40
  setConfigHash
41
- } from "../chunk-LCCC2AGQ.js";
41
+ } from "../chunk-QVAOI4TB.js";
42
42
  import {
43
43
  getProjectDir as getProjectDir2,
44
44
  getReadyTasks,
@@ -125,7 +125,7 @@ import {
125
125
  takeZombieDetection,
126
126
  transcriptActivityAgeSeconds,
127
127
  writeEgressAllowlist
128
- } from "../chunk-7USLYY43.js";
128
+ } from "../chunk-C4QMCOAN.js";
129
129
  import {
130
130
  reapOrphanChannelMcps
131
131
  } from "../chunk-XWVM4KPK.js";
@@ -626,7 +626,10 @@ function reaperRestartBreakerReason(activeKeys) {
626
626
  var PROVISIONING_RELOAD_REASONS = /* @__PURE__ */ new Set([
627
627
  "hot-reload-mcp",
628
628
  "managed-mcp-churn",
629
- "bind-remediation"
629
+ "bind-remediation",
630
+ // ENG-7576: the dashboard integration-add stop itself - the first restart of
631
+ // the very burst this class exists for, previously uncounted entirely.
632
+ "integration-change"
630
633
  ]);
631
634
  function isProvisioningReloadReason(reason) {
632
635
  return PROVISIONING_RELOAD_REASONS.has(reason);
@@ -6286,7 +6289,15 @@ async function maybeResumeReconcile(agent) {
6286
6289
  }
6287
6290
  }
6288
6291
  function restartReasonBindsNewMcp(breakerReason) {
6289
- return breakerReason === "hot-reload-mcp" || breakerReason === "managed-mcp-churn" || breakerReason === "bind-remediation" || breakerReason === "channel-set-change";
6292
+ return breakerReason === "hot-reload-mcp" || breakerReason === "managed-mcp-churn" || breakerReason === "bind-remediation" || breakerReason === "channel-set-change" || // ENG-7576: the dashboard integration-add stop (the poll's restart-consumption
6293
+ // loop) is the archetypal "stop to rebind a changed MCP set" - the docstring
6294
+ // above always described it, but the path passed no breakerReason so it never
6295
+ // hit this predicate. Including it arms the ENG-6174 respawn verification for
6296
+ // the ONE real respawn of an integration add.
6297
+ breakerReason === "integration-change";
6298
+ }
6299
+ function dashboardRestartBreakerReason(restartReason) {
6300
+ return restartReason === "integration-change" ? "integration-change" : void 0;
6290
6301
  }
6291
6302
  function scheduleSessionRestart(codeName, delayMs, reason, breakerReason = "hot-reload-mcp", beforeStop) {
6292
6303
  const existing = pendingSessionRestarts.get(codeName);
@@ -6659,7 +6670,7 @@ function stopPersistentSessionAndForgetMcpBaseline(codeName, breakerReason, gate
6659
6670
  if (breakerReason) {
6660
6671
  recordRestartForBreaker(codeName, breakerReason);
6661
6672
  }
6662
- if (breakerReason && breakerReason !== "agent-requested" && breakerReason !== "channel-restart-flag") {
6673
+ if (breakerReason && breakerReason !== "agent-requested" && breakerReason !== "channel-restart-flag" && breakerReason !== "integration-change") {
6663
6674
  const restartAgentId = agentState.codeNameToAgentId.get(codeName);
6664
6675
  if (restartAgentId) {
6665
6676
  void api.post("/host/restart-event", {
@@ -6827,7 +6838,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
6827
6838
  var lastVersionCheckAt = 0;
6828
6839
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
6829
6840
  var lastResponsivenessProbeAt = 0;
6830
- var agtCliVersion = true ? "0.28.279" : "dev";
6841
+ var agtCliVersion = true ? "0.28.281" : "dev";
6831
6842
  function resolveBrewPath(execFileSync2) {
6832
6843
  try {
6833
6844
  const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -7677,7 +7688,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
7677
7688
  if (codeNames.length === 0) return;
7678
7689
  void (async () => {
7679
7690
  try {
7680
- const { collectDiagnostics } = await import("../persistent-session-SZ4TUGED.js");
7691
+ const { collectDiagnostics } = await import("../persistent-session-7H3IYXXP.js");
7681
7692
  await api.post("/host/heartbeat", {
7682
7693
  host_id: hostId,
7683
7694
  agent_diagnostics: collectDiagnostics(codeNames)
@@ -7775,7 +7786,7 @@ async function pollCycle() {
7775
7786
  }
7776
7787
  try {
7777
7788
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
7778
- const { collectDiagnostics } = await import("../persistent-session-SZ4TUGED.js");
7789
+ const { collectDiagnostics } = await import("../persistent-session-7H3IYXXP.js");
7779
7790
  const diagCodeNames = [...agentState.persistentSessionAgents];
7780
7791
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
7781
7792
  let tailscaleHostname;
@@ -7923,7 +7934,7 @@ async function pollCycle() {
7923
7934
  const {
7924
7935
  collectResponsivenessProbes,
7925
7936
  getResponsivenessIntervalMs
7926
- } = await import("../responsiveness-probe-MKFZAUV5.js");
7937
+ } = await import("../responsiveness-probe-PFJM4QMQ.js");
7927
7938
  const probeIntervalMs = getResponsivenessIntervalMs();
7928
7939
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
7929
7940
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -7955,7 +7966,7 @@ async function pollCycle() {
7955
7966
  collectResponsivenessProbes,
7956
7967
  livePendingInboundOldestAgeSeconds,
7957
7968
  parkPendingInbound
7958
- } = await import("../responsiveness-probe-MKFZAUV5.js");
7969
+ } = await import("../responsiveness-probe-PFJM4QMQ.js");
7959
7970
  const { getProjectDir: wedgeProjectDir } = await import("../claude-scheduler-FATCLHDM.js");
7960
7971
  const wedgeNow = /* @__PURE__ */ new Date();
7961
7972
  const liveAgents = agentState.persistentSessionAgents;
@@ -8174,13 +8185,31 @@ async function pollCycle() {
8174
8185
  const lastProcessed = prev?.lastRestartProcessedAt ?? null;
8175
8186
  const alreadyServiced = lastProcessed != null && Date.parse(lastProcessed) >= Date.parse(requested);
8176
8187
  if (!alreadyServiced) {
8177
- log(`[restart] Dashboard requested restart for '${agent.code_name}' at ${requested}`);
8188
+ const restartReason = agent.restart_reason ?? null;
8189
+ log(
8190
+ `[restart] Dashboard requested restart for '${agent.code_name}' at ${requested} (reason=${restartReason ?? "manual"})`
8191
+ );
8178
8192
  try {
8179
8193
  const { execSync: es } = await import("child_process");
8180
8194
  es(`tmux kill-session -t agt-${agent.code_name} 2>/dev/null`, { stdio: "ignore" });
8181
8195
  } catch {
8182
8196
  }
8183
- stopPersistentSessionAndForgetMcpBaseline(agent.code_name);
8197
+ const breakerReason = dashboardRestartBreakerReason(restartReason);
8198
+ stopPersistentSessionAndForgetMcpBaseline(agent.code_name, breakerReason);
8199
+ if (breakerReason && restartReasonBindsNewMcp(breakerReason)) {
8200
+ noteRestartRequested(agent.code_name, requested);
8201
+ beginRestartTiming(
8202
+ agent.code_name,
8203
+ { reason: "integration-change (dashboard restart)", delivered: null, injectDelayMs: null },
8204
+ log
8205
+ );
8206
+ markRestartStopped(agent.code_name, log);
8207
+ const prior = pendingRestartVerifications.get(agent.code_name);
8208
+ pendingRestartVerifications.set(agent.code_name, {
8209
+ firedAt: Date.now(),
8210
+ attempts: prior?.attempts ?? 0
8211
+ });
8212
+ }
8184
8213
  restartAcks.set(agent.agent_id, requested);
8185
8214
  }
8186
8215
  restartClears.push({ agentId: agent.agent_id, requestedAt: requested });
@@ -10845,7 +10874,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
10845
10874
  void api.post("/host/restart-ack", { host_id: hostId, agent_id: agentId, restart_requested_at: requestedAt }).catch((err) => log(`[restart-lane] ack failed for '${codeName}': ${err.message}`));
10846
10875
  void (async () => {
10847
10876
  try {
10848
- const { collectDiagnostics } = await import("../persistent-session-SZ4TUGED.js");
10877
+ const { collectDiagnostics } = await import("../persistent-session-7H3IYXXP.js");
10849
10878
  await api.post("/host/heartbeat", {
10850
10879
  host_id: hostId,
10851
10880
  agent_diagnostics: collectDiagnostics([codeName])
@@ -10895,7 +10924,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
10895
10924
  }
10896
10925
  try {
10897
10926
  const hostId = await getHostId();
10898
- const { collectDiagnostics } = await import("../persistent-session-SZ4TUGED.js");
10927
+ const { collectDiagnostics } = await import("../persistent-session-7H3IYXXP.js");
10899
10928
  await api.post("/host/heartbeat", {
10900
10929
  host_id: hostId,
10901
10930
  agent_diagnostics: collectDiagnostics([codeName])
@@ -11299,7 +11328,7 @@ async function processClaudePairSessions(agents) {
11299
11328
  killPairSession,
11300
11329
  pairTmuxSession,
11301
11330
  finalizeClaudePairOnboarding
11302
- } = await import("../claude-pair-runtime-EXW6NBLU.js");
11331
+ } = await import("../claude-pair-runtime-JOYTDNXZ.js");
11303
11332
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
11304
11333
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
11305
11334
  const killed = await killPairSession(pairTmuxSession(pairId));
@@ -12200,6 +12229,7 @@ export {
12200
12229
  claudeCodeUpgradeMarkerPath,
12201
12230
  claudeCodeUpgradeThrottled,
12202
12231
  claudeManagedSettingsPath,
12232
+ dashboardRestartBreakerReason,
12203
12233
  ensureClaudeManagedSettings,
12204
12234
  extractCharterSlackPeers,
12205
12235
  extractCharterTelegramPeers,