@integrity-labs/agt-cli 0.28.636 → 0.28.637

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.
@@ -16,7 +16,7 @@ import {
16
16
  rotateDailySession,
17
17
  sessionFileExists,
18
18
  todayLocalIso
19
- } from "./chunk-O4ADFO57.js";
19
+ } from "./chunk-JT2JQUK3.js";
20
20
  import {
21
21
  reapOrphanChannelMcps
22
22
  } from "./chunk-XWVM4KPK.js";
@@ -4313,4 +4313,4 @@ export {
4313
4313
  stopAllSessionsAndWait,
4314
4314
  getProjectDir
4315
4315
  };
4316
- //# sourceMappingURL=chunk-4HVSMJFM.js.map
4316
+ //# sourceMappingURL=chunk-W4GVD3KK.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-7UX2BZMT.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-SZLOBXBQ.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-TROVZ3M5.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-CE72HQE7.js.map
@@ -54,7 +54,7 @@ import {
54
54
  safeWriteJsonAtomic,
55
55
  setConfigHash,
56
56
  tripClass
57
- } from "../chunk-KIOTRBOI.js";
57
+ } from "../chunk-3JBA6RYG.js";
58
58
  import {
59
59
  getProjectDir as getProjectDir2,
60
60
  getReadyTasks,
@@ -110,7 +110,7 @@ import {
110
110
  takeZombieDetection,
111
111
  toOpencodeModel,
112
112
  writeEgressAllowlist
113
- } from "../chunk-4HVSMJFM.js";
113
+ } from "../chunk-W4GVD3KK.js";
114
114
  import {
115
115
  ACCOUNT_ENFORCEMENT_MARKER_FILENAME,
116
116
  AnchorSessionClient,
@@ -187,7 +187,7 @@ import {
187
187
  subagentActivityAgeSeconds,
188
188
  sumTranscriptUsageInWindow,
189
189
  transcriptActivityAgeSeconds
190
- } from "../chunk-O4ADFO57.js";
190
+ } from "../chunk-JT2JQUK3.js";
191
191
  import {
192
192
  reapOrphanChannelMcps
193
193
  } from "../chunk-XWVM4KPK.js";
