@integrity-labs/agt-cli 0.28.222 → 0.28.224

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-M4ZTLCDP.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-I4CQEDME.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-AEPVKQNP.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-JFP2N723.js.map
@@ -29,6 +29,7 @@ import {
29
29
  provisionChannelProgressHook,
30
30
  provisionIsolationHook,
31
31
  provisionOrientHook,
32
+ provisionPreCompactHook,
32
33
  provisionSessionStateHook,
33
34
  provisionStopHook,
34
35
  reapMissingMcpSessions,
@@ -36,7 +37,7 @@ import {
36
37
  requireHost,
37
38
  safeWriteJsonAtomic,
38
39
  setConfigHash
39
- } from "../chunk-XNMPRL76.js";
40
+ } from "../chunk-TPL4KIC5.js";
40
41
  import {
41
42
  getProjectDir as getProjectDir2,
42
43
  getReadyTasks,
@@ -121,7 +122,7 @@ import {
121
122
  takeZombieDetection,
122
123
  transcriptActivityAgeSeconds,
123
124
  writeEgressAllowlist
124
- } from "../chunk-B3E4B7JF.js";
125
+ } from "../chunk-S43WVYAF.js";
125
126
  import {
126
127
  reapOrphanChannelMcps
127
128
  } from "../chunk-XWVM4KPK.js";
