feat(signal): add require_mention filter for group chats (#28278)#28574
Merged
Conversation
Add a configurable mention filter to the Signal adapter so the bot
only responds in groups when it is explicitly @mentioned.
Changes:
- gateway/platforms/signal.py: read require_mention from adapter
extra config or SIGNAL_REQUIRE_MENTION env var; skip group messages
that don't mention the bot account (checked in rendered text and
raw mention metadata)
- gateway/config.py: map signal.require_mention YAML key to the
SIGNAL_REQUIRE_MENTION env var (env var takes precedence)
Config example:
signal:
require_mention: true
Or via env var:
SIGNAL_REQUIRE_MENTION=true
Contributor
🔎 Lint report:
|
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.
Salvage of #28278 by @jdelmerico.
What: Adds opt-in
require_mentionfilter for Signal group chats — when enabled, the bot only processes group messages that @mention its account. Mirrors the Matrix/Discord/Telegram require_mention behavior.How:
gateway/config.pybridgessignal.require_mentionfrom YAML to theSIGNAL_REQUIRE_MENTIONenv var (env-var precedence preserved).gateway/platforms/signal.pyreads fromconfig.extrafirst, then env var._handle_envelopechecks both rendered mention text and rawmentionsmetadata against the bot's normalized account ID, and bails early with a debug log when the bot isn't mentioned.Original PR: #28278