#14995: fix(mattermost): honor chatmode mention fallback in group mention gating
channel: mattermost
size: S
Cluster:
Mattermost Mention Overrides Fixes
## 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
#20051: fix(mattermost): fix chatmode: "onmessage" to work correctly in mat...
by RHesketh · 2026-02-18
78.3%
#10587: fix(extensions/mattermost): pass requireMention override from chatm...
by baku4 · 2026-02-06
76.9%
#10081: fix(mattermost): pass requireMentionOverride to core resolver
by manchmod · 2026-02-06
75.1%
#22075: mattermost: honor account requireMention override
by armindocachada · 2026-02-20
73.6%
#16622: fix(mattermost): record pending history for messages dropped by gro...
by oskarmodig · 2026-02-14
72.1%
#19435: fix(slack): properly handle group DM (MPIM) events
by Utkarshbhimte · 2026-02-17
71.4%
#22106: fix(whatsapp): honor selfChatMode override for group mentions
by sportclaw · 2026-02-20
69.5%
#17513: fix(discord): respect groupPolicy in channel config fallback (#4555)
by aronchick · 2026-02-15
69.4%
#18664: fix(imessage): honor groupConfig regardless of allowlistEnabled
by brandonwise · 2026-02-16
69.2%
#12257: fix(mattermost): default table mode to 'off' for native Markdown re...
by mcaxtr · 2026-02-09
68.2%