Skip to content

The agent that grows with you

test(buzz): clarify reaction-only precedence

Cameron Aragon743f86ed36b0
diff --git a/plugins/platforms/buzz/adapter.py b/plugins/platforms/buzz/adapter.py
index f0d2ea9ce4d..114ed9142eb 100644
--- a/plugins/platforms/buzz/adapter.py
+++ b/plugins/platforms/buzz/adapter.py
@@ -624,6 +624,8 @@ class BuzzAdapter(BasePlatformAdapter):
# Verified local-agent identities may acknowledge explicit tags without
# gaining prompt/dispatch authority. This keeps the human allow-list
# intact while providing receipt visibility for agent-authored notes.
+ # If a pubkey appears in both sets, allowed_users takes precedence: the
+ # normal authorized dispatch path runs and this reaction-only path does not.
raw_reaction_only = (
os.getenv("BUZZ_REACTION_ONLY_USERS")
or extra.get("reaction_only_users", [])
diff --git a/tests/gateway/test_buzz_adapter.py b/tests/gateway/test_buzz_adapter.py
index 33010713e6f..d6fb44672ac 100644
--- a/tests/gateway/test_buzz_adapter.py
+++ b/tests/gateway/test_buzz_adapter.py
@@ -774,6 +774,19 @@ class TestMentionGating:
adapter.send_reaction.assert_awaited_once_with(CHANNEL, "e1", "👀")
assert adapter._dispatched == []
+ @pytest.mark.asyncio
+ async def test_allowlist_takes_precedence_over_reaction_only(self, adapter):
+ adapter._allowed_pubkeys = {AGENT_PUBKEY}
+ adapter._reaction_only_pubkeys = {AGENT_PUBKEY}
+ adapter.send_reaction = AsyncMock(return_value=True)
+ event = _event("e1", pubkey=AGENT_PUBKEY, content="@Chip coordinate", created_at=10)
+ event["tags"].append(["p", SELF_PUBKEY])
+
+ await self._poll_with(adapter, event)
+
+ adapter.send_reaction.assert_not_awaited()
+ assert len(adapter._dispatched) == 1
+
@pytest.mark.asyncio
async def test_agent_message_without_explicit_recipient_gets_no_reaction(self, adapter):
adapter._allowed_pubkeys = {OTHER_PUBKEY}