@integrity-labs/agt-cli 0.28.1307 → 0.28.1308

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.
Files changed (35) hide show
  1. package/dist/{api-client-HAN3QU6H.js → api-client-QHGAABOL.js} +3 -3
  2. package/dist/bin/agt.js +7 -7
  3. package/dist/{chunk-VOYD7FPP.js → chunk-GZT7DHPV.js} +3 -3
  4. package/dist/{chunk-IA3IT3JM.js → chunk-HMH4EOV5.js} +5 -5
  5. package/dist/{chunk-I6HGFJNX.js → chunk-JZOA4A3J.js} +2 -2
  6. package/dist/{chunk-GLX5CD6S.js → chunk-NXTNYNNV.js} +2 -2
  7. package/dist/{chunk-CQQYZUC5.js → chunk-VSJUMNQ5.js} +108 -13
  8. package/dist/chunk-VSJUMNQ5.js.map +1 -0
  9. package/dist/{chunk-4KSUIAI4.js → chunk-WW2CTOEO.js} +9 -73
  10. package/dist/chunk-WW2CTOEO.js.map +1 -0
  11. package/dist/{claude-code-updater-KA4VMUWK.js → claude-code-updater-OU4AEM5Y.js} +3 -3
  12. package/dist/{claude-pair-runtime-AAGIQSUI.js → claude-pair-runtime-H7A7ZOEW.js} +3 -3
  13. package/dist/lib/manager-worker.js +149 -26
  14. package/dist/lib/manager-worker.js.map +1 -1
  15. package/dist/mcp/direct-chat-channel.js +8 -72
  16. package/dist/mcp/index.js +18 -73
  17. package/dist/mcp/origami.js +8 -72
  18. package/dist/mcp/slack-channel.js +111 -180
  19. package/dist/mcp/telegram-channel.js +8 -72
  20. package/dist/{persistent-session-FJ4Y7XIB.js → persistent-session-OUCTECWP.js} +18 -4
  21. package/dist/{responsiveness-probe-2MCC7NOE.js → responsiveness-probe-SC72APRB.js} +4 -4
  22. package/dist/{session-auth-dead-MDZWPSED.js → session-auth-dead-MQR2SLW5.js} +3 -3
  23. package/package.json +1 -1
  24. package/dist/chunk-4KSUIAI4.js.map +0 -1
  25. package/dist/chunk-CQQYZUC5.js.map +0 -1
  26. /package/dist/{api-client-HAN3QU6H.js.map → api-client-QHGAABOL.js.map} +0 -0
  27. /package/dist/{chunk-VOYD7FPP.js.map → chunk-GZT7DHPV.js.map} +0 -0
  28. /package/dist/{chunk-IA3IT3JM.js.map → chunk-HMH4EOV5.js.map} +0 -0
  29. /package/dist/{chunk-I6HGFJNX.js.map → chunk-JZOA4A3J.js.map} +0 -0
  30. /package/dist/{chunk-GLX5CD6S.js.map → chunk-NXTNYNNV.js.map} +0 -0
  31. /package/dist/{claude-code-updater-KA4VMUWK.js.map → claude-code-updater-OU4AEM5Y.js.map} +0 -0
  32. /package/dist/{claude-pair-runtime-AAGIQSUI.js.map → claude-pair-runtime-H7A7ZOEW.js.map} +0 -0
  33. /package/dist/{persistent-session-FJ4Y7XIB.js.map → persistent-session-OUCTECWP.js.map} +0 -0
  34. /package/dist/{responsiveness-probe-2MCC7NOE.js.map → responsiveness-probe-SC72APRB.js.map} +0 -0
  35. /package/dist/{session-auth-dead-MDZWPSED.js.map → session-auth-dead-MQR2SLW5.js.map} +0 -0
@@ -13,9 +13,9 @@ import {
13
13
  probeClaudeInstalls,
14
14
  readsAsNativeInstall,
15
15
  shouldRunClaudeCodeUpdater
16
- } from "./chunk-I6HGFJNX.js";
16
+ } from "./chunk-JZOA4A3J.js";
17
17
  import "./chunk-XWVM4KPK.js";
18
- import "./chunk-4KSUIAI4.js";
18
+ import "./chunk-WW2CTOEO.js";
19
19
  import "./chunk-AIUIMEUS.js";
20
20
  import "./chunk-DGUM43GV.js";
