diff --git a/plugins/platforms/slack/adapter.py b/plugins/platforms/slack/adapter.py index 1a03c2b57f22..90fbcdc7da38 100644 --- a/plugins/platforms/slack/adapter.py +++ b/plugins/platforms/slack/adapter.py @@ -3820,7 +3820,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 cd121c313abf..ac67760f41c3 100644 --- a/tests/gateway/test_slack.py +++ b/tests/gateway/test_slack.py @@ -3538,8 +3538,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 @@ -3924,8 +3922,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