Skip to content

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

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#6646
BradGroux wants to merge 2 commits into
block:mainfrom
BradGroux:fix/acp-subscribe-all-kinds

Conversation

@BradGroux

Copy link
Copy Markdown
Contributor

Note: This is a replacement for PR #4974, which was accidentally closed when branches were force-pushed after a commit identity rewrite. The changes are identical, rebased onto the latest main.

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.

@BradGroux

Copy link
Copy Markdown
Contributor Author

This is a replacement for #4974, which was accidentally closed when branches were force-pushed after a commit identity rewrite. Prior review comments and feedback are preserved on the old PR:

#4974

BradGroux and others added 2 commits August 25, 2026 14:15
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>
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
BradGroux force-pushed the fix/acp-subscribe-all-kinds branch from 9bc5730 to 192d403 Compare August 25, 2026 19:16
@BradGroux

Copy link
Copy Markdown
Contributor Author

Rebased onto the latest main (was 36 commits behind). Both commits applied cleanly. SubscribeMode::All still leaves the default kind list empty when BUZZ_ACP_KINDS is unset, causing it to subscribe to all event kinds on current main, so this fix is still needed.

No review comments on this PR. CI will verify the build and test gate.

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