From 3ec5a06f4faa18dbf54ca10be7fcfd53a4d7c006 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Thu, 23 Jul 2026 08:28:32 -0700 Subject: [PATCH] test(slack): mark block-privacy fixture message as human-authored (client_msg_id) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #58478's caplog test predates main's unlabeled-bot users.info probe (#69xxx wave-2 gating): events without client_msg_id now hit _resolve_user_is_bot, which the fixture's mock client doesn't wire up (AttributeError on _user_is_bot_cache). Real human-authored Slack messages carry client_msg_id — add it to the fixture so the test exercises the intended block-extraction path. --- tests/gateway/test_slack_mention.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/gateway/test_slack_mention.py b/tests/gateway/test_slack_mention.py index 3faaf7fdd3f2..0461199aa933 100644 --- a/tests/gateway/test_slack_mention.py +++ b/tests/gateway/test_slack_mention.py @@ -7,7 +7,7 @@ Follows the same pattern as test_whatsapp_group_gating.py. import sys import inspect import logging -from unittest.mock import MagicMock +from unittest.mock import AsyncMock, MagicMock import pytest @@ -812,6 +812,12 @@ async def test_block_extraction_debug_log_does_not_include_message_preview(caplo adapter._dedup = MagicMock(is_duplicate=MagicMock(return_value=False)) adapter._lookup_assistant_thread_metadata = MagicMock(return_value={}) adapter._channel_team = {} + adapter._CHANNEL_TEAM_MAX = 10000 + # Wave-2 mention gating probes users.info for bot detection on several + # paths; this fixture has no web client, so pin the sender as human. + adapter._resolve_user_is_bot = AsyncMock(return_value=False) + adapter._resolve_user_name = AsyncMock(return_value="testuser") + adapter.handle_message = AsyncMock() event = { "channel": OTHER_CHANNEL_ID, @@ -819,6 +825,10 @@ async def test_block_extraction_debug_log_does_not_include_message_preview(caplo "ts": "1710000000.000100", "team": "T1", "user": "U_USER", + # Human-authored messages carry client_msg_id; without it the + # unlabeled-bot probe path calls users.info, which this fixture + # doesn't wire up. + "client_msg_id": "cmid-block-priv", "text": "<@U_BOT_123> see quoted message", "blocks": [ {