You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thread replies to bot messages in MS Teams channels do not trigger implicit mention detection, even though the Groups documentation states:
"Replying to a bot message counts as an implicit mention (when the channel supports reply metadata)."
The current implementation at extensions/msteams/src/monitor-handler/message-handler.ts:680-682 relies solely on activity.replyToId to detect implicit mentions:
replyToId is unreliable — Teams doesn't consistently include it for thread replies
conversation.id thread signal is discarded — Teams encodes the thread root message ID as ;messageid=XXX in conversation.id for thread replies, and the plugin already parses this via extractMSTeamsConversationMessageId() in inbound.ts:13-20, but it's not used for implicit mention detection
Sent-message cache is in-memory only — lost on process restart, breaking implicit mention until the bot sends new messages
Proposed Fix
Use conversation.id's ;messageid= suffix as a fallback when replyToId is absent or invalid. The function extractMSTeamsConversationMessageId() already exists and extracts this ID — it just needs to be wired into the implicit mention check:
This is a 7-line change (5 insertions, 2 modifications) with no new dependencies.
How conversation.id thread detection works
// Top-level channel post (no thread):
"conversation": { "id": "19:abc@thread.tacv2" }
// Thread reply (messageid = root message of the thread):
"conversation": { "id": "19:abc@thread.tacv2;messageid=1481567603816" }
If ;messageid= is present → it's a thread reply. The root message ID can be looked up in the existing sent-message cache.
Comparison with Other Plugins
Discord (message-handler.preflight.ts:609-614): Stateless detection via message.referencedMessage.author.id === botId — Discord provides the replied-to message's author in the payload
Telegram: Has had implicit mention fixes (e.g., forum system message exclusion) showing the pattern is actively maintained
The msteams plugin is the only one where implicit mention silently fails due to platform metadata unreliability.
Steps to Reproduce
Configure msteams channel with requireMention: true (the default)
@mention the bot in a Teams channel — bot responds in thread
Reply to the bot's message in the thread without @mentioning it
Expected: Bot detects implicit mention and responds
Actual: Bot ignores the reply (logged as "skipping message (mention required)")
Additional Context
Sent-message cache (sent-message-cache.ts): In-memory Map with 24h TTL, lost on restart. A separate enhancement to persist this cache would further improve reliability.
Proactive messages sent via send.ts are never recorded in the cache, so replies to proactive bot messages also won't trigger implicit mention (separate issue).
Description
Thread replies to bot messages in MS Teams channels do not trigger implicit mention detection, even though the Groups documentation states:
The current implementation at
extensions/msteams/src/monitor-handler/message-handler.ts:680-682relies solely onactivity.replyToIdto detect implicit mentions:However, Microsoft Teams does not reliably send
replyToIdfor thread replies:null"0"This is a confirmed platform limitation documented in MicrosoftDocs/msteams-docs#4530 and Microsoft Q&A.
Root Cause
Three compounding issues:
replyToIdis unreliable — Teams doesn't consistently include it for thread repliesconversation.idthread signal is discarded — Teams encodes the thread root message ID as;messageid=XXXinconversation.idfor thread replies, and the plugin already parses this viaextractMSTeamsConversationMessageId()ininbound.ts:13-20, but it's not used for implicit mention detectionProposed Fix
Use
conversation.id's;messageid=suffix as a fallback whenreplyToIdis absent or invalid. The functionextractMSTeamsConversationMessageId()already exists and extracts this ID — it just needs to be wired into the implicit mention check:This is a 7-line change (5 insertions, 2 modifications) with no new dependencies.
How
conversation.idthread detection worksIf
;messageid=is present → it's a thread reply. The root message ID can be looked up in the existing sent-message cache.Comparison with Other Plugins
message-handler.preflight.ts:609-614): Stateless detection viamessage.referencedMessage.author.id === botId— Discord provides the replied-to message's author in the payloadThe msteams plugin is the only one where implicit mention silently fails due to platform metadata unreliability.
Steps to Reproduce
requireMention: true(the default)Additional Context
sent-message-cache.ts): In-memoryMapwith 24h TTL, lost on restart. A separate enhancement to persist this cache would further improve reliability.send.tsare never recorded in the cache, so replies to proactive bot messages also won't trigger implicit mention (separate issue).@openclaw/msteams2026.3.3Related Issues
requireMentionfor Slack (feature request)implicitMentionshould check thread participation, not justparent_user_id(Slack, completed)replyToIdinconsistency between Desktop and MobileReplyToActivitynot threading correctly