@integrity-labs/agt-cli 0.28.826 → 0.28.827

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.
@@ -16,7 +16,7 @@ import {
16
16
  parseEnvIntegrations,
17
17
  shellQuote,
18
18
  summarizeUnanswerablePane
19
- } from "./chunk-Q3JUZZDB.js";
19
+ } from "./chunk-6HTCP6D5.js";
20
20
  import {
21
21
  BIND_FAILURE_QUARANTINE_THRESHOLD,
22
22
  INTEGRATIONS_SECTION_END,
@@ -6494,7 +6494,7 @@ function exchangeFailureKind(err) {
6494
6494
  }
6495
6495
 
6496
6496
  // src/lib/api-client.ts
6497
- var agtCliVersion = true ? "0.28.826" : "dev";
6497
+ var agtCliVersion = true ? "0.28.827" : "dev";
6498
6498
  var lastConfigHash = null;
6499
6499
  function setConfigHash(hash) {
6500
6500
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -10801,4 +10801,4 @@ export {
10801
10801
  managerInstallSystemUnitCommand,
10802
10802
  managerUninstallSystemUnitCommand
10803
10803
  };
10804
- //# sourceMappingURL=chunk-JO7QTVLM.js.map
10804
+ //# sourceMappingURL=chunk-VOQ25S2E.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-BOHUJCZL.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-6YTEDS3H.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-SWB525DM.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-UTDZXJKO.js.map
@@ -59,7 +59,7 @@ import {
59
59
  safeWriteJsonAtomic,
60
60
  setConfigHash,
61
61
  tripClass
62
- } from "../chunk-JO7QTVLM.js";
62
+ } from "../chunk-VOQ25S2E.js";
63
63
  import {
64
64
  getProjectDir as getProjectDir2,
65
65
  getReadyTasks,
@@ -100,6 +100,7 @@ import {
100
100
  paneLogPath,
101
101
  parseEnvIntegrations,
102
102
  parseModelPolicy,
103
+ policyResolvedModel,
103
104
  prepareForRespawn,
104
105
  readChannelServerEnv,
105
106
  readDirectChatSessionState,
@@ -124,7 +125,7 @@ import {
124
125
  takeZombieDetection,
125
126
  toOpencodeModel,
126
127
  writeEgressAllowlist
127
- } from "../chunk-Q3JUZZDB.js";
128
+ } from "../chunk-6HTCP6D5.js";
128
129
  import {
129
130
  ACCOUNT_ENFORCEMENT_MARKER_FILENAME,
130
131
  AnchorSessionClient,
@@ -12926,7 +12927,7 @@ var pendingDayRolloverReset = /* @__PURE__ */ new Set();
12926
12927
  var dayRolloverInboundHold = /* @__PURE__ */ new Map();
12927
12928
  var INBOUND_HOLD_EPISODE_GAP_MS = 12e4;
12928
12929
  async function channelInboundActivityAgeSecondsFor(codeName) {
12929
- const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-5DYKPYPP.js");
12930
+ const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-TIEZW3XP.js");
12930
12931
  const newest = newestPendingInboundActivityMtimeMs(dirname10(paneLogPath(codeName)));
12931
12932
  if (newest === null) return null;
12932
12933
  return Math.max(0, Math.floor((Date.now() - newest) / 1e3));
@@ -13594,7 +13595,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
13594
13595
  var lastVersionCheckAt = 0;
13595
13596
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
13596
13597
  var lastResponsivenessProbeAt = 0;
13597
- var agtCliVersion = true ? "0.28.826" : "dev";
13598
+ var agtCliVersion = true ? "0.28.827" : "dev";
13598
13599
  function resolveBrewPath(execFileSync2) {
13599
13600
  try {
13600
13601
  const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -15184,7 +15185,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
15184
15185
  if (codeNames.length === 0) return;
15185
15186
  void (async () => {
15186
15187
  try {
15187
- const { collectDiagnostics } = await import("../persistent-session-BOHUJCZL.js");
15188
+ const { collectDiagnostics } = await import("../persistent-session-6YTEDS3H.js");
15188
15189
  await api.post("/host/heartbeat", {
15189
15190
  host_id: hostId,
15190
15191
  agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor)
@@ -15239,6 +15240,7 @@ async function pollCycleInner() {
15239
15240
  stopPersistentSessionAndForgetMcpBaseline(codeName, breakerReason);
15240
15241
  agentState.persistentSessionAgents.delete(codeName);
15241
15242
  claudeAuthTupleBySession.delete(codeName);
15243
+ modelPolicyModelBySession.delete(codeName);
15242
15244
  },
15243
15245
  getTelegramTokens: (codeName) => {
15244
15246
  const t = agentChannelTokens.get(codeName);
@@ -15325,7 +15327,7 @@ async function pollCycleInner() {
15325
15327
  }
15326
15328
  try {
15327
15329
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
15328
- const { collectDiagnostics } = await import("../persistent-session-BOHUJCZL.js");
15330
+ const { collectDiagnostics } = await import("../persistent-session-6YTEDS3H.js");
15329
15331
  const diagCodeNames = [...agentState.persistentSessionAgents];
15330
15332
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor) : void 0;
15331
15333
  let tailscaleHostname;
@@ -15494,7 +15496,7 @@ async function pollCycleInner() {
15494
15496
  collectPanelessActivityProbes,
15495
15497
  getResponsivenessIntervalMs,
15496
15498
  occupancyQualificationClassifications
15497
- } = await import("../responsiveness-probe-5DYKPYPP.js");
15499
+ } = await import("../responsiveness-probe-TIEZW3XP.js");
15498
15500
  const probeIntervalMs = getResponsivenessIntervalMs();
15499
15501
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
15500
15502
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -15611,7 +15613,7 @@ async function pollCycleInner() {
15611
15613
  collectResponsivenessProbes,
15612
15614
  livePendingInboundOldestAgeSeconds,
15613
15615
  parkPendingInbound
15614
- } = await import("../responsiveness-probe-5DYKPYPP.js");
15616
+ } = await import("../responsiveness-probe-TIEZW3XP.js");
15615
15617
  const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-NDP36U7O.js");
15616
15618
  const wedgeNow = /* @__PURE__ */ new Date();
15617
15619
  const liveAgents = agentState.persistentSessionAgents;
@@ -19054,6 +19056,7 @@ var DAY_ROLLOVER_INBOUND_GRACE_SEC = 60;
19054
19056
  var DAY_ROLLOVER_INBOUND_DEFER_MAX_MIN = 10;
19055
19057
  var persistentSessionStuckTracker = new PersistentSessionStuckTracker();
19056
19058
  var claudeAuthTupleBySession = /* @__PURE__ */ new Map();
19059
+ var modelPolicyModelBySession = /* @__PURE__ */ new Map();
19057
19060
  var opencodeCredentialFingerprintBySession = /* @__PURE__ */ new Map();
19058
19061
  var egressAllowlistBySession = /* @__PURE__ */ new Map();
19059
19062
  function deriveEgressAllowlist(toolsRaw, policy) {
@@ -19264,6 +19267,7 @@ async function ensurePersistentSession(agent, tasks, boardItems, refreshData) {
19264
19267
  });
19265
19268
  agentState.persistentSessionAgents.delete(codeName);
19266
19269
  claudeAuthTupleBySession.delete(codeName);
19270
+ modelPolicyModelBySession.delete(codeName);
19267
19271
  }
19268
19272
  return {
19269
19273
  decision: "skipped-auth-resolve-failed",
@@ -19315,28 +19319,49 @@ async function ensurePersistentSession(agent, tasks, boardItems, refreshData) {
19315
19319
  claudeAccountFingerprint,
19316
19320
  modelPolicyComponent: modelPolicyAuthComponent(modelPolicy)
19317
19321
  });
19322
+ const currentPolicyModel = policyResolvedModel({
19323
+ policy: modelPolicy,
19324
+ openRouterMode: Boolean(openRouterForAgent),
19325
+ // The same null the launcher config carries — see `modelPolicyGatewayToken`
19326
+ // at the spawn call site below, where its absence is deliberate until
19327
+ // ENG-9481 decides what a gateway credential is. Both sites must move
19328
+ // together: a token here and not there (or the reverse) resolves a gateway
19329
+ // binding `blocked` for one and honoured for the other, and the recorded
19330
+ // baseline would then describe an agent that does not exist.
19331
+ gatewayToken: null,
19332
+ codeName
19333
+ });
19318
19334
  const recordedAuthTuple = claudeAuthTupleBySession.get(codeName);
19335
+ const recordedPolicyModel = modelPolicyModelBySession.get(codeName);
19319
19336
  if (recordedAuthTuple && recordedAuthTuple !== currentAuthTuple && isSessionHealthy(codeName)) {
19320
19337
  const authTupleDiff = diffAuthTuples(recordedAuthTuple, currentAuthTuple);
19321
19338
  log(
19322
19339
  `[persistent-session] Auth config changed for '${codeName}' (${recordedAuthTuple} \u2192 ${currentAuthTuple}) \u2014 ${authTupleDiff.summary} \u2014 restarting session`
19323
19340
  );
19324
- const failoverNotice = failoverRestartNotice({
19341
+ const policyNotice = failoverRestartNotice({
19325
19342
  components: authTupleDiff.components,
19326
- policy: modelPolicy
19343
+ policy: modelPolicy,
19344
+ previousModel: recordedPolicyModel,
19345
+ currentModel: currentPolicyModel
19327
19346
  });
19328
- if (failoverNotice && isSessionHealthy(codeName)) {
19347
+ if (policyNotice && isSessionHealthy(codeName)) {
19329
19348
  const status = await injectMessageWithStatus(
19330
19349
  codeName,
19331
19350
  "system",
19332
- failoverNotice + BACK_ONLINE_GREETING_GUIDANCE,
19333
- { task_name: "model-policy-failover" },
19351
+ policyNotice.text + BACK_ONLINE_GREETING_GUIDANCE,
19352
+ // ENG-10113: the label follows the DECISION, not the call site. One
19353
+ // function now produces two events, and filing a model change under
19354
+ // `model-policy-failover` would put a wrong word in a record an operator
19355
+ // later reads back as evidence of a failover that never happened.
19356
+ { task_name: `model-policy-${policyNotice.reason}` },
19334
19357
  log
19335
19358
  ).catch(() => ({ delivered: false, fallbackUsed: false }));
19336
19359
  if (status.fallbackUsed) {
19337
19360
  await new Promise((r) => setTimeout(r, 3e3));
19338
19361
  } else {
19339
- log(`[model-policy] Failover notice not delivered to '${codeName}' \u2014 restarting anyway`);
19362
+ log(
19363
+ `[model-policy] ${policyNotice.reason} notice not delivered to '${codeName}' \u2014 restarting anyway`
19364
+ );
19340
19365
  }
19341
19366
  }
19342
19367
  stopPersistentSessionAndForgetMcpBaseline(codeName, "auth-tuple-change", void 0, void 0, {
@@ -19607,6 +19632,8 @@ ${truncateForLog(ctx.tail)}` : `; pane_tail_hash=sha256:${createHash20("sha256")
19607
19632
  });
19608
19633
  agentState.persistentSessionAgents.add(codeName);
19609
19634
  claudeAuthTupleBySession.set(codeName, currentAuthTuple);
19635
+ if (currentPolicyModel) modelPolicyModelBySession.set(codeName, currentPolicyModel);
19636
+ else modelPolicyModelBySession.delete(codeName);
19610
19637
  seedSessionLaunchBaselines(codeName, projectDir);
19611
19638
  return {
19612
19639
  decision: "spawn",
@@ -19646,6 +19673,8 @@ ${truncateForLog(ctx.tail)}` : `; pane_tail_hash=sha256:${createHash20("sha256")
19646
19673
  }
19647
19674
  if (!claudeAuthTupleBySession.has(codeName)) {
19648
19675
  claudeAuthTupleBySession.set(codeName, currentAuthTuple);
19676
+ if (currentPolicyModel) modelPolicyModelBySession.set(codeName, currentPolicyModel);
19677
+ else modelPolicyModelBySession.delete(codeName);
19649
19678
  }
19650
19679
  const stableTasksHash = createHash20("sha256").update(JSON.stringify(tasks)).digest("hex").slice(0, 16);
19651
19680
  const prevHash = agentState.knownTasksHashes.get(agent.agent_id);
@@ -19969,7 +19998,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
19969
19998
  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}`));
19970
19999
  void (async () => {
19971
20000
  try {
19972
- const { collectDiagnostics } = await import("../persistent-session-BOHUJCZL.js");
20001
+ const { collectDiagnostics } = await import("../persistent-session-6YTEDS3H.js");
19973
20002
  await api.post("/host/heartbeat", {
19974
20003
  host_id: hostId,
19975
20004
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor)
@@ -20015,7 +20044,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
20015
20044
  }
20016
20045
  try {
20017
20046
  const hostId = await getHostId();
20018
- const { collectDiagnostics } = await import("../persistent-session-BOHUJCZL.js");
20047
+ const { collectDiagnostics } = await import("../persistent-session-6YTEDS3H.js");
20019
20048
  await api.post("/host/heartbeat", {
20020
20049
  host_id: hostId,
20021
20050
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor)
@@ -20651,7 +20680,7 @@ async function processClaudePairSessions(agents) {
20651
20680
  killPairSession,
20652
20681
  pairTmuxSession,
20653
20682
  finalizeClaudePairOnboarding
20654
- } = await import("../claude-pair-runtime-SWB525DM.js");
20683
+ } = await import("../claude-pair-runtime-UTDZXJKO.js");
20655
20684
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
20656
20685
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
20657
20686
  const killed = await killPairSession(pairTmuxSession(pairId));