@integrity-labs/agt-cli 0.28.612 → 0.28.613

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-KO24RZN7.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-U7PE7ZDB.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-4MKFMNYN.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-3UQ63455.js.map
@@ -53,7 +53,7 @@ import {
53
53
  safeWriteJsonAtomic,
54
54
  setConfigHash,
55
55
  tripClass
56
- } from "../chunk-F2WTBHMD.js";
56
+ } from "../chunk-D7EV77TB.js";
57
57
  import {
58
58
  getProjectDir as getProjectDir2,
59
59
  getReadyTasks,
@@ -109,7 +109,7 @@ import {
109
109
  takeZombieDetection,
110
110
  toOpencodeModel,
111
111
  writeEgressAllowlist
112
- } from "../chunk-DJP4JZGE.js";
112
+ } from "../chunk-JRL7754L.js";
113
113
  import {
114
114
  ACCOUNT_ENFORCEMENT_MARKER_FILENAME,
115
115
  AnchorSessionClient,
@@ -186,7 +186,7 @@ import {
186
186
  subagentActivityAgeSeconds,
187
187
  sumTranscriptUsageInWindow,
188
188
  transcriptActivityAgeSeconds
189
- } from "../chunk-RQAAW5LL.js";
189
+ } from "../chunk-ZQXXK7JC.js";
190
190
  import {
191
191
  reapOrphanChannelMcps
192
192
  } from "../chunk-XWVM4KPK.js";
@@ -11287,7 +11287,7 @@ var pendingDayRolloverReset = /* @__PURE__ */ new Set();
11287
11287
  var dayRolloverInboundHold = /* @__PURE__ */ new Map();
11288
11288
  var INBOUND_HOLD_EPISODE_GAP_MS = 12e4;
