-
-
Notifications
You must be signed in to change notification settings - Fork 69.5k
[msteams] FileConsentCard not updated after user accepts — consent card remains frozen #47268
Description
Bug: FileConsentCard stays in Allow/Deny state after file upload completes
Component: @openclaw/msteams plugin
File: extensions/msteams/src/monitor-handler.ts
Severity: Low (cosmetic — file uploads succeed, but UX is degraded)
Summary
When a bot sends a file via FileConsentCard in a personal (DM) chat, the user clicks "Allow", and the file uploads successfully — but the original consent card remains frozen showing "Allow" and "Deny" buttons. It never transitions to show the completed file download card.
Expected Behavior
Per the Microsoft Teams documentation, after the user accepts and the file is uploaded, the original FileConsentCard should be replaced in-place with a FileInfoCard showing the file name and a download link. The consent buttons should no longer be visible.
Actual Behavior
The FileInfoCard is sent as a new message via context.sendActivity() instead of updating the original card via context.updateActivity(). This leaves the stale consent card with Allow/Deny buttons permanently visible in the conversation.
Root Cause
In monitor-handler.ts, after a successful upload, the code sends the FileInfoCard as a new activity:
await context.sendActivity({
type: "message",
attachments: [fileInfoCard],
});Instead, it should use context.updateActivity() with the replyToId from the invoke activity to replace the original consent card:
await context.updateActivity({
id: activity.replyToId,
type: "message",
attachments: [fileInfoCard],
});Reproduction
- Send a file from bot to user in a Teams DM (triggers FileConsentCard flow)
- User clicks "Allow" on the consent card
- File uploads successfully
- Observe: Original consent card still shows Allow/Deny buttons
- Observe: A separate FileInfoCard message appears below
Suggested Fix
- Add optional
updateActivitytoMSTeamsTurnContexttype - After successful upload, use
context.updateActivity()with the invokereplyToIdto replace the consent card - Fall back to
sendActivity(new message) ifupdateActivityis unavailable or fails
Environment
- OpenClaw version: 2026.3.2
- Channel: MS Teams (Bot Framework)
- Chat type: Personal (1:1 DM)