@@ -5134,8 +5135,9 @@ function startRealtimeAssignments(config2) {
5134
5135
  const prev = restartRequestFingerprint.get(agentId);
5135
5136
  restartRequestFingerprint.set(agentId, requestedAt);
5136
5137
  if (requestedAt && requestedAt !== prev && onRestartRequested) {
5137
- log2(`[realtime] Restart requested for ${agentId} at ${requestedAt}`);
5138
- onRestartRequested({ agent_id: agentId, restart_requested_at: requestedAt });
5138
+ const restartReason = row.restart_reason ?? null;
5139
+ log2(`[realtime] Restart requested for ${agentId} at ${requestedAt}${restartReason ? ` (reason=${restartReason})` : ""}`);
5140
+ onRestartRequested({ agent_id: agentId, restart_requested_at: requestedAt, restart_reason: restartReason });
5139
5141
  }
5140
5142
  }).on("postgres_changes", {
5141
5143
  event: "DELETE",
@@ -6241,7 +6243,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
6241
6243
  var lastVersionCheckAt = 0;
6242
6244
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
6243
6245
  var lastResponsivenessProbeAt = 0;
6244
- var agtCliVersion = true ? "0.28.222" : "dev";
6246
+ var agtCliVersion = true ? "0.28.224" : "dev";
6245
6247
  function resolveBrewPath(execFileSync2) {
6246
6248
  try {
6247
6249
  const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -7150,7 +7152,7 @@ async function pollCycle() {
7150
7152
  }
7151
7153
  try {
7152
7154
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
7153
- const { collectDiagnostics } = await import("../persistent-session-M4ZTLCDP.js");
7155
+ const { collectDiagnostics } = await import("../persistent-session-I4CQEDME.js");
7154
7156
  const diagCodeNames = [...agentState.persistentSessionAgents];
7155
7157
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
7156
7158
  let tailscaleHostname;
@@ -7298,7 +7300,7 @@ async function pollCycle() {
7298
7300
  const {
7299
7301
  collectResponsivenessProbes,
7300
7302
  getResponsivenessIntervalMs
7301
- } = await import("../responsiveness-probe-E25HFGJL.js");
7303
+ } = await import("../responsiveness-probe-MIUMXKV4.js");
7302
7304
  const probeIntervalMs = getResponsivenessIntervalMs();
7303
7305
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
7304
7306
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -7330,7 +7332,7 @@ async function pollCycle() {
7330
7332
  collectResponsivenessProbes,
7331
7333
  livePendingInboundOldestAgeSeconds,
7332
7334
  parkPendingInbound
7333
- } = await import("../responsiveness-probe-E25HFGJL.js");
7335
+ } = await import("../responsiveness-probe-MIUMXKV4.js");
7334
7336
  const { getProjectDir: wedgeProjectDir } = await import("../claude-scheduler-FATCLHDM.js");
7335
7337
  const wedgeNow = /* @__PURE__ */ new Date();
7336
7338
  const liveAgents = agentState.persistentSessionAgents;
@@ -7585,7 +7587,7 @@ async function pollCycle() {
7585
7587
  if (restartedCodeNames.length > 0) {
7586
7588
  void (async () => {
7587
7589
  try {
7588
- const { collectDiagnostics } = await import("../persistent-session-M4ZTLCDP.js");
7590
+ const { collectDiagnostics } = await import("../persistent-session-I4CQEDME.js");
7589
7591
  const freshDiagnostics = collectDiagnostics(restartedCodeNames);
7590
7592
  await api.post("/host/heartbeat", {
7591
7593
  host_id: hostId,
@@ -9776,6 +9778,11 @@ ${truncateForLog(ctx.tail)}` : `; pane_tail_hash=sha256:${createHash10("sha256")
9776
9778
  } catch (err) {
9777
9779
  log(`[persistent-session] Failed to provision session-state hook for '${codeName}': ${err.message}`);
9778
9780
  }
9781
+ try {
9782
+ provisionPreCompactHook(codeName);
9783
+ } catch (err) {
9784
+ log(`[persistent-session] Failed to provision PreCompact hook for '${codeName}': ${err.message}`);
9785
+ }
9779
9786
  const sessionRunResult = await startRun({
9780
9787
  agent_id: agent.agent_id,
9781
9788
  source_type: "system",
@@ -10015,14 +10022,21 @@ function ensureRealtimeDriftStarted(agentStates) {
10015
10022
  });
10016
10023
  }
10017
10024
  var restartInFlight = /* @__PURE__ */ new Set();
10018
- async function handleRestartDoorbell(agentId, requestedAt) {
10019
- if (!hostFlagStore().getBoolean("restart-doorbell")) return;
10020
- if (restartInFlight.has(agentId)) return;
10025
+ function restartReasonNeedsRender(reason) {
10026
+ return reason != null && reason !== "manual";
10027
+ }
10028
+ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
10021
10029
  const prev = state6.agents.find((a) => a.agentId === agentId);
10022
10030
  const codeName = prev?.codeName;
10023
10031
  if (!codeName) return;
10024
10032
  const lastProcessed = prev?.lastRestartProcessedAt ?? null;
10025
10033
  if (lastProcessed != null && Date.parse(lastProcessed) >= Date.parse(requestedAt)) return;
10034
+ if (restartReasonNeedsRender(restartReason)) {
10035
+ triggerEarlyPoll(`config-change reload for '${codeName}' (reason=${restartReason})`);
10036
+ return;
10037
+ }
10038
+ if (!hostFlagStore().getBoolean("restart-doorbell")) return;
10039
+ if (restartInFlight.has(agentId)) return;
10026
10040
  restartInFlight.add(agentId);
10027
10041
  try {
10028
10042
  log(`[restart-lane] Fast restart for '${codeName}' at ${requestedAt}`);
@@ -10054,7 +10068,7 @@ async function handleRestartDoorbell(agentId, requestedAt) {
10054
10068
  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}`));
10055
10069
  void (async () => {
10056
10070
  try {
10057
- const { collectDiagnostics } = await import("../persistent-session-M4ZTLCDP.js");
10071
+ const { collectDiagnostics } = await import("../persistent-session-I4CQEDME.js");
10058
10072
  await api.post("/host/heartbeat", {
10059
10073
  host_id: hostId,
10060
10074
  agent_diagnostics: collectDiagnostics([codeName])
@@ -10089,7 +10103,7 @@ function ensureRealtimeAssignStarted(agentStates) {
10089
10103
  // flag-gated and backstopped by the slow poll, so wiring it unconditionally
10090
10104
  // is safe (a no-op when the flag is off).
10091
10105
  onRestartRequested: (payload) => {
10092
- void handleRestartDoorbell(payload.agent_id, payload.restart_requested_at).catch(
10106
+ void handleRestartDoorbell(payload.agent_id, payload.restart_requested_at, payload.restart_reason).catch(
10093
10107
  (err) => (
10094
10108
  // Never let a fast-lane failure become an unhandled rejection - the slow
10095
10109
  // poll backstop re-services the (still-set) restart_requested_at.
@@ -10448,7 +10462,7 @@ async function processClaudePairSessions(agents) {
10448
10462
  killPairSession,
10449
10463
  pairTmuxSession,
10450
10464
  finalizeClaudePairOnboarding
10451
- } = await import("../claude-pair-runtime-AEPVKQNP.js");
10465
+ } = await import("../claude-pair-runtime-JFP2N723.js");
10452
10466
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
10453
10467
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
10454
10468
  const killed = await killPairSession(pairTmuxSession(pairId));