feat(mattermost): configurable mention behavior — respond without @mention#3664
Merged
feat(mattermost): configurable mention behavior — respond without @mention#3664
Conversation
…ntion Adds MATTERMOST_REQUIRE_MENTION and MATTERMOST_FREE_RESPONSE_CHANNELS env vars, matching Discord's existing mention gating pattern. - MATTERMOST_REQUIRE_MENTION=false: respond to all channel messages - MATTERMOST_FREE_RESPONSE_CHANNELS=id1,id2: specific channels where bot responds without @mention even when require_mention is true - DMs always respond regardless of mention settings - @mention is now stripped from message text (clean agent input) 7 new tests for mention gating, free-response channels, DM bypass, and mention stripping. Updated existing test for mention stripping. Docs: updated mattermost.md with Mention Behavior section, environment-variables.md with new vars, config.py with metadata.
|
This is amazing, thank you so much! I am not sure if this is the right place to suggest this, but a minor enhancement would be the following: to be able to specify a list of channels where an @-mention is required. In my use case, most channels are with one agent and I would prefer no mentions required, 'but a couple of them are agent groups where mentions make sense. |
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.
Summary
Adds configurable mention gating for Mattermost channels, matching Discord's existing pattern. Requested by community member neeldhara.
New Environment Variables
MATTERMOST_REQUIRE_MENTIONtruefalseto respond to all channel messages without@mentionMATTERMOST_FREE_RESPONSE_CHANNELS@mentionDMs always work regardless of these settings.
Usage
Also fixes
@mentionis now stripped from the message text before the agent sees it (previously the raw@botnamewas included in the prompt).Files Changed
gateway/platforms/mattermost.pyhermes_cli/config.pytests/gateway/test_mattermost.pywebsite/docs/user-guide/messaging/mattermost.mdwebsite/docs/reference/environment-variables.mdTests
46 Mattermost tests pass (7 new).