@integrity-labs/agt-cli 0.28.557 → 0.28.559

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-JZBJIXLJ.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-WX4ILTCF.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-ZEYM62XD.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-OASMES54.js.map
@@ -53,7 +53,7 @@ import {
53
53
  safeWriteJsonAtomic,
54
54
  setConfigHash,
55
55
  tripClass
56
- } from "../chunk-KEZEMDUB.js";
56
+ } from "../chunk-FIOLFAYB.js";
57
57
  import {
58
58
  getProjectDir as getProjectDir2,
59
59
  getReadyTasks,
@@ -181,7 +181,7 @@ import {
181
181
  toOpencodeModel,
182
182
  transcriptActivityAgeSeconds,
183
183
  writeEgressAllowlist
184
- } from "../chunk-AD26EE7A.js";
184
+ } from "../chunk-TBP245GG.js";
185
185
  import {
186
186
  reapOrphanChannelMcps
187
187
  } from "../chunk-XWVM4KPK.js";
@@ -9321,7 +9321,20 @@ function hasRevokedResiduals(state7) {
9321
9321
  var pendingSessionRestarts = /* @__PURE__ */ new Map();
9322
9322
  var lastRestartWasExternal = /* @__PURE__ */ new Map();
9323
9323
  var pendingRestartVerifications = /* @__PURE__ */ new Map();
9324
- var restartBreaker = new RestartBreaker({ runtimeKey: (codeName) => agentRuntimeKey(codeName) });
9324
+ var agentCreatedAtMs = /* @__PURE__ */ new Map();
9325
+ function noteAgentCreatedAt(codeName, createdAt) {
9326
+ if (!createdAt) {
9327
+ agentCreatedAtMs.delete(codeName);
9328
+ return;
9329
+ }
9330
+ const ms = Date.parse(createdAt);
9331
+ if (Number.isFinite(ms)) agentCreatedAtMs.set(codeName, ms);
9332
+ else agentCreatedAtMs.delete(codeName);
9333
+ }
9334
+ var restartBreaker = new RestartBreaker({
9335
+ runtimeKey: (codeName) => agentRuntimeKey(codeName),
9336
+ agentCreatedAt: (codeName) => agentCreatedAtMs.get(codeName)
9337
+ });
9325
9338
  {
9326
9339
  const clamp = restartBreaker.getQuarantineOrderingClamp();
9327
9340
  if (clamp) {
@@ -9389,6 +9402,23 @@ function recordRestartForBreaker(codeName, reason) {
9389
9402
  `[restart-breaker] agent=${codeName} provisioning-reload churn at the trip bar: ${result.maxProvisioningBucket} restarts for one integration${culprit} in window (reason=${reason}); one more will auto-pause the agent; that integration is likely churning (ENG-7560, ENG-7812)`
9390
9403
  );
9391
9404
  }
9405
+ if (result.newAgentGraceSuppressedTrip) {
9406
+ const sup = result.newAgentGraceSuppressed;
9407
+ const tripClassName = sup?.class ?? "provisioning";
9408
+ const bucketKey = sup?.bucketKey ?? result.maxProvisioningBucketKey ?? "";
9409
+ const bucketCount = sup?.bucketCount ?? result.maxProvisioningBucket;
9410
+ const culprit = bucketKey ? ` [${bucketKey}]` : "";
9411
+ let expires = "unknown";
9412
+ if (result.newAgentGraceExpiresAt !== void 0) {
9413
+ const d = new Date(result.newAgentGraceExpiresAt);
9414
+ if (!Number.isNaN(d.getTime())) expires = d.toISOString();
9415
+ }
9416
+ const ageMins = sup ? Math.round(sup.agentAgeMs / 6e4) : void 0;
9417
+ const agePart = ageMins === void 0 ? "" : ` agent is ${ageMins}m old;`;
9418
+ log(
9419
+ `[restart-breaker] agent=${codeName} ${tripClassName} trip SUPPRESSED by the new-agent grace (reason=${reason}${culprit}, bucket=${bucketCount});${agePart} onboarding churn must not pause a new agent, but the grace ends ${expires} \u2014 if this churn is still going then, it WILL auto-pause (ENG-8690)`
9420
+ );
9421
+ }
9392
9422
  return;
9393
9423
  }
9394
9424
  const trip = result.trip;
@@ -10512,7 +10542,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
10512
10542
  var lastVersionCheckAt = 0;
10513
10543
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
10514
10544
  var lastResponsivenessProbeAt = 0;
10515
- var agtCliVersion = true ? "0.28.557" : "dev";
10545
+ var agtCliVersion = true ? "0.28.559" : "dev";
10516
10546
  function resolveBrewPath(execFileSync2) {
10517
10547
  try {
10518
10548
  const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -11816,7 +11846,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
11816
11846
  if (codeNames.length === 0) return;
11817
11847
  void (async () => {
11818
11848
  try {
11819
- const { collectDiagnostics } = await import("../persistent-session-JZBJIXLJ.js");
11849
+ const { collectDiagnostics } = await import("../persistent-session-WX4ILTCF.js");
11820
11850
  await api.post("/host/heartbeat", {
11821
11851
  host_id: hostId,
11822
11852
  agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor)
@@ -11924,7 +11954,7 @@ async function pollCycle() {
11924
11954
  }
11925
11955
  try {
11926
11956
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
11927
- const { collectDiagnostics } = await import("../persistent-session-JZBJIXLJ.js");
11957
+ const { collectDiagnostics } = await import("../persistent-session-WX4ILTCF.js");
11928
11958
  const diagCodeNames = [...agentState.persistentSessionAgents];
11929
11959
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor) : void 0;
11930
11960
  let tailscaleHostname;
@@ -12047,7 +12077,7 @@ async function pollCycle() {
12047
12077
  collectPanelessActivityProbes,
12048
12078
  getResponsivenessIntervalMs,
12049
12079
  occupancyQualificationClassifications
12050
- } = await import("../responsiveness-probe-GPH2SEAL.js");
12080
+ } = await import("../responsiveness-probe-FKJBQ6PQ.js");
12051
12081
  const probeIntervalMs = getResponsivenessIntervalMs();
12052
12082
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
12053
12083
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -12138,7 +12168,7 @@ async function pollCycle() {
12138
12168
  collectResponsivenessProbes,
12139
12169
  livePendingInboundOldestAgeSeconds,
12140
12170
  parkPendingInbound
12141
- } = await import("../responsiveness-probe-GPH2SEAL.js");
12171
+ } = await import("../responsiveness-probe-FKJBQ6PQ.js");
12142
12172
  const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-NDP36U7O.js");
12143
12173
  const wedgeNow = /* @__PURE__ */ new Date();
12144
12174
  const liveAgents = agentState.persistentSessionAgents;
@@ -12347,6 +12377,16 @@ async function pollCycle() {
12347
12377
  }
12348
12378
  const data = await api.post("/host/agents", { host_id: hostId });
12349
12379
  const agents = data.agents ?? [];
12380
+ {
12381
+ const seen = /* @__PURE__ */ new Set();
12382
+ for (const agent of agents) {
12383
+ seen.add(agent.code_name);
12384
+ noteAgentCreatedAt(agent.code_name, agent.created_at);
12385
+ }
12386
+ for (const codeName of [...agentCreatedAtMs.keys()]) {
12387
+ if (!seen.has(codeName)) agentCreatedAtMs.delete(codeName);
12388
+ }
12389
+ }
12350
12390
  const restartAcks = /* @__PURE__ */ new Map();
12351
12391
  const restartClears = [];
12352
12392
  for (const agent of agents) {
@@ -15672,7 +15712,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
15672
15712
  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}`));
15673
15713
  void (async () => {
15674
15714
  try {
15675
- const { collectDiagnostics } = await import("../persistent-session-JZBJIXLJ.js");
15715
+ const { collectDiagnostics } = await import("../persistent-session-WX4ILTCF.js");
15676
15716
  await api.post("/host/heartbeat", {
15677
15717
  host_id: hostId,
15678
15718
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor)
@@ -15722,7 +15762,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
15722
15762
  }
15723
15763
  try {
15724
15764
  const hostId = await getHostId();
15725
- const { collectDiagnostics } = await import("../persistent-session-JZBJIXLJ.js");
15765
+ const { collectDiagnostics } = await import("../persistent-session-WX4ILTCF.js");
15726
15766
  await api.post("/host/heartbeat", {
15727
15767
  host_id: hostId,
15728
15768
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor)
@@ -16294,7 +16334,7 @@ async function processClaudePairSessions(agents) {
16294
16334
  killPairSession,
16295
16335
  pairTmuxSession,
16296
16336
  finalizeClaudePairOnboarding
16297
- } = await import("../claude-pair-runtime-ZEYM62XD.js");
16337
+ } = await import("../claude-pair-runtime-OASMES54.js");
16298
16338
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
16299
16339
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
16300
16340
  const killed = await killPairSession(pairTmuxSession(pairId));