-
-
Notifications
You must be signed in to change notification settings - Fork 69.5k
[MSTeams] Regular messages falsely detected as <media:document> #26599
Description
Bug Description
When receiving certain messages in Microsoft Teams group chats, the inbound message parser incorrectly tags them as <media:document> even when no document/file attachment is present.
Steps to Reproduce
- Set up OpenClaw with MSTeams channel (Azure Bot Framework webhook)
- In a Teams group chat, a user sends a normal text message (possibly containing emoji, rich text formatting, or an adaptive card preview)
- The agent receives the message body as
<media:document>
Expected Behavior
The message should be parsed as regular text content, not tagged as a document attachment.
Actual Behavior
The message is presented to the agent as <media:document>, causing the agent to incorrectly respond about a document that doesn't exist.
Environment
- OpenClaw version: 2026.2.9
- Channel: msteams (Azure Bot Framework webhook via ngrok)
- Chat type: group chat
- OS: Ubuntu 22.04.5
Analysis
The media placeholder logic in reply-D-ejYZny.js (compiled) around line 14096 falls through to <media:document> for any attachment that isn't detected as an image. It's possible that Teams messages with certain rich content (emoji reactions, adaptive card previews, quoted messages) include attachment metadata that triggers this fallback path.
Relevant Code Path
// dist/reply-D-ejYZny.js:14093-14096
if (mime.startsWith("image/")) return "<media:image>";
// ...
return "<media:document>";