Repository navigation
Conversation
Fixes pre-existing test-code lints that `cargo clippy --workspace --all-targets -- -D warnings` reports on current stable: literal-bool assert_eq, manual str::repeat, unwrap_or on literal Some/None, get().is_some()/is_none() on maps, an unused cfg(test) helper, and one intentional ENV_LOCK hold across .await (env-serialization in tests).
The tree has drifted from `cargo fmt --all -- --check` under current stable rustfmt (no CI job enforces it). Mechanical `cargo fmt --all` run plus one manual removal of a whitespace-only line in acp_mcp.rs that tripped rustfmt's internal "left behind trailing whitespace" check. No behavior changes.
…a mention (openabdev#1538) With allow_user_messages = "mentions" (or multi-bot threads under multibot-mentions), a message containing only @everyone/@here was silently dropped: is_mentioned only consulted msg.mentions_user_id(), and Discord mass pings populate mention_everyone instead of mentions[]. That made "summon all agents" impossible in multi-bot deployments. New [discord] everyone_mentions_bot bool (default false — unchanged behavior). When true, msg.mention_everyone counts as a mention anywhere a direct @mention is checked: user-message gating, the trusted-bot admission override, ambient-mode mention routing, and the bot-message early gate. The inline mention check is extracted into is_bot_mentioned() (same primitive-parameter convention as detect_thread) and covered by integration tests in crates/openab-core/tests/ — serenity Message values cannot be constructed in unit tests.
Under heavy parallel load (e.g. full workspace `cargo test` on a busy box), child spawn/wait can transiently fail with a non-timeout error before the 1s timeout path is reached — the previous exact-message assertion then flaked (observed in a detached replay run). Retry up to 3 attempts and require at least one to hit the timeout path; a real regression that never reaches the timeout arm still fails.
Contributor
|
Caution This PR is missing a Discord Discussion URL in the body. All PRs must reference a prior Discord discussion to ensure community alignment before implementation. Please edit the PR description to include a link like: |
|
🔒 Auto-closing: this PR has had the If you'd like to continue working on this, please submit a new PR and link to this one if necessary. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1538
Summary
[discord]config booleveryone_mentions_bot(defaultfalse— existing behavior unchanged). Whentrue, a message withmention_everyoneset (@everyone/@heremass ping) counts as a mention of this bot.mention_everyoneinstead of populatingmentions[], so withallow_user_messages = "mentions"a bare@everyonesummon was silently dropped — making "summon all agents" impossible in multi-bot deployments.EventHandler::messageis extracted into a pureis_bot_mentioned()helper (same convention asdetect_thread), so the behavior is unit-testable without constructing serenityMessagevalues. The singleis_mentionedvalue continues to drive user-message gating, the trusted-bot admission override, ambient-mode routing, and the bot-message early gate — mass pings now flow through all of them consistently when the flag is on.cargo fmt/clippy --all-targets/testto pass under the current stable toolchain, per AGENTS.md):style:rustfmt 1.98 normalization sweep,test:fixes for pre-existing clippy--all-targetstest-code lints,test:de-flake ofhooks::tests::run_inline_script_timeout(transient spawn errors under parallel load → bounded retry).Review Contract
Goal
Let an opt-in
[discord]flag make@everyone/@heremass pings count as a bot mention, soallow_user_messages = "mentions"deployments (and multi-bot threads) can use mass pings to wake bots, without changing default behavior.Non-goals
mention_everyonealready arrives on the gateway payload.style:/test:normalization commits are mechanical enablers only — no attempt to refactor or redesign touched code.Accepted Residual Risks
allow_bot_messagesmode (consistent with "mass ping = real mention"); mitigated bytrusted_bot_idsscoping and themax_bot_turnscap. Documented indocs/discord.md.hookstest retry could theoretically mask a regression where the timeout arm is never reached; bounded to 3 attempts and still fails if no attempt produces "timed out".Acceptance Criteria
everyone_mentions_bot = false(default or absent): byte-identical gating to before this PR; verified by tests and byis_bot_mentionedreproducing the original expression.everyone_mentions_bot = true:msg.mention_everyonecounts as mention for user gating, trusted-bot admission, and ambient handling.<@bot_id>mention, raw content fallback, and role mentions unaffected.cargo fmt --all -- --check,cargo test --workspace,cargo clippy --workspace --all-targets -- -D warningsall green.Follow-ups
release.yml/upstream sync may be needed since this PR originates from a fork.Generated with Devin