21
21
  export {
@@ -34,4 +34,4 @@ export {
34
34
  readsAsNativeInstall,
35
35
  shouldRunClaudeCodeUpdater
36
36
  };
37
- //# sourceMappingURL=claude-code-updater-KA4VMUWK.js.map
37
+ //# sourceMappingURL=claude-code-updater-OU4AEM5Y.js.map
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  redactPaneFrame,
12
12
  sanitizeTerminalFrame
13
- } from "./chunk-4KSUIAI4.js";
13
+ } from "./chunk-WW2CTOEO.js";
14
14
  import {
15
15
  CLAUDE_CONFIG_DIR_ENV,
16
16
  claudeConfigDirFor,
@@ -323,7 +323,7 @@ async function spawnPairSession(session) {
323
323
  return { ok: true };
324
324
  } catch {
325
325
  }
326
- const { resolveClaudeBinary } = await import("./persistent-session-FJ4Y7XIB.js");
326
+ const { resolveClaudeBinary } = await import("./persistent-session-OUCTECWP.js");
327
327
  const claudeBin = resolveClaudeBinary();
328
328
  const pairEnv = {
329
329
  ...process.env,
@@ -838,4 +838,4 @@ export {
838
838
  startClaudePair,
839
839
  submitClaudePairCode
840
840
  };
841
- //# sourceMappingURL=claude-pair-runtime-AAGIQSUI.js.map
841
+ //# sourceMappingURL=claude-pair-runtime-H7A7ZOEW.js.map
@@ -70,7 +70,7 @@ import {
70
70
  tripClass,
71
71
  writeEtcEnvironment,
72
72
  writeProfileDScript
73
- } from "../chunk-IA3IT3JM.js";
73
+ } from "../chunk-HMH4EOV5.js";
74
74
  import {
75
75
  ApiError,
76
76
  adoptHostKeyInProcess,
@@ -88,7 +88,7 @@ import {
88
88
  probeHostKey,
89
89
  requireHost,
90
90
  setConfigHash
91
- } from "../chunk-VOYD7FPP.js";
91
+ } from "../chunk-GZT7DHPV.js";
92
92
  import {
93
93
  BLOCKED_ON_PROMPT_DECISION,
94
94
  CHANNEL_SECRET_ENV_KEYS,
@@ -105,6 +105,7 @@ import {
105
105
  creditWatchdogGiveUpCount,
106
106
  creditWatchdogUnclaimedDialogCount,
107
107
  denyWebFetchForToolsContent,
108
+ dockerStartReadinessAsync,
108
109
  effectiveIsolationMode,
109
110
  egressMode,
110
111
  execFilePromiseLong,
@@ -184,7 +185,7 @@ import {
184
185
  webFetchBaselineValue,
185
186
  webFetchRestartNeeded,
186
187
  writeEgressAllowlist
187
- } from "../chunk-CQQYZUC5.js";
188
+ } from "../chunk-VSJUMNQ5.js";
188
189
  import {
189
190
  isAgentIdle,
190
191
  isStaleForToday,
@@ -196,7 +197,7 @@ import {
196
197
  subagentActivityAgeSeconds,
197
198
  subagentTranscriptDir,
198
199
  transcriptActivityAgeSeconds
199
- } from "../chunk-GLX5CD6S.js";
200
+ } from "../chunk-NXTNYNNV.js";
200
201
  import {
201
202
  classifyUnanswerablePane,
202
203
  focusedConfirmDialogBlock,
@@ -222,7 +223,7 @@ import {
222
223
  runSafeCleanup,
223
224
  tightestDiskStat,
224
225
  withPackageCacheLock
225
- } from "../chunk-I6HGFJNX.js";
226
+ } from "../chunk-JZOA4A3J.js";
226
227
  import {
227
228
  parsePsRows,
228
229
  reapOrphanChannelMcps
@@ -351,7 +352,7 @@ import {
351
352
  stabiliseResetInstant,
352
353
  sumTranscriptUsageInWindow,
353
354
  summarizeTranscriptActivity
354
- } from "../chunk-4KSUIAI4.js";
355
+ } from "../chunk-WW2CTOEO.js";
355
356
  import {
356
357
  CLAUDE_CONFIG_DIR_ENV,
357
358
  claudeConfigDirFor,
@@ -16018,7 +16019,7 @@ function createFileMigrationReportIO(codeName, log2) {
16018
16019
  };
16019
16020
  }
16020
16021
  var managerHostPost = async (path, body) => {
16021
- const { api: api2, ApiError: ApiError3 } = await import("../api-client-HAN3QU6H.js");
16022
+ const { api: api2, ApiError: ApiError3 } = await import("../api-client-QHGAABOL.js");
16022
16023
  try {
16023
16024
  const json = await api2.post(path, body);
16024
16025
  return { status: 200, json };
@@ -16660,6 +16661,81 @@ var PersistentSessionStuckTracker = class {
16660
16661
  }
16661
16662
  };
16662
16663
 
16664
+ // src/lib/isolation-fail-closed.ts
16665
+ function isolationSpawnRefusal(mode, readiness) {
16666
+ if (mode !== "docker") return null;
16667
+ const r = readiness();
16668
+ return r.ok ? null : { reason: r.reason };
16669
+ }
16670
+ var ISOLATION_REFUSAL_ALERT_REFRESH_MS = 10 * 6e4;
16671
+ var ISOLATION_REFUSAL_REAPER = "isolation-fail-closed";
16672
+ var IsolationRefusalAlerts = class {
16673
+ lastSent = /* @__PURE__ */ new Map();
16674
+ /**
16675
+ * Which code name each refused agent id has (CodeRabbit on #7695): the realtime
16676
+ * unassign callback knows only the agent id, so without this it cannot find the
16677
+ * window to clear, and a reassignment inside it would stay silent.
16678
+ */
16679
+ codeByAgent = /* @__PURE__ */ new Map();
16680
+ /** Record that `agentId` is refused as `codeName`, so an id-only teardown can clear it. */
16681
+ remember(agentId, codeName) {
16682
+ if (agentId && codeName) this.codeByAgent.set(agentId, codeName);
16683
+ }
16684
+ /** True when the alert for this agent should be sent (first refusal, or a refresh is due). */
16685
+ shouldSend(codeName, nowMs) {
16686
+ const last = this.lastSent.get(codeName);
16687
+ if (last !== void 0 && nowMs - last < ISOLATION_REFUSAL_ALERT_REFRESH_MS) return false;
16688
+ this.lastSent.set(codeName, nowMs);
16689
+ return true;
16690
+ }
16691
+ /**
16692
+ * The send for this window FAILED: forget it, so the next refusal sends again rather
16693
+ * than waiting out a refresh window for an alert that never arrived.
16694
+ */
16695
+ release(codeName) {
16696
+ this.lastSent.delete(codeName);
16697
+ }
16698
+ /** The agent spawned (or left the host): stop re-sending, so the alert can close. */
16699
+ clear(codeName) {
16700
+ this.lastSent.delete(codeName);
16701
+ }
16702
+ /** The agent left the host, known only by its id (the realtime unassign path). */
16703
+ clearAgent(agentId) {
16704
+ const codeName = this.codeByAgent.get(agentId);
16705
+ this.codeByAgent.delete(agentId);
16706
+ if (codeName) this.lastSent.delete(codeName);
16707
+ }
16708
+ /** Test seam. */
16709
+ isOpen(codeName) {
16710
+ return this.lastSent.has(codeName);
16711
+ }
16712
+ };
16713
+ async function sendRefusalAlertIfDue(alerts, codeName, nowMs, send2, agentId) {
16714
+ if (agentId) alerts.remember(agentId, codeName);
16715
+ if (!alerts.shouldSend(codeName, nowMs)) return "skipped";
16716
+ let delivered = false;
16717
+ try {
16718
+ delivered = await send2();
16719
+ } catch {
16720
+ delivered = false;
16721
+ }
16722
+ if (!delivered) alerts.release(codeName);
16723
+ return delivered ? "delivered" : "failed";
16724
+ }
16725
+ function isolationRefusalMessage(codeName, hostName, reason) {
16726
+ return `Refused to start agent '${codeName}' on host '${hostName}': AGT_ISOLATION=docker but the Docker runtime is unusable (reason=${reason}). Agents on an isolated host are never started unisolated (ENG-12183). Fix Docker or the agt-runtime image; the manager re-checks every minute and starts the agent once the runtime is usable. Agents already running in containers are unaffected.`;
16727
+ }
16728
+ function startWithIsolationBackstop(start, onRefused) {
16729
+ try {
16730
+ start();
16731
+ return void 0;
16732
+ } catch (err) {
16733
+ const e = err;
16734
+ if (e && e.name === "IsolationUnavailableError" && typeof e.reason === "string") return onRefused(e.reason);
16735
+ throw err;
16736
+ }
16737
+ }
16738
+
16663
16739
  // src/lib/heartbeat-diagnostics-code-names.ts
16664
16740
  function heartbeatDiagnosticsCodeNames(persistentSessionAgents, spawnOutcomeCodeNames) {
16665
16741
  const out = /* @__PURE__ */ new Set();
@@ -17362,10 +17438,12 @@ async function reportReaperEvent(agentId, reaper, action, reason) {
17362
17438
  action,
17363
17439
  reason
17364
17440
  });
17441
+ return true;
17365
17442
  } catch (err) {
17366
17443
  log(
17367
17444
  `[${reaper}] failed to report reaper-event (ENG-6184): ${err.message} \u2014 local reap still proceeded; the alert may be missed`
17368
17445
  );
17446
+ return false;
17369
17447
  }
17370
17448
  }
17371
17449
  var dangerousRmBackstop = new DangerousRmBackstop();
@@ -18111,7 +18189,7 @@ var pendingDayRolloverReset = /* @__PURE__ */ new Set();
18111
18189
  var dayRolloverInboundHold = /* @__PURE__ */ new Map();
18112
18190
  var INBOUND_HOLD_EPISODE_GAP_MS = 12e4;
18113
18191
  async function channelInboundActivityAgeSecondsFor(codeName) {
18114
- const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-2MCC7NOE.js");
18192
+ const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-SC72APRB.js");
18115
18193
  const newest = newestPendingInboundActivityMtimeMs(dirname11(paneLogPath(codeName)));
18116
18194
  if (newest === null) return null;
18117
18195
  return Math.max(0, Math.floor((Date.now() - newest) / 1e3));
@@ -18508,6 +18586,7 @@ function readSpawnViewMcpConfig(codeName, projectDir) {
18508
18586
  }
18509
18587
  var sessionsSpawnedByThisProcess = /* @__PURE__ */ new Set();
18510
18588
  var spawnCopyFailures = new SpawnCopyFailureTracker();
18589
+ var isolationRefusalAlerts = new IsolationRefusalAlerts();
18511
18590
  function reportSpawnCopyFailure(codeName, f) {
18512
18591
  const agentId = agentState.codeNameToAgentId.get(codeName);
18513
18592
  if (!agentId) return;
@@ -18955,9 +19034,15 @@ function resolveAgentFramework(codeName) {
18955
19034
  const frameworkId = agentFrameworkCache.get(codeName) ?? DEFAULT_FRAMEWORK;
18956
19035
  return getFramework(frameworkId);
18957
19036
  }
19037
+ function handleRealtimeUnassign(agentId) {
19038
+ log(`[realtime] Agent ${agentId} unassigned`);
19039
+ clearAgentCaches(agentId, "");
19040
+ }
18958
19041
  function clearAgentCaches(agentId, codeName) {
18959
19042
  const channelCacheMutated = clearAgentState(agentId, codeName);
18960
19043
  agentChannelTokens.delete(codeName);
19044
+ if (codeName) isolationRefusalAlerts.clear(codeName);
19045
+ isolationRefusalAlerts.clearAgent(agentId);
18961
19046
  directChatChainStart.delete(agentId);
18962
19047
  agentStatusLedger.forget(agentId);
18963
19048
  blockedPromptCost.forget(codeName);
@@ -19015,7 +19100,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
19015
19100
  var lastVersionCheckAt = 0;
19016
19101
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
19017
19102
  var lastResponsivenessProbeAt = 0;
19018
- var agtCliVersion = true ? "0.28.1307" : "dev";
19103
+ var agtCliVersion = true ? "0.28.1308" : "dev";
19019
19104
  function resolveBrewPath(execFileSync5) {
19020
19105
  try {
19021
19106
  const out = execFileSync5("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -21151,7 +21236,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
21151
21236
  if (codeNames.length === 0) return;
21152
21237
  void (async () => {
21153
21238
  try {
21154
- const { collectDiagnostics } = await import("../persistent-session-FJ4Y7XIB.js");
21239
+ const { collectDiagnostics } = await import("../persistent-session-OUCTECWP.js");
21155
21240
  await api.post("/host/heartbeat", {
21156
21241
  host_id: hostId,
21157
21242
  agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor)
@@ -21296,7 +21381,7 @@ async function pollCycleInner() {
21296
21381
  }
21297
21382
  try {
21298
21383
  const { detectHostSecurity } = await import("../host-security-KQYYZZVW.js");
21299
- const { collectDiagnostics } = await import("../persistent-session-FJ4Y7XIB.js");
21384
+ const { collectDiagnostics } = await import("../persistent-session-OUCTECWP.js");
21300
21385
  const recordedSinceHeartbeat = new Set(spawnOutcomesSinceHeartbeat.drain());
21301
21386
  const diagCodeNames = heartbeatDiagnosticsCodeNames(agentState.persistentSessionAgents, recordedSinceHeartbeat);
21302
21387
  const heartbeatSpawnOutcomeFor = spawnOutcomeIfRecorded(spawnOutcomeForDiagnostics, recordedSinceHeartbeat);
@@ -21597,7 +21682,7 @@ async function pollCycleInner() {
21597
21682
  }
21598
21683
  try {
21599
21684
  const desiredClaudeCodeVersion = hbResp?.desired_claude_code_version?.trim();
21600
- const { maybeUpdateClaudeCode, shouldRunClaudeCodeUpdater } = await import("../claude-code-updater-KA4VMUWK.js");
21685
+ const { maybeUpdateClaudeCode, shouldRunClaudeCodeUpdater } = await import("../claude-code-updater-OU4AEM5Y.js");
21601
21686
  const securityFloor = currentSecurityFloor();
21602
21687
  claudeUpdaterInFlight = true;
21603
21688
  if (desiredClaudeCodeVersion && (claudePairLoop.busy || claudePairingInProgress())) {
@@ -21632,7 +21717,7 @@ async function pollCycleInner() {
21632
21717
  collectPanelessActivityProbes,
21633
21718
  getResponsivenessIntervalMs,
21634
21719
  occupancyQualificationClassifications
21635
- } = await import("../responsiveness-probe-2MCC7NOE.js");
21720
+ } = await import("../responsiveness-probe-SC72APRB.js");
21636
21721
  const probeIntervalMs = getResponsivenessIntervalMs();
21637
21722
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
21638
21723
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -21749,7 +21834,7 @@ async function pollCycleInner() {
21749
21834
  collectResponsivenessProbes,
21750
21835
  livePendingInboundOldestAgeSeconds,
21751
21836
  parkPendingInbound
21752
- } = await import("../responsiveness-probe-2MCC7NOE.js");
21837
+ } = await import("../responsiveness-probe-SC72APRB.js");
21753
21838
  const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-5PCBGRNY.js");
21754
21839
  const wedgeNow = /* @__PURE__ */ new Date();
21755
21840
  const liveAgents = agentState.persistentSessionAgents;
@@ -22038,7 +22123,7 @@ async function pollCycleInner() {
22038
22123
  }
22039
22124
  );
22040
22125
  if (!paneFatalTornDown) continue;
22041
- const { parkPendingInbound } = await import("../responsiveness-probe-2MCC7NOE.js");
22126
+ const { parkPendingInbound } = await import("../responsiveness-probe-SC72APRB.js");
22042
22127
  const { parked, deadLettered } = parkPendingInbound(codeName, new Date(fatalNowMs));
22043
22128
  paneFatalStreak.delete(codeName);
22044
22129
  paneFatalRestarts.set(codeName, [...history, fatalNowMs]);
@@ -22069,7 +22154,7 @@ async function pollCycleInner() {
22069
22154
  TRANSCRIPT_MOUNT_ESCALATION_REFRESH_MS,
22070
22155
  bindSourceEscalations
22071
22156
  } = await import("../transcript-mount-health-OHE6IVJV.js");
22072
- const { transcriptBindSourcesFor, ensureTranscriptBindSources } = await import("../persistent-session-FJ4Y7XIB.js");
22157
+ const { transcriptBindSourcesFor, ensureTranscriptBindSources } = await import("../persistent-session-OUCTECWP.js");
22073
22158
  const mountConfig = resolveTranscriptMountConfig();
22074
22159
  const liveAgents = agentState.persistentSessionAgents;
22075
22160
  for (const tracked of [
@@ -22235,7 +22320,7 @@ async function pollCycleInner() {
22235
22320
  }
22236
22321
  try {
22237
22322
  const { scrapeMcpFailedBannerCount } = await import("../pane-mcp-banner-scraper-VR5QGP3J.js");
22238
- const { probeSessionAuth } = await import("../session-auth-dead-MDZWPSED.js");
22323
+ const { probeSessionAuth } = await import("../session-auth-dead-MQR2SLW5.js");
22239
22324
  const observations = [];
22240
22325
  const pendingCacheCommits = [];
22241
22326
  const modelApiErrorReportingOn = hostFlagStore().getBoolean("model-api-error-reporting");
@@ -26845,6 +26930,25 @@ ${truncateForLog(ctx.tail)}` : `; pane_tail_hash=sha256:${createHash21("sha256")
26845
26930
  } catch (err) {
26846
26931
  log(`[persistent-session] Failed to provision PreCompact hook for '${codeName}': ${err.message}`);
26847
26932
  }
26933
+ const isoIntent = isolationMode(codeName);
26934
+ const startReadiness = isoIntent === "docker" ? await dockerStartReadinessAsync() : void 0;
26935
+ const isoRefusal = isolationSpawnRefusal(isoIntent, () => startReadiness ?? { ok: true });
26936
+ if (isoRefusal) {
26937
+ const message = isolationRefusalMessage(codeName, hostname2(), isoRefusal.reason);
26938
+ log(`[persistent-session] Skipping '${codeName}' (ENG-12183) - ${message}`);
26939
+ void sendRefusalAlertIfDue(
26940
+ isolationRefusalAlerts,
26941
+ codeName,
26942
+ Date.now(),
26943
+ () => reportReaperEvent(agent.agent_id, ISOLATION_REFUSAL_REAPER, "blocked", message),
26944
+ agent.agent_id
26945
+ );
26946
+ return {
26947
+ decision: "skipped-isolation-unavailable",
26948
+ spawnAttempted: false,
26949
+ sessionHealthyAfter: isSessionHealthy(codeName)
26950
+ };
26951
+ }
26848
26952
  const sessionRunResult = await startRun({
26849
26953
  agent_id: agent.agent_id,
26850
26954
  source_type: "system",
@@ -26922,9 +27026,10 @@ ${truncateForLog(ctx.tail)}` : `; pane_tail_hash=sha256:${createHash21("sha256")
26922
27026
  }
26923
27027
  });
26924
27028
  if (!spawnCopyFailedNow) spawnCopyFailures.noteSuccess(codeName);
26925
- startPersistentSession({
27029
+ const lateRefusal = startWithIsolationBackstop(() => startPersistentSession({
26926
27030
  codeName,
26927
27031
  agentId: agent.agent_id,
27032
+ isolationReadiness: startReadiness,
26928
27033
  projectDir,
26929
27034
  mcpConfigPath: spawnMcpConfigPath,
26930
27035
  claudeMdPath,
@@ -27004,7 +27109,25 @@ ${truncateForLog(ctx.tail)}` : `; pane_tail_hash=sha256:${createHash21("sha256")
27004
27109
  // so the KEYS/VALUES can't diverge from what would have been persisted.
27005
27110
  channelSpawnSecrets: shouldInjectChannelSecrets(agent.agent_id) ? collectChannelSpawnSecrets(channelConfigs) : void 0,
27006
27111
  log
27112
+ }), (reason) => {
27113
+ closeSessionRunForCode(codeName, "failed", "isolation unavailable at start");
27114
+ const message = isolationRefusalMessage(codeName, hostname2(), reason);
27115
+ log(`[persistent-session] Skipping '${codeName}' (ENG-12183, at start) - ${message}`);
27116
+ void sendRefusalAlertIfDue(
27117
+ isolationRefusalAlerts,
27118
+ codeName,
27119
+ Date.now(),
27120
+ () => reportReaperEvent(agent.agent_id, ISOLATION_REFUSAL_REAPER, "blocked", message),
27121
+ agent.agent_id
27122
+ );
27123
+ return {
27124
+ decision: "skipped-isolation-unavailable",
27125
+ spawnAttempted: false,
27126
+ sessionHealthyAfter: isSessionHealthy(codeName)
27127
+ };
27007
27128
  });
27129
+ if (lateRefusal) return lateRefusal;
27130
+ isolationRefusalAlerts.clear(codeName);
27008
27131
  agentState.persistentSessionAgents.add(codeName);
27009
27132
  claudeAuthTupleBySession.set(codeName, currentAuthTuple);
27010
27133
  recordSessionPolicyBaseline(codeName, currentPolicyModel, currentPolicyId);
@@ -27418,7 +27541,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
27418
27541
  if (!refreshData) return;
27419
27542
  const framework = refreshData.agent?.framework ?? agentFrameworkCache.get(codeName) ?? DEFAULT_FRAMEWORK;
27420
27543
  const hostId = await getHostId();
27421
- const parkForRestart = await import("../responsiveness-probe-2MCC7NOE.js").then(
27544
+ const parkForRestart = await import("../responsiveness-probe-SC72APRB.js").then(
27422
27545
  (m) => m.parkPendingInbound,
27423
27546
  (err) => err
27424
27547
  );
@@ -27499,7 +27622,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
27499
27622
  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}`));
27500
27623
  void (async () => {
27501
27624
  try {
27502
- const { collectDiagnostics } = await import("../persistent-session-FJ4Y7XIB.js");
27625
+ const { collectDiagnostics } = await import("../persistent-session-OUCTECWP.js");
27503
27626
  await api.post("/host/heartbeat", {
27504
27627
  host_id: hostId,
27505
27628
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor)
@@ -27552,7 +27675,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
27552
27675
  }
27553
27676
  try {
27554
27677
  const hostId = await getHostId();
27555
- const { collectDiagnostics } = await import("../persistent-session-FJ4Y7XIB.js");
27678
+ const { collectDiagnostics } = await import("../persistent-session-OUCTECWP.js");
27556
27679
  await api.post("/host/heartbeat", {
27557
27680
  host_id: hostId,
27558
27681
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor)
@@ -27599,10 +27722,7 @@ function ensureRealtimeAssignStarted(agentStates) {
27599
27722
  triggerEarlyPoll(`agent ${payload.agent_id} assigned to this host`, payload.agent_id);
27600
27723
  markAgentForFreshMemorySync(payload.agent_id);
27601
27724
  },
27602
- onUnassign: (payload) => {
27603
- log(`[realtime] Agent ${payload.agent_id} unassigned`);
27604
- clearAgentCaches(payload.agent_id, "");
27605
- },
27725
+ onUnassign: (payload) => handleRealtimeUnassign(payload.agent_id),
27606
27726
  log
27607
27727
  });
27608
27728
  realtimeAssignStarted = true;
@@ -28431,7 +28551,7 @@ async function processClaudePairSessions(agents) {
28431
28551
  snapshotPairConfig,
28432
28552
  // ENG-11659: result -> report body + the manager.log line that records it.
28433
28553
  planPairStartReport
28434
- } = await import("../claude-pair-runtime-AAGIQSUI.js");
28554
+ } = await import("../claude-pair-runtime-H7A7ZOEW.js");
28435
28555
  const { resetClaudeSignin, describeSigninResetForLog, describeSigninResetFailure } = await import("../claude-signin-reset-6IJMMVYG.js");
28436
28556
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
28437
28557
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
@@ -29896,6 +30016,7 @@ export {
29896
30016
  claudeManagedSettingsPath,
29897
30017
  claudePairLoopArmed,
29898
30018
  claudePairingInProgress,
30019
+ clearAgentCaches,
29899
30020
  coverageOf,
29900
30021
  createManagedPruneLedger,
29901
30022
  createManagedToolkitReader,
@@ -29912,6 +30033,7 @@ export {
29912
30033
  forgetChannelSyncState,
29913
30034
  forgetRealtimeRebindState,
29914
30035
  gateTierTableWithheld,
30036
+ handleRealtimeUnassign,
29915
30037
  hasRevokedResiduals,
29916
30038
  holdRealtimeRebindInFlight,
29917
30039
  inboundHoldMinutes,
@@ -29919,6 +30041,7 @@ export {
29919
30041
  integrationRenderPending,
29920
30042
  isOlderSemverTuple,
29921
30043
  isPrereleaseVersion,
30044
+ isolationRefusalAlerts,
29922
30045
  jitteredRealtimeRebindBackoffMs,
29923
30046
  managedSettingsOwnership,
29924
30047
  markAgentForFreshMemorySync,