@integrity-labs/agt-cli 0.28.783 → 0.28.785

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-PX5UJ3WY.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-HJTJ6EKF.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-2PDHNNKZ.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-E6TFXEK3.js.map
@@ -58,7 +58,7 @@ import {
58
58
  safeWriteJsonAtomic,
59
59
  setConfigHash,
60
60
  tripClass
61
- } from "../chunk-HTBJUN4V.js";
61
+ } from "../chunk-7DP5AYK4.js";
62
62
  import {
63
63
  getProjectDir as getProjectDir2,
64
64
  getReadyTasks,
@@ -120,7 +120,7 @@ import {
120
120
  takeZombieDetection,
121
121
  toOpencodeModel,
122
122
  writeEgressAllowlist
123
- } from "../chunk-YA5PGNN2.js";
123
+ } from "../chunk-P4HONWYQ.js";
124
124
  import {
125
125
  ACCOUNT_ENFORCEMENT_MARKER_FILENAME,
126
126
  AnchorSessionClient,
@@ -205,13 +205,14 @@ import {
205
205
  resolveChannels,
206
206
  resolveDmTarget,
207
207
  scrubPreservingIdentifiers,
208
+ senderPolicyIsEnforcedOn,
208
209
  serializeAccountEnforcementMarker,
209
210
  sessionTranscriptDir,
210
211
  stabiliseResetInstant,
211
212
  subagentActivityAgeSeconds,
212
213
  sumTranscriptUsageInWindow,
213
214
  transcriptActivityAgeSeconds
214
- } from "../chunk-TNETRPYC.js";
215
+ } from "../chunk-WAE44B3T.js";
215
216
  import {
216
217
  reapOrphanChannelMcps
217
218
  } from "../chunk-XWVM4KPK.js";
@@ -2636,15 +2637,27 @@ async function maybeReportUsageBanner(args) {
2636
2637
  lastLimitScope: existing?.lastLimitScope ?? null,
2637
2638
  lastCheckedAt: nowMs,
2638
2639
  lastPostedAt: existing?.lastPostedAt ?? null,
2639
- consecutiveAbsences: existing?.consecutiveAbsences ?? 0
2640
+ consecutiveAbsences: existing?.consecutiveAbsences ?? 0,
2641
+ coldClearPosted: existing?.coldClearPosted ?? false
2640
2642
  };
2641
2643
  const observation = tail ? parseUsageBanner(scopeToCurrentPaneEpoch(tail), now) : null;
