Skip to content

fix(acp): stop SubscribeMode::All from subscribing to every event kind - #4974

Open
BradGroux wants to merge 2 commits into
block:mainfrom
BradGroux:fix/acp-subscribe-all-kinds
Open

fix(acp): stop SubscribeMode::All from subscribing to every event kind#4974
BradGroux wants to merge 2 commits into
block:mainfrom
BradGroux:fix/acp-subscribe-all-kinds

Conversation

@BradGroux

@BradGroux BradGroux commented Aug 5, 2026

Copy link
Copy Markdown

What users saw

With BUZZ_ACP_SUBSCRIBE=all, typing indicators (kind 20002) could open agent turns even though the user had not sent a message. Those empty ephemeral events consumed work and could cancel a pending scheduled wakeup before the actual message arrived.

Why it happened

SubscribeMode::Mentions defaults to an explicit kind list: stream messages (9), workflow approval requests (46010), and reminders (40007).

SubscribeMode::All left the kind list empty when BUZZ_ACP_KINDS was unset. Empty means wildcard in both the relay filter and the in-process subscription rule, so all expanded from all relevant messages to all event kinds.

What changed

Added one default_subscription_kinds helper and use it everywhere the default subscription is constructed:

  • initial relay channel filters
  • dynamically discovered channel filters
  • the in-process SubscriptionRule for both mentions and all

All now means the same bounded event kinds as Mentions, without the mention requirement. Operators can still supply a custom list with BUZZ_ACP_KINDS.

How this was tested

Updated the initial-filter regression test and added dynamic-filter coverage. The assertions compare the exact default list and confirm that require_mention is false. Existing runtime-rule tests cover construction of the in-process rules.

Validation at 3aeeb443a:

./bin/cargo fmt --all -- --check
env -u BUZZ_ACP_LAZY_POOL cargo test -p buzz-acp --lib
cargo clippy -p buzz-acp --all-targets -- -D warnings

All 674 buzz-acp library tests passed, and formatting and strict Clippy checks completed successfully. The test command removes an ambient lazy-pool override because that variable intentionally changes the default-config tests.

Scope and non-goals

  • Does not change SubscribeMode::Config.
  • Does not remove or reinterpret an explicit BUZZ_ACP_KINDS override.
  • Does not change reply threading for ephemeral events.

Closes #4949.

SubscribeMode::All built ChannelFilter with kinds: config.kinds_override.clone(),
which is None when BUZZ_ACP_KINDS is not set. The relay treats None as a
wildcard, so typing indicators (kind 20002) and other ephemeral kinds opened
agent turns and cancelled pending scheduled wakeups — every keystroke burned
quota without the user ever sending a message.

All should mean the same message kinds as Mentions (9, 40007, 46010) without
the mention requirement, not all event kinds. Apply the same
unwrap_or_else default in both resolve_channel_filters and
resolve_dynamic_channel_filter.

Update the test that asserted the old wildcard behavior and add a regression
test for the dynamic filter path.

Refs block#4949

Co-authored-by: Brad Groux <bradgroux@hotmail.com>
Signed-off-by: Brad Groux <bradgroux@hotmail.com>
Signed-off-by: npub17q2gdupkvswvk5kprwc7plergm4gn295uw6fe4mjyjv53ahuhtnq02jd3f <f01486f036641ccb52c11bb1e0ff2346ea89a8b4e3b49cd772249948f6fcbae6@digitalmeld.communities.buzz.xyz>
@BradGroux
BradGroux requested a review from a team as a code owner August 5, 2026 22:43
Reuse one bounded default for initial and dynamic relay filters and runtime rule matching so typing indicators cannot reach the turn matcher through an inconsistent wildcard rule.

Co-authored-by: Brad Groux <bradgroux@hotmail.com>
Signed-off-by: Brad Groux <bradgroux@hotmail.com>
Signed-off-by: Brad Groux <3053586+BradGroux@users.noreply.github.com>
@BradGroux

Copy link
Copy Markdown
Author

Review found a second wildcard seam beyond the relay filters: the in-process SubscriptionRule for SubscribeMode::All still used an empty kind list, which also means all kinds. I pushed 3aeeb443a so initial filters, dynamic filters, and runtime rules all use one shared bounded default.

At that head, rustfmt, all 674 buzz-acp library tests, and strict Clippy pass. The package test was run without an ambient BUZZ_ACP_LAZY_POOL override because that setting intentionally changes default-config behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

buzz-acp: SubscribeMode::All subscribes to every event kind — typing indicators (kind:20002) open agent turns and cancel pending wakeups

1 participant