From 543941f70974d5879decdef6aa0f29341001bcad Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Thu, 23 Jul 2026 11:49:19 -0700 Subject: [PATCH] fix(slack): tolerate bare adapter instances in _remember_channel_team ambiguity map The C13 log-noise test (merged while this branch was in flight) builds a bare SlackAdapter without __init__; the new _channel_teams ambiguity map crashed it. getattr-guard, same pattern as the sibling defensive inits. --- plugins/platforms/slack/adapter.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/platforms/slack/adapter.py b/plugins/platforms/slack/adapter.py index 437af04291c..8bc0f159491 100644 --- a/plugins/platforms/slack/adapter.py +++ b/plugins/platforms/slack/adapter.py @@ -1139,7 +1139,13 @@ class SlackAdapter(BasePlatformAdapter): return channel_id = str(channel_id) team_id = str(team_id) - teams = self._channel_teams.setdefault(channel_id, set()) + # getattr: bare adapters built via object.__new__ in tests (and any + # partially-initialized instance) may lack the ambiguity map. + channel_teams = getattr(self, "_channel_teams", None) + if channel_teams is None: + channel_teams = {} + self._channel_teams = channel_teams + teams = channel_teams.setdefault(channel_id, set()) teams.add(team_id) if len(teams) == 1: self._channel_team[channel_id] = team_id