buzz-acp: agent in a 1:1 DM only wakes on an explicit @mention — plain DM messages are dropped by require_mention
- Dominant language
- Rust
- Stars
- 32.7k
- Forks
- 4.3k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 253
Description
### 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 `target_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 real 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, Buzz Desktop only emits a `#p` tag when the user types an explicit `@mention` — plain DM text has no p-tag, so it's 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 Buzz Desktop auto-p-tag the agent on every DM message, making the 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 side that's inconsistent.
### Related
- #2748 — buzz-acp: DM replies anchor to latest message instead of thread root (adjacent buzz-acp DM behavior)
- #1743 — Agent @mentions silently fail when mentioned agent is offline (adjacent mention-delivery behavior)
Contributor guide
Research direction
Start in crates/buzz-acp/src/config.rs at resolve_channel_filters() and resolve_dynamic_channel_filter(), then trace send_subscribe() in crates/buzz-acp/src/relay.rs and the DM author gate in crates/buzz-acp/src/lib.rs. Reproduce a plain and explicitly mentioned 1:1 DM, then make the subscription deliver both while retaining the owner and verified-sibling author restrictions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 56/100