From 9ec2a470f9ee2a24484bc57d542f87814b4036e1 Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Sun, 7 Jun 2026 07:10:09 -0700 Subject: [PATCH] test(discord): fix component-auth expectations after fail-closed change (#f6f363662) Pre-existing main breakage inherited via rebase, not slack-migration fallout: f6f363662 made discord component-button auth fail closed when no allowlist is set but only updated test_discord_component_auth.py. test_discord_model_picker and two test_discord_clarify_buttons tests drove the authorized-proceed path with an empty allowlist, which now correctly rejects. Give the interacting user an allowlist entry so the proceed path runs (dedicated *_unauthorized_* tests still cover rejection). Same fix as #41284; both PRs un-break main's currently-red CI. --- tests/gateway/test_discord_clarify_buttons.py | 4 ++-- tests/gateway/test_discord_model_picker.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/gateway/test_discord_clarify_buttons.py b/tests/gateway/test_discord_clarify_buttons.py index d2157f2eb9b3..95c5bb5cc630 100644 --- a/tests/gateway/test_discord_clarify_buttons.py +++ b/tests/gateway/test_discord_clarify_buttons.py @@ -174,7 +174,7 @@ class TestClarifyChoiceResolve: view = ClarifyChoiceView( choices=["alpha"], clarify_id="cidGone", - allowed_user_ids=set(), + allowed_user_ids={"42"}, ) interaction = _make_interaction() # Doesn't raise; resolve_gateway_clarify returns False quietly @@ -245,7 +245,7 @@ class TestClarifyOtherButton: view = ClarifyChoiceView( choices=["x", "y"], clarify_id="cidD", - allowed_user_ids=set(), + allowed_user_ids={"42"}, ) interaction = _make_interaction() diff --git a/tests/gateway/test_discord_model_picker.py b/tests/gateway/test_discord_model_picker.py index 2ee4e86a38de..2720e34811c6 100644 --- a/tests/gateway/test_discord_model_picker.py +++ b/tests/gateway/test_discord_model_picker.py @@ -54,7 +54,7 @@ async def test_model_picker_clears_controls_before_running_switch_callback(): current_provider="copilot", session_key="session-1", on_model_selected=on_model_selected, - allowed_user_ids=set(), + allowed_user_ids={"123"}, ) view._selected_provider = "copilot"