11289
11289
  async function channelInboundActivityAgeSecondsFor(codeName) {
11290
- const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-V4O7DXYV.js");
11290
+ const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-K6DGNTXA.js");
11291
11291
  const newest = newestPendingInboundActivityMtimeMs(dirname9(paneLogPath(codeName)));
11292
11292
  if (newest === null) return null;
11293
11293
  return Math.max(0, Math.floor((Date.now() - newest) / 1e3));
@@ -11926,7 +11926,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
11926
11926
  var lastVersionCheckAt = 0;
11927
11927
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
11928
11928
  var lastResponsivenessProbeAt = 0;
11929
- var agtCliVersion = true ? "0.28.612" : "dev";
11929
+ var agtCliVersion = true ? "0.28.613" : "dev";
11930
11930
  function resolveBrewPath(execFileSync3) {
11931
11931
  try {
11932
11932
  const out = execFileSync3("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -13233,7 +13233,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
13233
13233
  if (codeNames.length === 0) return;
13234
13234
  void (async () => {
13235
13235
  try {
13236
- const { collectDiagnostics } = await import("../persistent-session-KO24RZN7.js");
13236
+ const { collectDiagnostics } = await import("../persistent-session-U7PE7ZDB.js");
13237
13237
  await api.post("/host/heartbeat", {
13238
13238
  host_id: hostId,
13239
13239
  agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor)
@@ -13341,7 +13341,7 @@ async function pollCycle() {
13341
13341
  }
13342
13342
  try {
13343
13343
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
13344
- const { collectDiagnostics } = await import("../persistent-session-KO24RZN7.js");
13344
+ const { collectDiagnostics } = await import("../persistent-session-U7PE7ZDB.js");
13345
13345
  const diagCodeNames = [...agentState.persistentSessionAgents];
13346
13346
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor) : void 0;
13347
13347
  let tailscaleHostname;
@@ -13464,7 +13464,7 @@ async function pollCycle() {
13464
13464
  collectPanelessActivityProbes,
13465
13465
  getResponsivenessIntervalMs,
13466
13466
  occupancyQualificationClassifications
13467
- } = await import("../responsiveness-probe-V4O7DXYV.js");
13467
+ } = await import("../responsiveness-probe-K6DGNTXA.js");
13468
13468
  const probeIntervalMs = getResponsivenessIntervalMs();
13469
13469
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
13470
13470
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -13570,7 +13570,7 @@ async function pollCycle() {
13570
13570
  collectResponsivenessProbes,
13571
13571
  livePendingInboundOldestAgeSeconds,
13572
13572
  parkPendingInbound
13573
- } = await import("../responsiveness-probe-V4O7DXYV.js");
13573
+ } = await import("../responsiveness-probe-K6DGNTXA.js");
13574
13574
  const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-NDP36U7O.js");
13575
13575
  const wedgeNow = /* @__PURE__ */ new Date();
13576
13576
  const liveAgents = agentState.persistentSessionAgents;
@@ -13726,7 +13726,7 @@ async function pollCycle() {
13726
13726
  }
13727
13727
  try {
13728
13728
  const { scrapeMcpFailedBannerCount } = await import("../pane-mcp-banner-scraper-JA437JIB.js");
13729
- const { probeSessionAuth } = await import("../session-auth-dead-S7WK33WO.js");
13729
+ const { probeSessionAuth } = await import("../session-auth-dead-RPMWBVBH.js");
13730
13730
  const observations = [];
13731
13731
  const pendingCacheCommits = [];
13732
13732
  const modelApiErrorReportingOn = hostFlagStore().getBoolean("model-api-error-reporting");
@@ -17215,7 +17215,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
17215
17215
  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}`));
17216
17216
  void (async () => {
17217
17217
  try {
17218
- const { collectDiagnostics } = await import("../persistent-session-KO24RZN7.js");
17218
+ const { collectDiagnostics } = await import("../persistent-session-U7PE7ZDB.js");
17219
17219
  await api.post("/host/heartbeat", {
17220
17220
  host_id: hostId,
17221
17221
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor)
@@ -17266,7 +17266,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
17266
17266
  }
17267
17267
  try {
17268
17268
  const hostId = await getHostId();
17269
- const { collectDiagnostics } = await import("../persistent-session-KO24RZN7.js");
17269
+ const { collectDiagnostics } = await import("../persistent-session-U7PE7ZDB.js");
17270
17270
  await api.post("/host/heartbeat", {
17271
17271
  host_id: hostId,
17272
17272
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor)
@@ -17862,7 +17862,7 @@ async function processClaudePairSessions(agents) {
17862
17862
  killPairSession,
17863
17863
  pairTmuxSession,
17864
17864
  finalizeClaudePairOnboarding
17865
- } = await import("../claude-pair-runtime-4MKFMNYN.js");
17865
+ } = await import("../claude-pair-runtime-3UQ63455.js");
17866
17866
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
17867
17867
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
17868
17868
  const killed = await killPairSession(pairTmuxSession(pairId));
@@ -33932,7 +33932,14 @@ var AGENT_DIRECTED_NOTICE_KINDS = [
33932
33932
  // written for the machine. The user learns the same fact from the connect card
33933
33933
  // in that conversation flipping to its connected state, so showing this row as
33934
33934
  // well would say it twice, the second time in prose aimed at an agent.
33935
- "integration_connected"
33935
+ "integration_connected",
33936
+ // ENG-8745. The offer RESULT receipt (not the offer card — that one is
33937
+ // written for the human and is how they decided). Its content opens "Your
33938
+ // offer was ACCEPTED", carries an `[offer_result]` machine tag, and closes by
33939
+ // instructing the agent what not to do ("do not re-raise it yourself"). The
33940
+ // human needs none of it: they are the person who tapped the button, and the
33941
+ // card swapped under their finger to say so.
33942
+ "offer_result"
33936
33943
  ];
33937
33944
  var AGENT_DIRECTED_KIND_SET = new Set(AGENT_DIRECTED_NOTICE_KINDS);
33938
33945
 
@@ -40266,7 +40266,14 @@ var AGENT_DIRECTED_NOTICE_KINDS = [
40266
40266
  // written for the machine. The user learns the same fact from the connect card
40267
40267
  // in that conversation flipping to its connected state, so showing this row as
40268
40268
  // well would say it twice, the second time in prose aimed at an agent.
40269
- "integration_connected"
40269
+ "integration_connected",
40270
+ // ENG-8745. The offer RESULT receipt (not the offer card — that one is
40271
+ // written for the human and is how they decided). Its content opens "Your
40272
+ // offer was ACCEPTED", carries an `[offer_result]` machine tag, and closes by
40273
+ // instructing the agent what not to do ("do not re-raise it yourself"). The
40274
+ // human needs none of it: they are the person who tapped the button, and the
40275
+ // card swapped under their finger to say so.
40276
+ "offer_result"
40270
40277
  ];
40271
40278
  var AGENT_DIRECTED_KIND_SET = new Set(AGENT_DIRECTED_NOTICE_KINDS);
40272
40279
 
@@ -34317,7 +34317,14 @@ var AGENT_DIRECTED_NOTICE_KINDS = [
34317
34317
  // written for the machine. The user learns the same fact from the connect card
34318
34318
  // in that conversation flipping to its connected state, so showing this row as
34319
34319
  // well would say it twice, the second time in prose aimed at an agent.
34320
- "integration_connected"
34320
+ "integration_connected",
34321
+ // ENG-8745. The offer RESULT receipt (not the offer card — that one is
34322
+ // written for the human and is how they decided). Its content opens "Your
34323
+ // offer was ACCEPTED", carries an `[offer_result]` machine tag, and closes by
34324
+ // instructing the agent what not to do ("do not re-raise it yourself"). The
34325
+ // human needs none of it: they are the person who tapped the button, and the
34326
+ // card swapped under their finger to say so.
34327
+ "offer_result"
34321
34328
  ];
34322
34329
  var AGENT_DIRECTED_KIND_SET = new Set(AGENT_DIRECTED_NOTICE_KINDS);
34323
34330
 
@@ -39394,6 +39401,91 @@ async function runOrRetry(fn, opts) {
39394
39401
  }
39395
39402
  }
39396
39403
 
39404
+ // src/slack-socket-reconnect.ts
39405
+ var RECONNECT_BASE_DELAY_MS = 1e3;
39406
+ var RECONNECT_MAX_DELAY_MS = 3e4;
39407
+ var SOCKET_OPEN_TIMEOUT_MS = 3e4;
39408
+ var CONNECT_FETCH_TIMEOUT_MS = 15e3;
39409
+ var SOCKET_DOWN_ALERT_AFTER_MS = 3 * 6e4;
39410
+ function reconnectDelayMs(attempt, opts = {}) {
39411
+ const base = opts.baseMs ?? RECONNECT_BASE_DELAY_MS;
39412
+ const max = opts.maxMs ?? RECONNECT_MAX_DELAY_MS;
39413
+ const random = opts.random ?? Math.random;
39414
+ const safeAttempt = Math.max(1, Math.min(Math.floor(attempt), 30));
39415
+ const ceiling = Math.min(max, base * 2 ** (safeAttempt - 1));
39416
+ const floor = Math.min(base, ceiling);
39417
+ return Math.round(floor + random() * (ceiling - floor));
39418
+ }
39419
+ function redactSocketUrl(text) {
39420
+ return text.replace(
39421
+ /([?&])(ticket|token|app_id_key)=[^&\s"']*/gi,
39422
+ (_m, sep2, key2) => `${sep2}${key2}=<redacted>`
39423
+ );
39424
+ }
39425
+ function describeWebSocketError(err) {
39426
+ const parts = [];
39427
+ const e = err ?? {};
39428
+ if (typeof e.message === "string" && e.message) parts.push(e.message);
39429
+ const cause = e.error;
39430
+ if (cause && typeof cause === "object") {
39431
+ if (typeof cause.message === "string" && cause.message && !parts.includes(cause.message)) {
39432
+ parts.push(cause.message);
39433
+ }
39434
+ if (typeof cause.code === "string" && cause.code) parts.push(`errno=${cause.code}`);
39435
+ }
39436
+ if (typeof e.code === "number") parts.push(`code=${e.code}`);
39437
+ if (typeof e.reason === "string" && e.reason) parts.push(`reason=${e.reason}`);
39438
+ if (typeof e.wasClean === "boolean") parts.push(`wasClean=${e.wasClean}`);
39439
+ if (parts.length === 0) {
39440
+ const type = typeof e.type === "string" && e.type ? e.type : typeof err;
39441
+ const ctor = err && typeof err === "object" ? err.constructor?.name ?? "Object" : typeof err;
39442
+ return redactSocketUrl(`no detail available (${ctor}, type=${type})`);
39443
+ }
39444
+ return redactSocketUrl(parts.join(" "));
39445
+ }
39446
+ function isWebSocketOpen(ws) {
39447
+ return ws?.readyState === 1;
39448
+ }
39449
+ function createReconnectScheduler(deps) {
39450
+ const now = deps.now ?? Date.now;
39451
+ const setTimer = deps.setTimer ?? ((fn, ms) => setTimeout(fn, ms));
39452
+ let pending = false;
39453
+ let attempt = 0;
39454
+ let downSince = now();
39455
+ return {
39456
+ schedule(reason) {
39457
+ if (deps.shouldStop() || pending) return;
39458
+ pending = true;
39459
+ if (downSince === null) downSince = now();
39460
+ attempt += 1;
39461
+ const opts = {};
39462
+ if (deps.baseMs !== void 0) opts.baseMs = deps.baseMs;
39463
+ if (deps.maxMs !== void 0) opts.maxMs = deps.maxMs;
39464
+ if (deps.random !== void 0) opts.random = deps.random;
39465
+ const delay = reconnectDelayMs(attempt, opts);
39466
+ deps.log(
39467
+ `slack-channel: Socket Mode reconnecting in ${delay}ms (attempt ${attempt}, ${reason})`
39468
+ );
39469
+ const timer = setTimer(() => {
39470
+ pending = false;
39471
+ if (deps.shouldStop()) return;
39472
+ deps.connect();
39473
+ }, delay);
39474
+ timer.unref?.();
39475
+ },
39476
+ noteOpen() {
39477
+ attempt = 0;
39478
+ downSince = null;
39479
+ },
39480
+ downForMs(connected) {
39481
+ if (connected) return null;
39482
+ return downSince === null ? null : now() - downSince;
39483
+ },
39484
+ attempts: () => attempt,
39485
+ isPending: () => pending
39486
+ };
39487
+ }
39488
+
39397
39489
  // src/turn-initiator-marker.ts
39398
39490
  import { writeFileSync as writeFileSync7, readFileSync as readFileSync9, mkdirSync as mkdirSync5, renameSync as renameSync2 } from "fs";
39399
39491
  import { dirname as dirname4, join as join12 } from "path";
@@ -43163,10 +43255,12 @@ function formatLastActivity() {
43163
43255
  return `${kindLabel} ${ago}`;
43164
43256
  }
43165
43257
  function buildAgentStatusReply(codeName) {
43166
- const connected = currentWs != null && !isShuttingDown;
43258
+ const connected = isSocketConnected();
43167
43259
  const dot = connected ? "\u{1F7E2}" : "\u{1F534}";
43168
43260
  const state = connected ? "online" : "offline";
43169
- const connectivityLine = `${dot} *${state}* \u2014 Socket Mode ${connected ? "connected" : "disconnected"}. Last activity: ${formatLastActivity()}.`;
43261
+ const downMs = socketDownForMs();
43262
+ const downSuffix = !connected && downMs !== null ? ` for ${Math.floor(downMs / 6e4)}m \u2014 inbound is dead` : "";
43263
+ const connectivityLine = `${dot} *${state}* \u2014 Socket Mode ${connected ? "connected" : `disconnected${downSuffix}`}. Last activity: ${formatLastActivity()}.`;
43170
43264
  const sessionState = readAgentSessionState(SLACK_AGENT_DIR);
43171
43265
  return buildAgentConfigReport({ codeName, connectivityLine, state: sessionState });
43172
43266
  }
@@ -43177,9 +43271,16 @@ function statusRuntimeConfig() {
43177
43271
  }
43178
43272
  async function computeSlackOwnChannelLiveStatus() {
43179
43273
  const checked_at = (/* @__PURE__ */ new Date()).toISOString();
43180
- const connected = currentWs != null && !isShuttingDown;
43274
+ const connected = isSocketConnected();
43181
43275
  if (!connected) {
43182
- return { level: "down", checked_at, reason: "Socket Mode disconnected" };
43276
+ const downMs = socketDownForMs();
43277
+ const forSuffix = downMs === null ? "" : ` for ${Math.floor(downMs / 1e3)}s`;
43278
+ const sustained = downMs !== null && downMs >= SOCKET_DOWN_ALERT_AFTER_MS;
43279
+ return {
43280
+ level: "down",
43281
+ checked_at,
43282
+ reason: `Socket Mode disconnected${forSuffix}${sustained ? " - inbound Slack is DEAD (outbound still works, so this is invisible from outside)" : ""}`
43283
+ };
43183
43284
  }
43184
43285
  const { id, authFailed } = await getBotUserId();
43185
43286
  if (id) {
@@ -43706,7 +43807,7 @@ async function handleSlashCommandEnvelope(payload) {
43706
43807
  );
43707
43808
  return;
43708
43809
  }
43709
- const connected = currentWs != null && !isShuttingDown;
43810
+ const connected = isSocketConnected();
43710
43811
  const dot = connected ? "\u{1F7E2}" : "\u{1F534}";
43711
43812
  const state = connected ? "online" : "offline";
43712
43813
  const pong = `${dot} pong - \`${codeName}\` is ${state} (manager \u2022 ${(/* @__PURE__ */ new Date()).toISOString()}). Last activity: ${formatLastActivity()}.`;
@@ -45778,6 +45879,47 @@ async function resolveUserEmail(userId) {
45778
45879
  }
45779
45880
  var currentWs = null;
45780
45881
  var isShuttingDown = false;
45882
+ var clearOpenWatchdog = null;
45883
+ function clearOpenWatchdogFor(ws) {
45884
+ if (currentWs !== ws) return;
45885
+ clearOpenWatchdog?.();
45886
+ clearOpenWatchdog = null;
45887
+ }
45888
+ var reconnectScheduler = createReconnectScheduler({
45889
+ connect: () => connectSocketModeSafely(),
45890
+ log: (line) => process.stderr.write(`${line}
45891
+ `),
45892
+ shouldStop: () => isShuttingDown
45893
+ });
45894
+ function isSocketConnected() {
45895
+ return !isShuttingDown && isWebSocketOpen(currentWs);
45896
+ }
45897
+ function scheduleReconnect(reason) {
45898
+ reconnectScheduler.schedule(reason);
45899
+ }
45900
+ function armOpenWatchdog(ws) {
45901
+ clearOpenWatchdog?.();
45902
+ const timer = setTimeout(() => {
45903
+ if (currentWs !== ws) return;
45904
+ if (isShuttingDown || isWebSocketOpen(ws)) return;
45905
+ process.stderr.write(
45906
+ `slack-channel: Socket Mode did not open within ${SOCKET_OPEN_TIMEOUT_MS}ms - abandoning it
45907
+ `
45908
+ );
45909
+ currentWs = null;
45910
+ clearOpenWatchdog = null;
45911
+ try {
45912
+ ws.close();
45913
+ } catch {
45914
+ }
45915
+ scheduleReconnect("open timeout");
45916
+ }, SOCKET_OPEN_TIMEOUT_MS);
45917
+ timer.unref?.();
45918
+ clearOpenWatchdog = () => clearTimeout(timer);
45919
+ }
45920
+ function socketDownForMs() {
45921
+ return reconnectScheduler.downForMs(isSocketConnected());
45922
+ }
45781
45923
  var acquiredLockPath = null;
45782
45924
  var stopLockHeartbeat = null;
45783
45925
  async function seedMutedChannelsFromApi() {
@@ -45828,14 +45970,27 @@ async function connectSocketMode() {
45828
45970
  if (isShuttingDown) return;
45829
45971
  const res = await fetch("https://slack.com/api/apps.connections.open", {
45830
45972
  method: "POST",
45831
- headers: { Authorization: `Bearer ${APP_TOKEN}` }
45973
+ headers: { Authorization: `Bearer ${APP_TOKEN}` },
45974
+ // CodeRabbit, #4655. Without a deadline a hanging fetch is the one failure
45975
+ // this whole change does not cover: it never rejects, so the retry chain is
45976
+ // never entered, and no socket exists yet so the open watchdog does not
45977
+ // apply either. The process ends up with nothing pending and no attempt in
45978
+ // flight — the incident's shape, reached a different way. A timeout turns
45979
+ // the hang into a rejection, which the retry chain already handles.
45980
+ signal: AbortSignal.timeout(CONNECT_FETCH_TIMEOUT_MS)
45981
+ // CodeRabbit, #4655. Without a deadline a hanging fetch is the one failure
45982
+ // this whole change does not cover: it never rejects, so the retry chain is
45983
+ // never entered, and no socket exists yet so the open watchdog does not
45984
+ // apply either. The process ends up with nothing pending and no attempt in
45985
+ // flight — the incident's shape, reached a different way. A timeout turns
45986
+ // the hang into a rejection, which the retry chain already handles.
45832
45987
  });
45833
45988
  const data = await res.json();
45834
45989
  if (isShuttingDown) return;
45835
45990
  if (!data.ok || !data.url) {
45836
45991
  process.stderr.write(`slack-channel: Socket Mode connection failed: ${data.error}
45837
45992
  `);
45838
- if (!isShuttingDown) setTimeout(connectSocketModeSafely, 1e4).unref?.();
45993
+ scheduleReconnect(`apps.connections.open ${data.error ?? "failed"}`);
45839
45994
  return;
45840
45995
  }
45841
45996
  const ws = new WebSocket(data.url);
@@ -45847,7 +46002,17 @@ async function connectSocketMode() {
45847
46002
  return;
45848
46003
  }
45849
46004
  currentWs = ws;
46005
+ armOpenWatchdog(ws);
45850
46006
  ws.onopen = () => {
46007
+ if (currentWs !== ws) {
46008
+ try {
46009
+ ws.close();
46010
+ } catch {
46011
+ }
46012
+ return;
46013
+ }
46014
+ clearOpenWatchdogFor(ws);
46015
+ reconnectScheduler.noteOpen();
45851
46016
  process.stderr.write("slack-channel: Socket Mode connected\n");
45852
46017
  recordActivity("connect");
45853
46018
  void setBotStatus(":large_green_circle:", "Active");
@@ -46493,15 +46658,35 @@ async function connectSocketMode() {
46493
46658
  `);
46494
46659
  }
46495
46660
  };
46496
- ws.onclose = () => {
46497
- if (currentWs === ws) currentWs = null;
46661
+ ws.onclose = (evt) => {
46662
+ if (currentWs !== ws) return;
46663
+ clearOpenWatchdogFor(ws);
46664
+ currentWs = null;
46498
46665
  if (isShuttingDown) return;
46499
- process.stderr.write("slack-channel: Socket Mode disconnected, reconnecting...\n");
46500
- setTimeout(connectSocketModeSafely, 5e3).unref?.();
46666
+ process.stderr.write(
46667
+ `slack-channel: Socket Mode disconnected (${describeWebSocketError(evt)})
46668
+ `
46669
+ );
46670
+ scheduleReconnect("close");
46501
46671
  };
46502
46672
  ws.onerror = (err) => {
46503
- process.stderr.write(`slack-channel: WebSocket error: ${err}
46673
+ process.stderr.write(`slack-channel: WebSocket error: ${describeWebSocketError(err)}
46504
46674
  `);
46675
+ if (currentWs !== ws) {
46676
+ try {
46677
+ ws.close();
46678
+ } catch {
46679
+ }
46680
+ return;
46681
+ }
46682
+ clearOpenWatchdogFor(ws);
46683
+ currentWs = null;
46684
+ try {
46685
+ ws.close();
46686
+ } catch {
46687
+ }
46688
+ if (isShuttingDown) return;
46689
+ scheduleReconnect("error");
46505
46690
  };
46506
46691
  }
46507
46692
  function shutdown(reason, exitCode = 0) {
@@ -34476,7 +34476,14 @@ var AGENT_DIRECTED_NOTICE_KINDS = [
34476
34476
  // written for the machine. The user learns the same fact from the connect card
34477
34477
  // in that conversation flipping to its connected state, so showing this row as
34478
34478
  // well would say it twice, the second time in prose aimed at an agent.
34479
- "integration_connected"
34479
+ "integration_connected",
34480
+ // ENG-8745. The offer RESULT receipt (not the offer card — that one is
34481
+ // written for the human and is how they decided). Its content opens "Your
34482
+ // offer was ACCEPTED", carries an `[offer_result]` machine tag, and closes by
34483
+ // instructing the agent what not to do ("do not re-raise it yourself"). The
34484
+ // human needs none of it: they are the person who tapped the button, and the
34485
+ // card swapped under their finger to say so.
34486
+ "offer_result"
34480
34487
  ];
34481
34488
  var AGENT_DIRECTED_KIND_SET = new Set(AGENT_DIRECTED_NOTICE_KINDS);
34482
34489
 
@@ -43,8 +43,8 @@ import {
43
43
  writeDirectChatSessionState,
44
44
  writeEgressAllowlist,
45
45
  writePersistentClaudeWrapper
46
- } from "./chunk-DJP4JZGE.js";
47
- import "./chunk-RQAAW5LL.js";
46
+ } from "./chunk-JRL7754L.js";
47
+ import "./chunk-ZQXXK7JC.js";
48
48
  import "./chunk-XWVM4KPK.js";
49
49
  export {
50
50
  EGRESS_BASELINE_DOMAINS,
@@ -92,4 +92,4 @@ export {
92
92
  writeEgressAllowlist,
93
93
  writePersistentClaudeWrapper
94
94
  };
95
- //# sourceMappingURL=persistent-session-KO24RZN7.js.map
95
+ //# sourceMappingURL=persistent-session-U7PE7ZDB.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  paneLogPath
3
- } from "./chunk-DJP4JZGE.js";
4
- import "./chunk-RQAAW5LL.js";
3
+ } from "./chunk-JRL7754L.js";
4
+ import "./chunk-ZQXXK7JC.js";
5
5
  import "./chunk-XWVM4KPK.js";
6
6
 
7
7
  // src/lib/responsiveness-probe.ts
@@ -710,4 +710,4 @@ export {
710
710
  readAndResetSlackReplyBindingClassifications,
711
711
  readAndResetSlackReplyTargetClassifications
712
712
  };
713
- //# sourceMappingURL=responsiveness-probe-V4O7DXYV.js.map
713
+ //# sourceMappingURL=responsiveness-probe-K6DGNTXA.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  sessionTranscriptDir
3
- } from "./chunk-RQAAW5LL.js";
3
+ } from "./chunk-ZQXXK7JC.js";
4
4
 
5
5
  // src/lib/session-auth-dead.ts
6
6
  import { closeSync, openSync, readSync, readdirSync, statSync } from "fs";
@@ -203,4 +203,4 @@ export {
203
203
  decideSessionAuthState,
204
204
  probeSessionAuth
205
205
  };
206
- //# sourceMappingURL=session-auth-dead-S7WK33WO.js.map
206
+ //# sourceMappingURL=session-auth-dead-RPMWBVBH.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.28.612",
3
+ "version": "0.28.613",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {