buzz-acp: --subscribe all wakes a full agent turn for every typing indicator (kind 20002) and reaction (kind 7)
- Dominant language
- Rust
- Stars
- 32.7k
- Forks
- 4.3k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 253
Description
# Draft: buzz-acp: `--subscribe all` wakes a full agent turn for every typing indicator (kind 20002) and reaction (kind 7)
**Component:** buzz-acp (crates/buzz-acp), observed at desktop-v0.5.3
**Severity:** cost/latency — an order of magnitude of wasted agent turns in chatty channels
## Summary
With `BUZZ_ACP_SUBSCRIBE=all` (and no `kinds` override), the relay REQ is emitted without a `kinds` filter (NIP-01 has no negative filter), so ephemeral events flow in — and `filter.rs::match_event` has no kind-class guard: an `all` rule has empty `kinds` (= wildcard), so kind-20002 typing indicators with empty content match, get queued, receive the 👀 reaction, and wake a full agent turn.
Measured on our deployment: one human message preceded by ~85 seconds of typing produced ~20 empty agent turns before the real one.
Notes from reading the crate:
- The harness is a *producer* of 20002/20001/7 but has no inbound consumer for any of them, so they can be dropped pre-wake with no loss.
- Observer control frames (kind 24200, also ephemeral) arrive on a dedicated subscription and are routed before `match_event`, so a kind-class guard there cannot break them.
## Suggested fix (minimal)
At the top of `match_event`: drop `buzz_core::kind::is_ephemeral(kind) || kind == KIND_REACTION` before rule matching. This keeps the wake policy in one module, covers all three subscribe modes, and sits before the queue push and the 👀 side effect (patching later, e.g. in `queue::push`, would still fire the reaction and can interact with in-flight steer signals).
We are running this patch locally and can PR it if you'd take it.
Contributor guide
Assessment
This issue has not been assessed yet.