← Back to PRs

#14995: fix(mattermost): honor chatmode mention fallback in group mention gating

by ninjaa open 2026-02-12 21:07 View on GitHub →
channel: mattermost size: S
## Example: Before vs Now ### Bad (before this fix) This looked correct, but still behaved mention-only in group channels: ```json5 { channels: { mattermost: { chatmode: "onmessage", groupPolicy: "open" } } } ``` Result before fix: untagged group messages were often ignored unless `@hal` was present. ### Good now (after this fix) This now works as expected: ```json5 { channels: { mattermost: { chatmode: "onmessage", groupPolicy: "open" } } } ``` Result after fix: untagged group messages are processed. ## Group Admission Truth Table (`groupPolicy`) | `groupPolicy` | `groupAllowFrom` | Group message admitted? | | --- | --- | --- | | `open` | any | yes (all senders) | | `allowlist` | empty/unset | no | | `allowlist` | populated | yes only for listed senders | | `disabled` | any | no | ## Mention Behavior Truth Table | `chatmode` | `groups."*".requireMention` | Effective mention behavior in groups | | --- | --- | --- | | unset | unset | mention required | | `oncall` | unset | mention required | | `onmessage` | unset | mention not required | | `onchar` | unset | mention required unless trigger prefix is used | | any | `true` | mention required | | any | `false` | mention not required | ## Summary - pass Mattermost account-level mention preference (`chatmode` -> `requireMention`) into group mention resolution - keep per-group overrides authoritative by using `overrideOrder: "after-config"` - add regression tests for direct-chat bypass and group fallback behavior ## Why `chatmode: "onmessage"` could still behave mention-only when mention gating was resolved through the generic group policy path without the account fallback. ## Testing - `pnpm exec vitest run extensions/mattermost/src/mattermost/monitor.require-mention.test.ts extensions/mattermost/src/channel.test.ts`

Most Similar PRs