Skip to content

[MSTeams] Regular messages falsely detected as <media:document> #26599

@JerryTao-AI

Description

@JerryTao-AI

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

  1. Set up OpenClaw with MSTeams channel (Azure Bot Framework webhook)
  2. In a Teams group chat, a user sends a normal text message (possibly containing emoji, rich text formatting, or an adaptive card preview)
  3. 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>";

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions