diff --git a/plugins/platforms/slack/adapter.py b/plugins/platforms/slack/adapter.py index 36708eb28d0c..57b09273da31 100644 --- a/plugins/platforms/slack/adapter.py +++ b/plugins/platforms/slack/adapter.py @@ -4088,7 +4088,7 @@ class SlackAdapter(BasePlatformAdapter): team_id=team_id, strip_bot_mention=False, ) - if f"<@{bot_uid}>" in parent_text: + if parent_text and f"<@{bot_uid}>" in parent_text: # Remember the thread so later replies skip the fetch. if not self._slack_strict_mention(): self._register_mentioned_thread(event_thread_ts) diff --git a/tests/gateway/test_slack.py b/tests/gateway/test_slack.py index f459157e2991..4f91bcf428b1 100644 --- a/tests/gateway/test_slack.py +++ b/tests/gateway/test_slack.py @@ -4024,8 +4024,6 @@ class TestThreadReplyHandling: a._bot_user_id = "U_BOT" a._team_bot_user_ids = {"T_TEAM": "U_BOT"} a._running = True - a._fetch_thread_parent_text = AsyncMock(return_value=None) - a._fetch_thread_context = AsyncMock(return_value="") a.handle_message = AsyncMock() a.set_session_store(mock_session_store) return a @@ -4410,8 +4408,6 @@ class TestAssistantThreadLifecycle: a._bot_user_id = "U_BOT" a._team_bot_user_ids = {"T_TEAM": "U_BOT"} a._running = True - a._fetch_thread_parent_text = AsyncMock(return_value=None) - a._fetch_thread_context = AsyncMock(return_value="") a.handle_message = AsyncMock() a.set_session_store(mock_session_store) return a