From 8439ddc1b1e054497ed36bfd405a883268c7e88f Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Mon, 18 May 2026 22:07:43 -0700 Subject: [PATCH] test(telegram): stub _is_callback_user_authorized in trigger-gating fixture After PR #24468 made the empty-allowlist callback auth fail-closed (and #23795 wired _is_callback_user_authorized into _should_process_message), trigger-gating tests started failing because their fake messages from user 111 hit the new deny-by-default path before trigger evaluation. Force-authorize all senders in _make_adapter() so the trigger logic under test runs. The fail-closed behavior itself is covered by test_telegram_callback_auth_fail_closed.py. --- tests/gateway/test_telegram_group_gating.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/gateway/test_telegram_group_gating.py b/tests/gateway/test_telegram_group_gating.py index 282320ad10f..6e9e9edf2e4 100644 --- a/tests/gateway/test_telegram_group_gating.py +++ b/tests/gateway/test_telegram_group_gating.py @@ -44,6 +44,11 @@ def _make_adapter( adapter._pending_text_batch_tasks = {} adapter._text_batch_delay_seconds = 0.01 adapter._mention_patterns = adapter._compile_mention_patterns() + # Trigger-gating tests don't exercise the allowlist gate (added by + # #23795 + #24468). Force-authorize all senders so the trigger logic + # under test runs. Without this, every fake message hits the new + # fail-closed auth path and gets dropped before trigger evaluation. + adapter._is_callback_user_authorized = lambda user_id, **_kw: True return adapter