-
-
Notifications
You must be signed in to change notification settings - Fork 69.5k
Bug Report: MSTeams message tool - DM image delivery fails + user target routing broken #18693
Copy link
Copy link
Closed
Description
Summary
Two related issues with the MSTeams message tool for DM (personal) conversations:
target=user:<aadObjectId>always returns403 BotNotInConversationRostereven when the bot has an active, stored conversation reference for that user.target=conversation:<convId>delivers text but silently drops image attachments (buffer/mediaparams) - the API returns success but no image arrives.
Both work correctly when calling the Bot Framework API directly (bypassing the message tool).
Environment
- OpenClaw version:
2026.2.9 - Channel:
MSTeams(single-tenant Azure Bot) - OS:
Linux 6.8.0-90-generic (x64) - Node:
v22.22.0
Steps to Reproduce
Issue 1: user: target 403
message(action="send", channel="msteams", target="user:61aaa5bd-...", message="test")Expected: Message delivered to user's DM using stored conversation reference.
Actual: 403 BotNotInConversationRoster - the tool appears to try creating a new conversation instead of reusing the stored reference from msteams-conversations.json.
Issue 2: conversation: target - images silently dropped
message(action="send", channel="msteams",
target="conversation:a:1oXO...",
message="test image",
buffer="data:image/png;base64,iVBOR...")Expected: Message with inline image delivered.
Actual: Tool returns success (messageId present in response), but only text arrives - image is silently dropped. No error in gateway logs.
Working Workaround (Direct Bot Framework API)
Sending directly via Bot Framework REST API works for both text and images:
# Text - works
payload = {"type": "message", "text": "Hello"}
# Image as attachment - works
payload = {
"type": "message",
"text": "Image test",
"attachments": [{
"contentType": "image/png",
"contentUrl": "data:image/png;base64,...",
"name": "image.png"
}]
}
# Adaptive Card with image - works
payload = {
"type": "message",
"attachments": [{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"version": "1.4",
"body": [
{"type": "Image", "url": "data:image/png;base64,..."}
]
}
}]
}
# POST to: {serviceUrl}/v3/conversations/{convId}/activitiesInvestigation Details
msteams-conversations.jsoncontains valid conversation references withconversationType: "personal", correctserviceUrl,tenantId, and recentlastSeenAt.- The user actively messages the bot (conversation is alive).
- The stored conversation ID (
a:1oXO...) works perfectly with direct API calls. - A second, older conversation reference (
19:[email protected]) for the same user returns 403 - possibly stale.
Expected Fix
- Issue 1: When
target=user:<id>is used, the tool should look up existing conversation references inmsteams-conversations.jsonbyaadObjectIdand reuse them, rather than attempting to create a new conversation (which requires the bot to be pre-installed in the user's scope). - Issue 2: When
bufferormediais provided, the tool should include the image as a Bot Framework attachment (contentType: "image/png",contentUrl: "data:image/png;base64,...") in the activity payload, not attempt a separate file upload flow that triggers 403.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.