@integrity-labs/agt-cli 0.28.505 → 0.28.507

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-JOWL7FDY.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-OMAAP4OU.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-R56JCRXJ.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-37TIOIJQ.js.map
@@ -27,6 +27,7 @@ import {
27
27
  getCachedClaudeAuthMode,
28
28
  getHostId,
29
29
  givenUpMcpServerKeys,
30
+ isIntegrationBucketedReason,
30
31
  isProvisioningReloadReason,
31
32
  isTransientAuthFailure,
32
33
  liveProxyExtraHeaderVars,
@@ -52,7 +53,7 @@ import {
52
53
  safeWriteJsonAtomic,
53
54
  setConfigHash,
54
55
  tripClass
55
- } from "../chunk-3SKLJE7C.js";
56
+ } from "../chunk-75NQ7UBH.js";
56
57
  import {
57
58
  getProjectDir as getProjectDir2,
58
59
  getReadyTasks,
@@ -172,7 +173,7 @@ import {
172
173
  toOpencodeModel,
173
174
  transcriptActivityAgeSeconds,
174
175
  writeEgressAllowlist
175
- } from "../chunk-3BRI7LJZ.js";
176
+ } from "../chunk-4PRR22KH.js";
176
177
  import {
177
178
  reapOrphanChannelMcps
178
179
  } from "../chunk-XWVM4KPK.js";