@@ -1273,15 +1273,21 @@ function decideStaleTripClear(opts) {
1273
1273
 
1274
1274
  // src/lib/pending-suppression-reports.ts
1275
1275
  var pending = /* @__PURE__ */ new Map();
1276
- function queueSuppressionReport(codeName, payload) {
1277
- pending.set(codeName, payload);
1278
- }
1279
- function takeSuppressionReport(codeName, agentId) {
1280
- const payload = pending.get(codeName);
1281
- if (!payload) return null;
1282
- if (!agentId) return null;
1276
+ function queueSuppressionReport(codeName, reason, payload) {
1277
+ let byReason = pending.get(codeName);
1278
+ if (!byReason) {
1279
+ byReason = /* @__PURE__ */ new Map();
1280
+ pending.set(codeName, byReason);
1281
+ }
1282
+ byReason.set(reason, { ...payload, reason });
1283
+ }
1284
+ function takeSuppressionReports(codeName, agentId) {
1285
+ const byReason = pending.get(codeName);
1286
+ if (!byReason || byReason.size === 0) return [];
1287
+ if (!agentId) return [];
1288
+ const payloads = [...byReason.values()];
1283
1289
  pending.delete(codeName);
1284
- return payload;
1290
+ return payloads;
1285
1291
  }
1286
1292
 
1287
1293
  // src/lib/resume-reconciler.ts
@@ -10895,6 +10901,28 @@ function recordRestartForBreaker(codeName, reason) {
10895
10901
  }
10896
10902
  }
10897
10903
  const result = restartBreaker.record(codeName, reason, integrationKey);
10904
+ if (result.scheduledLoop) {
10905
+ const { count, windowMs, reason: loopReason } = result.scheduledLoop;
10906
+ const windowMins = Math.round(windowMs / 6e4);
10907
+ log(
10908
+ `[restart-breaker] agent=${codeName} SCHEDULED-RESTART LOOP: ${count} '${loopReason}' restarts in ${windowMins}m. A correct day rollover fires ONCE per agent per day, so this is a platform bug, not an unhealthy agent. The agent is deliberately NOT paused (ENG-9138) \u2014 reporting it instead so somebody fixes the rollover.`
10909
+ );
10910
+ queueSuppressionReport(codeName, "scheduled_rollover_loop", {
10911
+ trip_class: "scheduled",
10912
+ // No integration is involved in a scheduled restart, and the route renders
10913
+ // an empty key as "an unattributed integration" rather than inventing one.
10914
+ bucket_key: "",
10915
+ bucket_count: count,
10916
+ scheduled_window_ms: windowMs,
10917
+ scheduled_reason: loopReason,
10918
+ // Not applicable: this suppression has nothing to do with the agent's age
10919
+ // or the new-agent grace. Sent as null rather than 0, which would read as
10920
+ // "brand new" — the one wrong answer (same reasoning as ENG-8679 AC4).
10921
+ agent_age_ms: null,
10922
+ grace_expires_at: null
10923
+ });
10924
+ maybeReportPendingSuppression(codeName);
10925
+ }
10898
10926
  if (!result.tripped || !result.trip) {
10899
10927
  if (isProvisioningReloadReason(reason) && result.maxProvisioningBucket >= RESTART_BREAKER_PROVISIONING_MAX) {
10900
10928
  const culprit = result.maxProvisioningBucketKey ? ` [${result.maxProvisioningBucketKey}]` : "";
@@ -10928,7 +10956,7 @@ function recordRestartForBreaker(codeName, reason) {
10928
10956
  agent_age_ms: sup ? sup.agentAgeMs : null,
10929
10957
  grace_expires_at: result.newAgentGraceExpiresAt ?? null
10930
10958
  };
10931
- queueSuppressionReport(codeName, suppressionPayload);
10959
+ queueSuppressionReport(codeName, "new_agent_grace", suppressionPayload);
10932
10960
  if (!agentState.codeNameToAgentId.has(codeName)) {
10933
10961
  log(
10934
10962
  `[restart-breaker] agent=${codeName} suppression report DEFERRED: no agent_id known yet (cold-start before processAgent). The local suppression still applied; the report is queued and will be sent on the next poll once the id is cached (ENG-8679).`
@@ -10966,13 +10994,15 @@ function maybeReportCurrentTrip(codeName) {
10966
10994
  }
10967
10995
  function maybeReportPendingSuppression(codeName) {
10968
10996
  const agentId = agentState.codeNameToAgentId.get(codeName);
10969
- const payload = takeSuppressionReport(codeName, agentId);
10970
- if (!payload || !agentId) return;
10971
- void api.post("/host/circuit-breaker/suppressed", { agent_id: agentId, ...payload }).catch((err) => {
10972
- log(
10973
- `[restart-breaker] agent=${codeName} suppression report failed (non-fatal): ${err instanceof Error ? err.message : String(err)}`
10974
- );
10975
- });
10997
+ const payloads = takeSuppressionReports(codeName, agentId);
10998
+ if (payloads.length === 0 || !agentId) return;
10999
+ for (const payload of payloads) {
11000
+ void api.post("/host/circuit-breaker/suppressed", { agent_id: agentId, ...payload }).catch((err) => {
11001
+ log(
11002
+ `[restart-breaker] agent=${codeName} suppression report failed (non-fatal): ${err instanceof Error ? err.message : String(err)}`
11003
+ );
11004
+ });
11005
+ }
10976
11006
  }
10977
11007
  function maybeClearStaleTrip(agent) {
10978
11008
  const codeName = agent.code_name;
@@ -11492,7 +11522,7 @@ var pendingDayRolloverReset = /* @__PURE__ */ new Set();
11492
11522
  var dayRolloverInboundHold = /* @__PURE__ */ new Map();
11493
11523
  var INBOUND_HOLD_EPISODE_GAP_MS = 12e4;
11494
11524
  async function channelInboundActivityAgeSecondsFor(codeName) {
11495
- const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-BQCFTEK5.js");
11525
+ const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-MDPLVVKC.js");
11496
11526
  const newest = newestPendingInboundActivityMtimeMs(dirname9(paneLogPath(codeName)));
11497
11527
  if (newest === null) return null;
11498
11528
  return Math.max(0, Math.floor((Date.now() - newest) / 1e3));
@@ -12135,7 +12165,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
12135
12165
  var lastVersionCheckAt = 0;
12136
12166
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
12137
12167
  var lastResponsivenessProbeAt = 0;
12138
- var agtCliVersion = true ? "0.28.636" : "dev";
12168
+ var agtCliVersion = true ? "0.28.637" : "dev";
12139
12169
  function resolveBrewPath(execFileSync3) {
12140
12170
  try {
12141
12171
  const out = execFileSync3("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -13442,7 +13472,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
13442
13472
  if (codeNames.length === 0) return;
13443
13473
  void (async () => {
13444
13474
  try {
13445
- const { collectDiagnostics } = await import("../persistent-session-7UX2BZMT.js");
13475
+ const { collectDiagnostics } = await import("../persistent-session-SZLOBXBQ.js");
13446
13476
  await api.post("/host/heartbeat", {
13447
13477
  host_id: hostId,
13448
13478
  agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor)
@@ -13558,7 +13588,7 @@ async function pollCycleInner() {
13558
13588
  }
13559
13589
  try {
13560
13590
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
13561
- const { collectDiagnostics } = await import("../persistent-session-7UX2BZMT.js");
13591
+ const { collectDiagnostics } = await import("../persistent-session-SZLOBXBQ.js");
13562
13592
  const diagCodeNames = [...agentState.persistentSessionAgents];
13563
13593
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor) : void 0;
13564
13594
  let tailscaleHostname;
@@ -13681,7 +13711,7 @@ async function pollCycleInner() {
13681
13711
  collectPanelessActivityProbes,
13682
13712
  getResponsivenessIntervalMs,
13683
13713
  occupancyQualificationClassifications
13684
- } = await import("../responsiveness-probe-BQCFTEK5.js");
13714
+ } = await import("../responsiveness-probe-MDPLVVKC.js");
13685
13715
  const probeIntervalMs = getResponsivenessIntervalMs();
13686
13716
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
13687
13717
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -13787,7 +13817,7 @@ async function pollCycleInner() {
13787
13817
  collectResponsivenessProbes,
13788
13818
  livePendingInboundOldestAgeSeconds,
13789
13819
  parkPendingInbound
13790
- } = await import("../responsiveness-probe-BQCFTEK5.js");
13820
+ } = await import("../responsiveness-probe-MDPLVVKC.js");
13791
13821
  const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-NDP36U7O.js");
13792
13822
  const wedgeNow = /* @__PURE__ */ new Date();
13793
13823
  const liveAgents = agentState.persistentSessionAgents;
@@ -13943,7 +13973,7 @@ async function pollCycleInner() {
13943
13973
  }
13944
13974
  try {
13945
13975
  const { scrapeMcpFailedBannerCount } = await import("../pane-mcp-banner-scraper-JA437JIB.js");
13946
- const { probeSessionAuth } = await import("../session-auth-dead-TV2M6AFN.js");
13976
+ const { probeSessionAuth } = await import("../session-auth-dead-ZLENJLLO.js");
13947
13977
  const observations = [];
13948
13978
  const pendingCacheCommits = [];
13949
13979
  const modelApiErrorReportingOn = hostFlagStore().getBoolean("model-api-error-reporting");
@@ -17510,7 +17540,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
17510
17540
  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}`));
17511
17541
  void (async () => {
17512
17542
  try {
17513
- const { collectDiagnostics } = await import("../persistent-session-7UX2BZMT.js");
17543
+ const { collectDiagnostics } = await import("../persistent-session-SZLOBXBQ.js");
17514
17544
  await api.post("/host/heartbeat", {
17515
17545
  host_id: hostId,
17516
17546
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor)
@@ -17561,7 +17591,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
17561
17591
  }
17562
17592
  try {
17563
17593
  const hostId = await getHostId();
17564
- const { collectDiagnostics } = await import("../persistent-session-7UX2BZMT.js");
17594
+ const { collectDiagnostics } = await import("../persistent-session-SZLOBXBQ.js");
17565
17595
  await api.post("/host/heartbeat", {
17566
17596
  host_id: hostId,
17567
17597
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor)
@@ -18157,7 +18187,7 @@ async function processClaudePairSessions(agents) {
18157
18187
  killPairSession,
18158
18188
  pairTmuxSession,
18159
18189
  finalizeClaudePairOnboarding
18160
- } = await import("../claude-pair-runtime-TROVZ3M5.js");
18190
+ } = await import("../claude-pair-runtime-CE72HQE7.js");
18161
18191
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
18162
18192
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
18163
18193
  const killed = await killPairSession(pairTmuxSession(pairId));