buzz icon indicating copy to clipboard operation
buzz copied to clipboard

buzz-acp: agent in a 1:1 DM only wakes on an explicit @mention — plain DM messages are dropped by require_mention

Open sonpiaz opened this issue 4 months ago • 0 comments

Summary

An agent in a 1:1 DM does not respond to a message unless the user explicitly @mentions it. Every plain DM line (e.g. "hey", "you there?") is silently filtered out and never reaches the agent, so the human has to re-tag the agent on every turn. This is counter-intuitive: a DM is inherently 1:1 and directed, so every message in it is implicitly "for" the other participant.

Environment

  • buzz-acp harness (managed agent launched via Buzz Desktop), default --subscribe mentions.
  • Reproduced with a Claude Code agent in a 1:1 DM channel.

Repro

  1. Open a 1:1 DM with an agent.
  2. Send a message without @mentioning the agent — e.g. hey.
  3. Agent does not respond.
  4. Send @Agent hey — agent responds.

Expected

In a 1:1 DM, every message from the owner (or a verified same-owner sibling) should wake the agent, no explicit @mention required.

Actual

Only messages that carry a #p tag referencing the agent (i.e. an explicit @mention) wake it. Plain DM text is filtered at the relay subscription level and never delivered.

Root cause (source-level)

The default SubscribeMode::Mentions sets require_mention: true for every channel, with no DM exception:

  • crates/buzz-acp/src/config.rs — resolve_channel_filters() (Mentions branch): let require_mention = !config.no_mention_filter; → true by default, applied to all channels.
  • crates/buzz-acp/src/config.rs — resolve_dynamic_channel_filter() (Mentions branch): same, require_mention: !config.no_mention_filter.
  • crates/buzz-acp/src/relay.rs — send_subscribe(): "#p is included only when filter.require_mention is true." So the NIP-01 REQ for a DM channel carries #p=[agent_pubkey], and the relay only delivers DM events that explicitly p-tag the agent.

Two things make this a gap rather than intended behavior:

  1. The author gate already special-cases DMs; the mention filter does not. crates/buzz-acp/src/lib.rs resolves is_dm_channel() and applies DM-specific author rules (owner + verified siblings only). The subscription/mention filter has no equivalent is_dm branch — DMs are treated exactly like public channels.

  2. The DM-hardening comment assumes an invariant that doesn't hold for plain messages. crates/buzz-acp/src/lib.rs (DM hardening, ~L226) states "Clients auto-p-tag every DM participant." If that held for all DM messages, require_mention: true in a DM would be harmless. In practice, the desktop client only emits a #p tag when the user types an explicit @mention — plain DM text has no p-tag, so it is filtered. The stated invariant and the shipped client behavior disagree.

Proposed fix

Primary (harness-side, mirrors existing DM special-casing): In resolve_channel_filters() / resolve_dynamic_channel_filter(), force require_mention = false when the channel is a DM. This reuses the same is_dm concept the author gate already resolves, and drops the #p filter from the DM subscription so every DM message is delivered. Safety is preserved because the DM author gate (owner/siblings-only) already prevents strangers from waking the agent — so removing the mention requirement in DMs does not widen exposure.

(Plumbing note: filter resolution currently keys off channel UUIDs only; channel-type / is_dm would need to be available at resolution time, as it already is for the author gate.)

Alternative (client-side): Make the desktop client auto-p-tag the agent on every DM message, making the lib.rs L226 invariant actually true. Simpler in the harness, but relies on every client complying; the harness already assumes this, which argues the client is the inconsistent side.

Related

  • #2748 — buzz-acp: DM replies anchor to the latest message instead of the thread root
  • #1743 — Agent @mentions silently fail when mentioned agent is offline

sonpiaz avatar Jul 25 '26 16:07 sonpiaz