@@ -1046,10 +1047,17 @@ function orphanedRemoteMcpKeys(mcpServers, expectedIntegrationKeys) {
1046
1047
  // src/lib/auto-resume.ts
1047
1048
  var DEFAULT_QUIET_MS = 18e5;
1048
1049
  var DEFAULT_BACKOFF_RESET_MS = 864e5;
1049
- function readAutoResumeConfig(env = process.env) {
1050
+ var AUTO_RESUME_FLAG_KEY = "auto-resume-enabled";
1051
+ function readAutoResumeEnvOverride(env = process.env) {
1050
1052
  const raw = (env["AGT_AUTO_RESUME_ENABLED"] ?? "").trim().toLowerCase();
1053
+ if (raw === "") return void 0;
1054
+ if (raw === "1" || raw === "true" || raw === "yes" || raw === "on") return true;
1055
+ if (raw === "0" || raw === "false" || raw === "no" || raw === "off") return false;
1056
+ return void 0;
1057
+ }
1058
+ function readAutoResumeConfig(opts = {}) {
1051
1059
  return {
1052
- enabled: raw === "1" || raw === "true" || raw === "yes" || raw === "on",
1060
+ enabled: readAutoResumeEnvOverride(opts.env ?? process.env) ?? opts.flagEnabled ?? false,
1053
1061
  quietMs: readEnvNumber("AGT_AUTO_RESUME_QUIET_MS", DEFAULT_QUIET_MS),
1054
1062
  backoffResetMs: readEnvNumber("AGT_AUTO_RESUME_BACKOFF_RESET_MS", DEFAULT_BACKOFF_RESET_MS)
1055
1063
  };
@@ -8977,7 +8985,7 @@ function recordRestartForBreaker(codeName, reason) {
8977
8985
  return;
8978
8986
  }
8979
8987
  let integrationKey;
8980
- if (isProvisioningReloadReason(reason)) {
8988
+ if (isIntegrationBucketedReason(reason)) {
8981
8989
  const attribution = agentState.provisioningAttribution.get(codeName);
8982
8990
  if (attribution && Date.now() - attribution.at <= RESTART_BREAKER_PROVISIONING_WINDOW_MS) {
8983
8991
  integrationKey = attribution.key;
@@ -9091,8 +9099,22 @@ function maybeAutoResume(agent) {
9091
9099
  if (trip && autoResumeStandDowns.has(`${codeName}:${trip.trippedAt}`)) return;
9092
9100
  const decision = decideAutoResume({
9093
9101
  trip,
9102
+ // Rebase note: `main` replaced the raw `autoResumeMarkers.get(codeName)` read
9103
+ // with the `getAutoResumeMarker(codeName)` accessor while this branch was
9104
+ // open. Both sides of the conflict are independent - that change is about
9105
+ // WHERE the marker comes from, this branch's is about how the CONFIG is
9106
+ // resolved - so both are kept.
9094
9107
  marker: getAutoResumeMarker(codeName),
9095
- config: readAutoResumeConfig(),
9108
+ // ENG-8395: gate resolved PER AGENT. getBooleanForAgent applies
9109
+ // env override (AGT_AUTO_RESUME_ENABLED) → this agent's heartbeat override →
9110
+ // host-wide flag → compiled default false. That per-agent layer is the point
9111
+ // of the ticket: the env var's grain is the whole host, so arming one agent
9112
+ // on a 14-agent host was impossible before. readAutoResumeConfig re-applies
9113
+ // the env layer on top (same precedence, idempotent) so the env override
9114
+ // still wins even for a caller that passes no flag value.
9115
+ config: readAutoResumeConfig({
9116
+ flagEnabled: hostFlagStore().getBooleanForAgent(AUTO_RESUME_FLAG_KEY, agent.agent_id)
9117
+ }),
9096
9118
  now: Date.now()
9097
9119
  });
9098
9120
  if (decision.action === "skip") {
@@ -9259,7 +9281,12 @@ function restartReasonBindsNewMcp(breakerReason) {
9259
9281
  // above always described it, but the path passed no breakerReason so it never
9260
9282
  // hit this predicate. Including it arms the ENG-6174 respawn verification for
9261
9283
  // the ONE real respawn of an integration add.
9262
- breakerReason === "integration-change" || // ENG-7541: a 'credential-rotation' respawn IS the env-only re-mint path
9284
+ breakerReason === "integration-change" || // ENG-8388: the operator-attributed variant is the SAME reload with a
9285
+ // different breaker tally - it binds a changed MCP set identically. Omitting
9286
+ // it here would mean attributing a reload to a human silently disabled the
9287
+ // respawn verification for it, i.e. the fix would break the thing it was
9288
+ // meant to leave alone.
9289
+ breakerReason === "operator-integration-change" || // ENG-7541: a 'credential-rotation' respawn IS the env-only re-mint path
9263
9290
  // (ENG-7510), just tagged with a non-tripping breaker class. Once its stop
9264
9291
  // fires it must behave IDENTICALLY to 'hot-reload-mcp' — come back
9265
9292
  // immediately so the agent picks up the fresh credential, and arm the
@@ -9272,11 +9299,16 @@ function restartReasonBindsNewMcp(breakerReason) {
9272
9299
  // that the stop is ungated.
9273
9300
  breakerReason === "credential-rotation";
9274
9301
  }
9275
- function dashboardRestartBreakerReason(restartReason) {
9276
- return restartReason === "integration-change" ? "integration-change" : void 0;
9302
+ function dashboardRestartBreakerReason(restartReason, restartActor) {
9303
+ if (restartReason !== "integration-change") return void 0;
9304
+ return restartActor === "user" ? "operator-integration-change" : "integration-change";
9277
9305
  }
9278
9306
  function shouldReportRestartToAudit(breakerReason) {
9279
- return !!breakerReason && breakerReason !== "agent-requested" && breakerReason !== "channel-restart-flag" && breakerReason !== "integration-change";
9307
+ return !!breakerReason && breakerReason !== "agent-requested" && breakerReason !== "channel-restart-flag" && breakerReason !== "integration-change" && // ENG-8388: the operator-attributed variant is the SAME dashboard reload,
9308
+ // audited server-side at the same API route. Without this line, attributing
9309
+ // a reload to a human would start double-logging it - a fix whose only
9310
+ // visible effect is duplicated audit rows.
9311
+ breakerReason !== "operator-integration-change";
9280
9312
  }
9281
9313
  function reportRestartEvent(codeName, breakerReason, auditDetail) {
9282
9314
  if (!shouldReportRestartToAudit(breakerReason)) return;
@@ -10001,7 +10033,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
10001
10033
  var lastVersionCheckAt = 0;
10002
10034
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
10003
10035
  var lastResponsivenessProbeAt = 0;
10004
- var agtCliVersion = true ? "0.28.505" : "dev";
10036
+ var agtCliVersion = true ? "0.28.507" : "dev";
10005
10037
  function resolveBrewPath(execFileSync2) {
10006
10038
  try {
10007
10039
  const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -11208,7 +11240,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
11208
11240
  if (codeNames.length === 0) return;
11209
11241
  void (async () => {
11210
11242
  try {
11211
- const { collectDiagnostics } = await import("../persistent-session-JOWL7FDY.js");
11243
+ const { collectDiagnostics } = await import("../persistent-session-OMAAP4OU.js");
11212
11244
  await api.post("/host/heartbeat", {
11213
11245
  host_id: hostId,
11214
11246
  agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor)
@@ -11315,7 +11347,7 @@ async function pollCycle() {
11315
11347
  }
11316
11348
  try {
11317
11349
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
11318
- const { collectDiagnostics } = await import("../persistent-session-JOWL7FDY.js");
11350
+ const { collectDiagnostics } = await import("../persistent-session-OMAAP4OU.js");
11319
11351
  const diagCodeNames = [...agentState.persistentSessionAgents];
11320
11352
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor) : void 0;
11321
11353
  let tailscaleHostname;
@@ -11430,7 +11462,7 @@ async function pollCycle() {
11430
11462
  collectResponsivenessProbes,
11431
11463
  collectPanelessActivityProbes,
11432
11464
  getResponsivenessIntervalMs
11433
- } = await import("../responsiveness-probe-FBU2VB32.js");
11465
+ } = await import("../responsiveness-probe-NRH2AQW6.js");
11434
11466
  const probeIntervalMs = getResponsivenessIntervalMs();
11435
11467
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
11436
11468
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -11494,7 +11526,7 @@ async function pollCycle() {
11494
11526
  collectResponsivenessProbes,
11495
11527
  livePendingInboundOldestAgeSeconds,
11496
11528
  parkPendingInbound
11497
- } = await import("../responsiveness-probe-FBU2VB32.js");
11529
+ } = await import("../responsiveness-probe-NRH2AQW6.js");
11498
11530
  const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-NDP36U7O.js");
11499
11531
  const wedgeNow = /* @__PURE__ */ new Date();
11500
11532
  const liveAgents = agentState.persistentSessionAgents;
@@ -11726,7 +11758,7 @@ async function pollCycle() {
11726
11758
  es(`tmux kill-session -t agt-${agent.code_name} 2>/dev/null`, { stdio: "ignore" });
11727
11759
  } catch {
11728
11760
  }
11729
- const breakerReason = dashboardRestartBreakerReason(restartReason);
11761
+ const breakerReason = dashboardRestartBreakerReason(restartReason, agent.restart_actor);
11730
11762
  stopPersistentSessionAndForgetMcpBaseline(agent.code_name, breakerReason);
11731
11763
  if (breakerReason && restartReasonBindsNewMcp(breakerReason)) {
11732
11764
  noteRestartRequested(agent.code_name, requested);
@@ -14986,7 +15018,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
14986
15018
  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}`));
14987
15019
  void (async () => {
14988
15020
  try {
14989
- const { collectDiagnostics } = await import("../persistent-session-JOWL7FDY.js");
15021
+ const { collectDiagnostics } = await import("../persistent-session-OMAAP4OU.js");
14990
15022
  await api.post("/host/heartbeat", {
14991
15023
  host_id: hostId,
14992
15024
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor)
@@ -15036,7 +15068,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
15036
15068
  }
15037
15069
  try {
15038
15070
  const hostId = await getHostId();
15039
- const { collectDiagnostics } = await import("../persistent-session-JOWL7FDY.js");
15071
+ const { collectDiagnostics } = await import("../persistent-session-OMAAP4OU.js");
15040
15072
  await api.post("/host/heartbeat", {
15041
15073
  host_id: hostId,
15042
15074
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor)
@@ -15554,7 +15586,7 @@ async function processClaudePairSessions(agents) {
15554
15586
  killPairSession,
15555
15587
  pairTmuxSession,
15556
15588
  finalizeClaudePairOnboarding
15557
- } = await import("../claude-pair-runtime-R56JCRXJ.js");
15589
+ } = await import("../claude-pair-runtime-37TIOIJQ.js");
15558
15590
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
15559
15591
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
15560
15592
  const killed = await killPairSession(pairTmuxSession(pairId));