From 9829746dfe3d5077f4f076e257505ec7f8feaa65 Mon Sep 17 00:00:00 2001 From: Trevin Chow <517103+tmchow@users.noreply.github.com> Date: Mon, 10 Aug 2026 12:23:21 -0700 Subject: [PATCH] fix(gateway): require explicit route rejection marker --- gateway/run.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gateway/run.py b/gateway/run.py index 15dab4750b..11e6fd7f0f 100644 --- a/gateway/run.py +++ b/gateway/run.py @@ -14841,7 +14841,7 @@ class GatewayRunner(GatewayAuthorizationMixin, GatewayKanbanWatchersMixin, Gatew if ( getattr(getattr(self, "config", None), "multiplex_profiles", False) and not getattr(source, "profile", None) - and not getattr(source, "profile_route_rejected", False) + and getattr(source, "profile_route_rejected", False) is not True ): from gateway.profile_routing import ProfileRouteRejected @@ -14850,7 +14850,10 @@ class GatewayRunner(GatewayAuthorizationMixin, GatewayKanbanWatchersMixin, Gatew except ProfileRouteRejected: source.profile_route_rejected = True - if getattr(source, "profile_route_rejected", False): + # SessionSource owns a strict boolean marker. Require the literal value + # so duck-typed test/internal sources with dynamic attributes are not + # mistaken for an explicit matched-route rejection. + if getattr(source, "profile_route_rejected", False) is True: logger.warning( "Dropping inbound message because its explicit profile route " "targets an unserved profile"