2642
2644
  if (!observation) {
2643
2645
  if (!existing || existing.lastPct === null) {
2644
- state.set(codeName, next);
2645
- return;
2646
+ if (!args.openUsageAlert) {
2647
+ state.set(codeName, next);
2648
+ return;
2649
+ }
2650
+ if (next.coldClearPosted) {
2651
+ state.set(codeName, next);
2652
+ return;
2653
+ }
2654
+ if ((existing?.consecutiveAbsences ?? 0) === 0) {
2655
+ log2(
2656
+ `[usage-banner] '${codeName}': no banner in the current pane epoch, but the control plane holds an open usage_limit_reached alert; counting absences from cold so the clear can be posted`
2657
+ );
2658
+ }
2646
2659
  }
2647
- next.consecutiveAbsences = (existing.consecutiveAbsences ?? 0) + 1;
2660
+ next.consecutiveAbsences = (existing?.consecutiveAbsences ?? 0) + 1;
2648
2661
  if (next.consecutiveAbsences < ABSENCE_CONFIRMATIONS) {
2649
2662
  state.set(codeName, next);
2650
2663
  return;
@@ -2660,9 +2673,9 @@ async function maybeReportUsageBanner(args) {
2660
2673
  // Carry the last known window so the row stays coherent with the one it
2661
2674
  // supersedes. The server short-circuits on `source` before it reasons
2662
2675
  // about this instant, so it is provenance, not an input to the decision.
2663
- week_resets_at: existing.lastWeekResetsAt ?? now.toISOString(),
2676
+ week_resets_at: existing?.lastWeekResetsAt ?? now.toISOString(),
2664
2677
  reset_precision: "unknown",
2665
- limit_scope: existing.lastLimitScope ?? "unknown",
2678
+ limit_scope: existing?.lastLimitScope ?? "unknown",
2666
2679
  // ENG-8631: the server keys its `banner_cleared` recovery off exactly
2667
2680
  // this string. `source` is a free-form text column, so this needs no
2668
2681
  // migration and an older API simply stores it and behaves as before.
@@ -2674,6 +2687,7 @@ async function maybeReportUsageBanner(args) {
2674
2687
  next.lastPct = null;
2675
2688
  next.lastWeekResetsAt = null;
2676
2689
  next.lastLimitScope = null;
2690
+ next.coldClearPosted = true;
2677
2691
  next.consecutiveAbsences = 0;
2678
2692
  next.lastPostedAt = nowMs;
2679
2693
  } catch (err) {
@@ -2685,6 +2699,7 @@ async function maybeReportUsageBanner(args) {
2685
2699
  return;
2686
2700
  }
2687
2701
  next.consecutiveAbsences = 0;
2702
+ next.coldClearPosted = false;
2688
2703
  const weekResetsAtIso = observation.weekResetsAt.toISOString();
2689
2704
  const unchanged = existing !== void 0 && existing.lastPct === observation.pct && existing.lastWeekResetsAt === weekResetsAtIso && existing.lastLimitScope === observation.limitScope;
2690
2705
  const dueToReaffirm = next.lastPostedAt === null || nowMs - next.lastPostedAt >= REAFFIRM_INTERVAL_MS;
@@ -12900,7 +12915,7 @@ var pendingDayRolloverReset = /* @__PURE__ */ new Set();
12900
12915
  var dayRolloverInboundHold = /* @__PURE__ */ new Map();
12901
12916
  var INBOUND_HOLD_EPISODE_GAP_MS = 12e4;
12902
12917
  async function channelInboundActivityAgeSecondsFor(codeName) {
12903
- const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-U4BEPPKX.js");
12918
+ const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-E3VDOXGQ.js");
12904
12919
  const newest = newestPendingInboundActivityMtimeMs(dirname10(paneLogPath(codeName)));
12905
12920
  if (newest === null) return null;
12906
12921
  return Math.max(0, Math.floor((Date.now() - newest) / 1e3));
@@ -13560,7 +13575,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
13560
13575
  var lastVersionCheckAt = 0;
13561
13576
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
13562
13577
  var lastResponsivenessProbeAt = 0;
13563
- var agtCliVersion = true ? "0.28.783" : "dev";
13578
+ var agtCliVersion = true ? "0.28.785" : "dev";
13564
13579
  function resolveBrewPath(execFileSync2) {
13565
13580
  try {
13566
13581
  const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -15107,7 +15122,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
15107
15122
  if (codeNames.length === 0) return;
15108
15123
  void (async () => {
15109
15124
  try {
15110
- const { collectDiagnostics } = await import("../persistent-session-PX5UJ3WY.js");
15125
+ const { collectDiagnostics } = await import("../persistent-session-HJTJ6EKF.js");
15111
15126
  await api.post("/host/heartbeat", {
15112
15127
  host_id: hostId,
15113
15128
  agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor)
@@ -15248,7 +15263,7 @@ async function pollCycleInner() {
15248
15263
  }
15249
15264
  try {
15250
15265
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
15251
- const { collectDiagnostics } = await import("../persistent-session-PX5UJ3WY.js");
15266
+ const { collectDiagnostics } = await import("../persistent-session-HJTJ6EKF.js");
15252
15267
  const diagCodeNames = [...agentState.persistentSessionAgents];
15253
15268
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor) : void 0;
15254
15269
  let tailscaleHostname;
@@ -15417,7 +15432,7 @@ async function pollCycleInner() {
15417
15432
  collectPanelessActivityProbes,
15418
15433
  getResponsivenessIntervalMs,
15419
15434
  occupancyQualificationClassifications
15420
- } = await import("../responsiveness-probe-U4BEPPKX.js");
15435
+ } = await import("../responsiveness-probe-E3VDOXGQ.js");
15421
15436
  const probeIntervalMs = getResponsivenessIntervalMs();
15422
15437
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
15423
15438
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -15527,7 +15542,7 @@ async function pollCycleInner() {
15527
15542
  collectResponsivenessProbes,
15528
15543
  livePendingInboundOldestAgeSeconds,
15529
15544
  parkPendingInbound
15530
- } = await import("../responsiveness-probe-U4BEPPKX.js");
15545
+ } = await import("../responsiveness-probe-E3VDOXGQ.js");
15531
15546
  const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-NDP36U7O.js");
15532
15547
  const wedgeNow = /* @__PURE__ */ new Date();
15533
15548
  const liveAgents = agentState.persistentSessionAgents;
@@ -15683,7 +15698,7 @@ async function pollCycleInner() {
15683
15698
  }
15684
15699
  try {
15685
15700
  const { scrapeMcpFailedBannerCount } = await import("../pane-mcp-banner-scraper-JA437JIB.js");
15686
- const { probeSessionAuth } = await import("../session-auth-dead-2TLMBIM6.js");
15701
+ const { probeSessionAuth } = await import("../session-auth-dead-UWEWK2WY.js");
15687
15702
  const observations = [];
15688
15703
  const pendingCacheCommits = [];
15689
15704
  const modelApiErrorReportingOn = hostFlagStore().getBoolean("model-api-error-reporting");
@@ -16270,7 +16285,13 @@ async function processAgent(agent, agentStates, managedToolkits) {
16270
16285
  api,
16271
16286
  codeName: agent.code_name,
16272
16287
  agentId: agent.agent_id,
16273
- log
16288
+ log,
16289
+ // ENG-9634: the monitor's last-seen-banner map is module memory and does
16290
+ // not survive a restart, and its clear POST is gated on having seen a
16291
+ // banner in THIS process. For a cap that already lifted there is no
16292
+ // banner left to see, so the gate could never re-open. This is the
16293
+ // memory it lost, carried on the roster we just polled.
16294
+ openUsageAlert: agent.usage_limit_alert_open === true
16274
16295
  });
16275
16296
  void maybeReportTokenUsage({
16276
16297
  api,
@@ -16965,7 +16986,7 @@ async function processAgent(agent, agentStates, managedToolkits) {
16965
16986
  const telegramPeerDisabled = channelId === "telegram" ? peerDisabledMode === "all" : void 0;
16966
16987
  const telegramPeers = channelId === "telegram" ? extractCharterTelegramPeers(refreshData.charter?.raw_content ?? "", gateContext) : void 0;
16967
16988
  const slackPeers = channelId === "slack" ? extractCharterSlackPeers(refreshData.charter?.raw_content ?? "", gateContext) : void 0;
16968
- const senderPolicyForCall = channelId === "slack" || channelId === "msteams" ? refreshData.sender_policy ?? void 0 : void 0;
16989
+ const senderPolicyForCall = senderPolicyIsEnforcedOn(channelId) ? refreshData.sender_policy ?? void 0 : void 0;
16969
16990
  let agentAvatarUrl;
16970
16991
  if (channelId === "slack") {
16971
16992
  const rawAvatarUrl = refreshData.agent.avatar_url ?? void 0;
@@ -17141,7 +17162,9 @@ async function processAgent(agent, agentStates, managedToolkits) {
17141
17162
  );
17142
17163
  }
17143
17164
  if (channelConfigConvergedThisTick) {
17144
- const hasSenderPolicyChannel = currentChannelIds.has("slack") || currentChannelIds.has("msteams");
17165
+ const hasSenderPolicyChannel = [...currentChannelIds].some(
17166
+ (id) => senderPolicyIsEnforcedOn(id)
17167
+ );
17145
17168
  const senderPolicyForRestartHash = refreshData.sender_policy ?? null;
17146
17169
  const senderPolicyHash = computeSenderPolicyRestartHash(senderPolicyForRestartHash);
17147
17170
  const senderPolicyRestrictive = isSenderPolicyRestrictive(senderPolicyForRestartHash);
@@ -19776,7 +19799,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
19776
19799
  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}`));
19777
19800
  void (async () => {
19778
19801
  try {
19779
- const { collectDiagnostics } = await import("../persistent-session-PX5UJ3WY.js");
19802
+ const { collectDiagnostics } = await import("../persistent-session-HJTJ6EKF.js");
19780
19803
  await api.post("/host/heartbeat", {
19781
19804
  host_id: hostId,
19782
19805
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor)
@@ -19822,7 +19845,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
19822
19845
  }
19823
19846
  try {
19824
19847
  const hostId = await getHostId();
19825
- const { collectDiagnostics } = await import("../persistent-session-PX5UJ3WY.js");
19848
+ const { collectDiagnostics } = await import("../persistent-session-HJTJ6EKF.js");
19826
19849
  await api.post("/host/heartbeat", {
19827
19850
  host_id: hostId,
19828
19851
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor)
@@ -20458,7 +20481,7 @@ async function processClaudePairSessions(agents) {
20458
20481
  killPairSession,
20459
20482
  pairTmuxSession,
20460
20483
  finalizeClaudePairOnboarding
20461
- } = await import("../claude-pair-runtime-2PDHNNKZ.js");
20484
+ } = await import("../claude-pair-runtime-E6TFXEK3.js");
20462
20485
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
20463
20486
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
20464
20487
  const killed = await killPairSession(pairTmuxSession(pairId));