From d2085389d6ead4e7cd15a1a1cf1df792a0169ce9 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Wed, 2 Sep 2026 04:36:37 -0700 Subject: [PATCH] fix(slack): route SessionSource/history is_bot through _event_declares_bot_sender The two sibling is_bot computations (SessionSource construction and the thread-history fetch) re-derived bot-ness from bot_id/subtype only, so an api_human_users post would be human at the drop gate but still flagged is_bot downstream. Use the single predicate everywhere. --- plugins/platforms/slack/adapter.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/platforms/slack/adapter.py b/plugins/platforms/slack/adapter.py index 6c42eb9099..cef1f9be75 100644 --- a/plugins/platforms/slack/adapter.py +++ b/plugins/platforms/slack/adapter.py @@ -7078,7 +7078,9 @@ class SlackAdapter(BasePlatformAdapter): # subtype=bot_message with user=None; flag them so the # gateway SLACK_ALLOW_BOTS bypass can authorize them # (they carry no user_id to match against the allowlist). - is_bot=bool(event.get("bot_id")) or event.get("subtype") == "bot_message", + # Same predicate as the drop gate above, so an api_human_users + # post is a plain human here too. + is_bot=self._event_declares_bot_sender(event), ) # Per-channel ephemeral prompt @@ -8213,7 +8215,7 @@ class SlackAdapter(BasePlatformAdapter): skip_for_delta = bool(after_ts and msg_ts and msg_ts <= after_ts) if skip_for_delta and not is_parent: continue - is_bot = bool(msg.get("bot_id")) or msg.get("subtype") == "bot_message" + is_bot = self._event_declares_bot_sender(msg) msg_user = msg.get("user", "") # Identify "our own" bot for this workspace (multi-workspace safe).