@integrity-labs/agt-cli 0.27.132 → 0.27.134

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.
@@ -9,7 +9,7 @@ import {
9
9
  parseDeliveryTarget,
10
10
  registerFramework,
11
11
  wrapScheduledTaskPrompt
12
- } from "./chunk-TRGX4NVZ.js";
12
+ } from "./chunk-4I2QOVP5.js";
13
13
 
14
14
  // ../../packages/core/dist/integrations/registry.js
15
15
  var INTEGRATION_REGISTRY = [
@@ -7725,4 +7725,4 @@ export {
7725
7725
  managerInstallSystemUnitCommand,
7726
7726
  managerUninstallSystemUnitCommand
7727
7727
  };
7728
- //# sourceMappingURL=chunk-DAOANYK4.js.map
7728
+ //# sourceMappingURL=chunk-4Y7APKV7.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-35XIC3CB.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-AH4WU2GE.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-GYSKMJ2B.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-YIHRE2VR.js.map
@@ -17,7 +17,7 @@ import {
17
17
  provisionStopHook,
18
18
  requireHost,
19
19
  safeWriteJsonAtomic
20
- } from "../chunk-DAOANYK4.js";
20
+ } from "../chunk-4Y7APKV7.js";
21
21
  import {
22
22
  getProjectDir as getProjectDir2,
23
23
  getReadyTasks,
@@ -56,7 +56,7 @@ import {
56
56
  stopPersistentSession,
57
57
  takeWatchdogGiveUpCount,
58
58
  takeZombieDetection
59
- } from "../chunk-DBJWD2LU.js";
59
+ } from "../chunk-2MXDQBEH.js";
60
60
  import {
61
61
  KANBAN_CHECK_COMMAND,
62
62
  SUPPRESS_SENTINEL,
@@ -83,7 +83,7 @@ import {
83
83
  resolveDmTarget,
84
84
  worseConnectivityOutcome,
85
85
  wrapScheduledTaskPrompt
86
- } from "../chunk-TRGX4NVZ.js";
86
+ } from "../chunk-4I2QOVP5.js";
87
87
  import {
88
88
  parsePsRows,
89
89
  reapOrphanChannelMcps
@@ -142,6 +142,9 @@ function decidePostRestartVerification(pending, sessionStartedAt, sessionHealthy
142
142
  const attempt = pending.attempts + 1;
143
143
  return { kind: "unverified", attempt, final: attempt >= maxAttempts };
144
144
  }
145
+ function shouldRemediateUnverifiedRestart(outcome, ctx) {
146
+ return ctx.enabled && !ctx.breakerTripped && outcome.kind === "unverified" && outcome.final;
147
+ }
145
148
 
146
149
  // src/lib/integration-hash.ts
147
150
  import { createHash as createHash2 } from "crypto";
@@ -4273,11 +4276,17 @@ function scheduleSessionRestart(codeName, delayMs, reason, breakerReason = "hot-
4273
4276
  return;
4274
4277
  }
4275
4278
  deferLogThrottle.delete(codeName);
4279
+ if (breakerReason === "bind-remediation" && restartBreaker.isTripped(codeName)) {
4280
+ log(
4281
+ `[bind-remediation] '${codeName}' breaker tripped before the re-respawn fired \u2014 aborting to avoid stopping a session the breaker won't let respawn (ENG-6203)`
4282
+ );
4283
+ return;
4284
+ }
4276
4285
  stopPersistentSession(codeName, log);
4277
4286
  runningMcpHashes.delete(codeName);
4278
4287
  recordRestartForBreaker(codeName, breakerReason);
4279
4288
  log(`[hot-reload] Session stopped for '${codeName}' \u2014 will respawn with ${reason}`);
4280
- if (breakerReason === "hot-reload-mcp") {
4289
+ if (breakerReason === "hot-reload-mcp" || breakerReason === "bind-remediation") {
4281
4290
  const prior = pendingRestartVerifications.get(codeName);
4282
4291
  pendingRestartVerifications.set(codeName, {
4283
4292
  firedAt: Date.now(),
@@ -4297,6 +4306,11 @@ function cancelPendingSessionRestart(codeName) {
4297
4306
  deferLogThrottle.delete(codeName);
4298
4307
  log(`[hot-reload] Cancelled pending restart timer for '${codeName}' (another teardown path is handling it)`);
4299
4308
  }
4309
+ function bindRemediationEnabled() {
4310
+ const v = (process.env["AGT_BIND_REMEDIATION_ENABLED"] ?? "").trim().toLowerCase();
4311
+ return v === "true" || v === "1";
4312
+ }
4313
+ var BIND_REMEDIATION_JITTER_MS = 3e4;
4300
4314
  function verifyPendingRestarts(now) {
4301
4315
  if (pendingRestartVerifications.size === 0) return;
4302
4316
  for (const [codeName, pending] of pendingRestartVerifications) {
@@ -4318,6 +4332,21 @@ function verifyPendingRestarts(now) {
4318
4332
  log(
4319
4333
  `[restart-verify] ERROR '${codeName}' did NOT respawn healthy after ${outcome.attempt} attempts following an MCP change \u2014 the live session may be stuck on its pre-restart tools. Check session health / manager.log; a manual session restart may be required (ENG-6174)`
4320
4334
  );
4335
+ if (shouldRemediateUnverifiedRestart(outcome, {
4336
+ enabled: bindRemediationEnabled(),
4337
+ breakerTripped: restartBreaker.isTripped(codeName)
4338
+ })) {
4339
+ const jitterMs = Math.floor(Math.random() * BIND_REMEDIATION_JITTER_MS);
4340
+ log(
4341
+ `[bind-remediation] '${codeName}' restart never bound MCP tools \u2014 forcing one gated re-respawn in ${Math.round(jitterMs / 1e3)}s (breaker-capped, ENG-6203)`
4342
+ );
4343
+ scheduleSessionRestart(
4344
+ codeName,
4345
+ jitterMs,
4346
+ "bind-remediation: prior restart left MCP tools unbound",
4347
+ "bind-remediation"
4348
+ );
4349
+ }
4321
4350
  } else {
4322
4351
  pendingRestartVerifications.set(codeName, { firedAt: now, attempts: outcome.attempt });
4323
4352
  log(
@@ -4661,7 +4690,7 @@ var cachedMaintenanceWindow = null;
4661
4690
  var lastVersionCheckAt = 0;
4662
4691
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
4663
4692
  var lastResponsivenessProbeAt = 0;
4664
- var agtCliVersion = true ? "0.27.132" : "dev";
4693
+ var agtCliVersion = true ? "0.27.134" : "dev";
4665
4694
  function resolveBrewPath(execFileSync4) {
4666
4695
  try {
4667
4696
  const out = execFileSync4("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -5858,7 +5887,7 @@ async function pollCycle() {
5858
5887
  }
5859
5888
  try {
5860
5889
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
5861
- const { collectDiagnostics } = await import("../persistent-session-35XIC3CB.js");
5890
+ const { collectDiagnostics } = await import("../persistent-session-AH4WU2GE.js");
5862
5891
  const diagCodeNames = [...agentState.persistentSessionAgents];
5863
5892
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
5864
5893
  let tailscaleHostname;
@@ -5945,12 +5974,12 @@ async function pollCycle() {
5945
5974
  const {
5946
5975
  collectResponsivenessProbes,
5947
5976
  getResponsivenessIntervalMs
5948
- } = await import("../responsiveness-probe-ZXJS2D43.js");
5977
+ } = await import("../responsiveness-probe-WDXDQ5EZ.js");
5949
5978
  const probeIntervalMs = getResponsivenessIntervalMs();
5950
5979
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
5951
5980
  const probeCodeNames = [...agentState.persistentSessionAgents];
5952
5981
  if (probeCodeNames.length > 0) {
5953
- const { takeAcpxExecFailureCount, creditAcpxExecFailureCount } = await import("../persistent-session-35XIC3CB.js");
5982
+ const { takeAcpxExecFailureCount, creditAcpxExecFailureCount } = await import("../persistent-session-AH4WU2GE.js");
5954
5983
  const drainedGiveUps = /* @__PURE__ */ new Map();
5955
5984
  const drainedAcpxFailures = /* @__PURE__ */ new Map();
5956
5985
  const probes = collectResponsivenessProbes(probeCodeNames).map((p) => {
@@ -5984,7 +6013,7 @@ async function pollCycle() {
5984
6013
  collectResponsivenessProbes,
5985
6014
  livePendingInboundOldestAgeSeconds,
5986
6015
  deadLetterPendingInbound
5987
- } = await import("../responsiveness-probe-ZXJS2D43.js");
6016
+ } = await import("../responsiveness-probe-WDXDQ5EZ.js");
5988
6017
  const wedgeNow = /* @__PURE__ */ new Date();
5989
6018
  const liveAgents = agentState.persistentSessionAgents;
5990
6019
  for (const tracked of consecutiveWedgeCycles.keys()) {
@@ -10490,7 +10519,7 @@ async function processClaudePairSessions(agents) {
10490
10519
  killPairSession,
10491
10520
  pairTmuxSession,
10492
10521
  finalizeClaudePairOnboarding
10493
- } = await import("../claude-pair-runtime-GYSKMJ2B.js");
10522
+ } = await import("../claude-pair-runtime-YIHRE2VR.js");
10494
10523
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
10495
10524
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
10496
10525
  const killed = await killPairSession(pairTmuxSession(pairId));