@integrity-labs/agt-cli 0.28.52 → 0.28.54

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.
@@ -14556,6 +14556,7 @@ function channelSkipReactionEnabled() {
14556
14556
  }
14557
14557
  function decideBusyAck(i) {
14558
14558
  if (!i.hasTarget) return false;
14559
+ if (!i.arrivedWhileBusy) return false;
14559
14560
  if (!i.stillPending) return false;
14560
14561
  if (!Number.isFinite(i.pendingAgeMs)) return false;
14561
14562
  const threshold = i.thresholdMs ?? channelBusyAckThresholdMs();
@@ -16844,8 +16845,9 @@ function postBusyAckNotice(channel, threadTs, isThreadReply) {
16844
16845
  }).catch(() => {
16845
16846
  });
16846
16847
  }
16847
- function scheduleBusyAck(channel, threadTs, messageTs, isThreadReply) {
16848
+ function scheduleBusyAck(channel, threadTs, messageTs, isThreadReply, arrivedWhileBusy) {
16848
16849
  if (!channelBusyAckEnabled()) return;
16850
+ if (!arrivedWhileBusy) return;
16849
16851
  const thresholdMs = channelBusyAckThresholdMs();
16850
16852
  const timer = setTimeout(() => {
16851
16853
  const probe = process.env.TMUX && AGENT_CODE_NAME ? probeAgentSessionCached(AGENT_CODE_NAME) : { tmux: "unknown", claude: "unknown" };
@@ -16861,6 +16863,7 @@ function scheduleBusyAck(channel, threadTs, messageTs, isThreadReply) {
16861
16863
  if (!marker) return;
16862
16864
  const post = decideBusyAck({
16863
16865
  hasTarget: Boolean(channel && messageTs),
16866
+ arrivedWhileBusy,
16864
16867
  stillPending: true,
16865
16868
  pendingAgeMs: Math.max(0, Date.now() - Date.parse(marker.received_at)),
16866
16869
  sessionAlive: probe.tmux === "alive" && probe.claude === "alive",
@@ -19625,8 +19628,9 @@ async function connectSocketMode() {
19625
19628
  if (passedIdentity) recordActivity("inbound");
19626
19629
  if (access.kind === "drop") {
19627
19630
  const channelHash = createHash("sha256").update(evt.channel ?? "").digest("hex").slice(0, 8);
19631
+ const subtypeSuffix = access.reason === "content:subtype" ? ` subtype=${evt.subtype ?? "none"}` : "";
19628
19632
  process.stderr.write(
19629
- `slack-channel: inbound drop reason=${access.reason} channel=${channelHash} ts=${redactSlackId(evt.ts)}
19633
+ `slack-channel: inbound drop reason=${access.reason}${subtypeSuffix} channel=${channelHash} ts=${redactSlackId(evt.ts)}
19630
19634
  `
19631
19635
  );
19632
19636
  if (access.decline !== void 0 && policyBlockReason) {
@@ -19732,10 +19736,26 @@ async function connectSocketMode() {
19732
19736
  }
19733
19737
  if (evt.type === "message" && evt.channel && !isDirectMessage) {
19734
19738
  if (isThreadReply) {
19735
- if (THREAD_AUTO_FOLLOW === "off") return;
19739
+ const logThreadDrop = (reason) => {
19740
+ const channelHash = createHash("sha256").update(evt.channel ?? "").digest("hex").slice(0, 8);
19741
+ process.stderr.write(
19742
+ `slack-channel(${AGENT_CODE_NAME}): thread-reply drop reason=${reason} auto_follow=${THREAD_AUTO_FOLLOW} channel=${channelHash} ts=${redactSlackId(evt.ts)}
19743
+ `
19744
+ );
19745
+ };
19746
+ if (THREAD_AUTO_FOLLOW === "off") {
19747
+ logThreadDrop("auto_follow_off");
19748
+ return;
19749
+ }
19736
19750
  const threadInvolvement = threadKey ? trackedThreads.get(threadKey)?.involvement : void 0;
19737
- if (!threadInvolvement) return;
19738
- if (THREAD_AUTO_FOLLOW === "started" && threadInvolvement !== "started") return;
19751
+ if (!threadInvolvement) {
19752
+ logThreadDrop("thread_not_tracked");
19753
+ return;
19754
+ }
19755
+ if (THREAD_AUTO_FOLLOW === "started" && threadInvolvement !== "started") {
19756
+ logThreadDrop("started_mode_not_started");
19757
+ return;
19758
+ }
19739
19759
  } else {
19740
19760
  if (!channelMessageShouldRespond(evt.text ?? "", CHANNEL_RESPONSE_MODE)) return;
19741
19761
  }
@@ -19804,7 +19824,13 @@ async function connectSocketMode() {
19804
19824
  if (channel && ts && armMarker) {
19805
19825
  trackPendingMessage(channel, threadTs, ts, ackDecision === "undeliverable", !shouldEngage);
19806
19826
  if (ackDecision === "ack" && shouldEngage) {
19807
- scheduleBusyAck(channel, threadTs, ts, isThreadReply);
19827
+ scheduleBusyAck(
19828
+ channel,
19829
+ threadTs,
19830
+ ts,
19831
+ isThreadReply,
19832
+ ackInputs.oldestPendingAgeMs != null
19833
+ );
19808
19834
  }
19809
19835
  }
19810
19836
  const userName = await resolveUserName(user);
@@ -16207,6 +16207,7 @@ function channelSkipReactionEnabled() {
16207
16207
  }
16208
16208
  function decideBusyAck(i) {
16209
16209
  if (!i.hasTarget) return false;
16210
+ if (!i.arrivedWhileBusy) return false;
16210
16211
  if (!i.stillPending) return false;
16211
16212
  if (!Number.isFinite(i.pendingAgeMs)) return false;
16212
16213
  const threshold = i.thresholdMs ?? channelBusyAckThresholdMs();
@@ -16640,8 +16641,9 @@ function postBusyAckNotice(chatId, messageId) {
16640
16641
  }
16641
16642
  })();
16642
16643
  }
16643
- function scheduleBusyAck(chatId, messageId) {
16644
+ function scheduleBusyAck(chatId, messageId, arrivedWhileBusy) {
16644
16645
  if (!channelBusyAckEnabled()) return;
16646
+ if (!arrivedWhileBusy) return;
16645
16647
  const thresholdMs = channelBusyAckThresholdMs();
16646
16648
  const timer = setTimeout(() => {
16647
16649
  const probe = process.env.TMUX && AGENT_CODE_NAME && AGENT_CODE_NAME !== "unknown" ? probeAgentSessionCached(AGENT_CODE_NAME) : { tmux: "unknown", claude: "unknown" };
@@ -16657,6 +16659,7 @@ function scheduleBusyAck(chatId, messageId) {
16657
16659
  if (!marker) return;
16658
16660
  const post = decideBusyAck({
16659
16661
  hasTarget: Boolean(chatId && messageId),
16662
+ arrivedWhileBusy,
16660
16663
  stillPending: true,
16661
16664
  pendingAgeMs: Math.max(0, Date.now() - Date.parse(marker.received_at)),
16662
16665
  sessionAlive: probe.tmux === "alive" && probe.claude === "alive",
@@ -18832,7 +18835,7 @@ async function pollLoop() {
18832
18835
  channelPayload
18833
18836
  );
18834
18837
  if (ackDecision === "ack") {
18835
- scheduleBusyAck(chatId, messageId);
18838
+ scheduleBusyAck(chatId, messageId, ackInputs.oldestPendingAgeMs != null);
18836
18839
  }
18837
18840
  await mcp.notification({
18838
18841
  method: "notifications/claude/channel",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.28.52",
3
+ "version": "0.28.54",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {