Skip to content

[Bug]: In msteams channel messages, OpenClaw can't access inbound attachments #89594

Description

@cmc099

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

OpenClaw cannot access attachments on inbound Microsoft Teams channel messages (i.e. messages you send to OpenClaw).

Steps to reproduce

  1. Configure msteams OpenClaw plugin and Microsoft infrastructure to allow communication via Microsoft Teams channels
  2. Send a message with an attachment to OpenClaw
  3. Ask OpenClaw to acknowledge the attachment

Expected behavior

OpenClaw should recognize that an attachment is included and be able to take action on it.

Actual behavior

Attachment is not recognized

OpenClaw version

2026.5.27

Operating system

Ubuntu 24.04.4

Install method

npm globaal

Model

grok-4.3

Provider / routing chain

Teams > Azure Bot > OpenClaw

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Documentation for msteams plugin states:

If you need images/files in channels or want to fetch message history, you must enable Microsoft Graph permissions and grant admin consent.

1. In Entra ID (Azure AD) App Registration, add Microsoft Graph Application permissions:
- ChannelMessage.Read.All (channel attachments + history)
- Chat.Read.All or ChatMessage.Read.All (group chats)
2. Grant admin consent for the tenant.
3. Bump the Teams app manifest version, re-upload, and reinstall the app in Teams.
4. Fully quit and relaunch Teams to clear cached app metadata.

After taking these steps, the issue is not resolved.

For content generated by OpenClaw and sent to a Teams user as an attachment, the attached file is saved in a directory named OpenClawShared within the document library of the SharePoint site specified in the openclaw.json config file by channels.msteams.sharePointSiteId. OpenClaw-to-user attachments work as expected with this setting in place. Note that this setting is relevant only for outbound messages.

Attachments sent in the other direction, Teams user-to-OpenClaw, do not work. In this case, attachments are uploaded to the Team associated SharePoint site into a folder matching the name of the Teams channel. This functionality is controlled by Microsoft. The message payload delivered by the Teams framework does not include any reference to the attached image (Microsoft design decision). One caveat applies - if content is pasted into the message, such as an image, that content will be delivered as part of the message payload, allowing OpenClaw to process it.

The consensus on how to handle this situation so that OpenClaw can retrieve attachments is to grant the proper Microsoft Graph permissions to the Azure (or Teams-Managed) bot. OpenClaw can then query MS Graph for each message/reply to get the full message context, including any attachments. OpenClaw currently fails to do this however.

In order to properly query MS Graph, OpenClaw needs to construct a query string consisting of these fields:

/teams/{team-id}/channels/{channel-id}/messages/{message-id}/replies/{reply-id}

It also needs to be able to distinguish between a top-level message and a reply in a thread.

Take this example conversation:
Hi (top-level message from user to bot, id: 1780421017340)
Hello, how are you? (reply 1 from bot to user, id 1780457714560)
Describe the attached image file (reply 2 from user to bot with attachment, id: 1780422288076)

In this case all replies have their own MessageId but share a common parentMessageId. Querying MS Graph for a top-level message can be done like this:

/teams/f7e52f3d-2be8-4cb0-91a5-b709ca51754c/channels/19:[email protected]/messages/1780421017340

While replies have their own MessageId, querying a reply in the same manner will fail:

/teams/f7e52f3d-2be8-4cb0-91a5-b709ca51754c/channels/19:[email protected]/messages/1780422288076

Querying a reply must reference the parent message and use the replies field:

/teams/f7e52f3d-2be8-4cb0-91a5-b709ca51754c/channels/19:[email protected]/messages/1780421017340/replies/1780422288076

It appears that OpenClaw is only aware of the MessageId and not the parentMessageId. When asked, in a Teams channel, to reply with the runtime context JSON for a specific message, it responded with:

{
  "chat_id": "conversation:19:[email protected]",
  "message_id": "1780422288076",
  "sender_id": "6c76d122-e248-4709-9785-7c1a19c56cd9",
  "conversation_label": "channel",
  "sender": "Chris McFarling",
  "timestamp": "Tue 2026-06-02 13:44 EDT",
  "group_subject": "channel",
  "group_space": "19:[email protected]",
  "inbound_event_kind": "user_request",
  "is_group_chat": true,
  "was_mentioned": true
}

But even if asking OpenClaw to access an attachment in a top-level message, where the parentMessageId is not required for the MS Graph query, OpenClaw fails to query MS Graph.

Impact and severity

Affected: Microsoft Teams users
Severity: Annoying, blocks workflow
Frequency: Always
Consequence: Inefficient use of resources, requires workaround

Additional information

*EDIT: Adding a video demo explaining the issue in more detail.

https://innercoreit-my.sharepoint.com/:v:/p/chris_mcfarling/IQDTX7ZtNUnfQ7iyeTLke3f5AZHn_K4OZVVssPMEK6fBPKU?nav=eyJyZWZlcnJhbEluZm8iOnsicmVmZXJyYWxBcHAiOiJPbmVEcml2ZUZvckJ1c2luZXNzIiwicmVmZXJyYWxBcHBQbGF0Zm9ybSI6IldlYiIsInJlZmVycmFsTW9kZSI6InZpZXciLCJyZWZlcnJhbFZpZXciOiJNeUZpbGVzTGlua0NvcHkifX0&e=BDj0s5

Ultimately, OpenClaw must query a message in MS Graph to determine if an attachment is included. Since it has no way to know which messages have an attachment without a MS Graph query, it would have to query every message, which is not ideal. The best way to handle this would probably be a new setting to enable MS Graph queries per channel, with the default set to off.

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.bugSomething isn't workingbug:behaviorIncorrect behavior without a crashclawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions