Skip to content

RSC ChatMessage.Read.Chat: @mention reaches the bot without the mention entity (mention resolves in Graph but is stripped from the Activity) #14422

Description

@xrkolovos

Summary

With RSC ChatMessage.Read.Chat + ChannelMessage.Read.Group, when a user @mentions our bot in a group chat / channel, the inbound Activity at /api/messages arrives with no mention entity:

  • Activity.Entities = [clientInfo] only; Activity.GetMentions() is empty.
  • The bot's display name is removed from Activity.Text (a leading mention disappears entirely; a trailing/embedded one survives only as plain text).
  • Activity.ChannelData contains only { "tenant": { "id": "..." } }.
  • Exactly one POST /api/messages arrives per mention — there is no separate classic mention-carrying delivery.

So the documented filter Activity.GetMentions().Any(m => m.Mentioned.Id == Activity.Recipient.Id) can never match, and the bot cannot tell it was addressed.

The mention IS valid — it resolves to the bot (verified in Graph)

Fetching the same message from Graph with the bot's own app-only token —
GET /v1.0/chats/{chatId}/messages/{messageId} — returns:

"mentions": [
  { "id": 0, "mentionText": "Egritos Bot",
    "mentioned": { "application": { "id": "<bot-app-id>" } } }
],
"body": {
  "contentType": "html",
  "content": "<p><at id=\"0\">Egritos Bot</at>&nbsp;...</p>"
}

So Graph has both the resolved mentioned.application.id (== the bot's app id) and the <at id="0"> markup — but none of it reaches the Bot Framework Activity.

Expected

Per the RSC docs, an @mention message delivered to the bot should carry the mention entity so GetMentions() returns it (the docs' own filtering sample relies on exactly that).

Actual

The mention entity and <at> markup are stripped from the Activity; GetMentions() is empty and the name is gone from Activity.Text, even though the mention resolves to the bot in Graph.

Environment

  • Microsoft.Agents.Hosting.AspNetCore 1.5.184 (Microsoft 365 Agents SDK, .NET)
  • Single-tenant bot, RSC consented at install
  • Affects both groupChat and channel
  • Reproduced from Windows and Android clients

Question

Is entity-less delivery under RSC expected, or a regression? If the mention entity is not guaranteed in the Activity under RSC, what is the supported way for a bot to detect it was @mentioned in a group chat / channel? (#11106 looks related but was about non-delivery and is resolved; this is specifically about the mention entity being stripped from a delivered message.)

Metadata

Metadata

Assignees

Labels

bugteams-developer-supportQuestion related to extensibility (Bot, ME, Tab) would be marked under this label

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions