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
updateActivity to MSTeamsTurnContext type
- After successful upload, use
context.updateActivity() with the invoke replyToId to replace the consent card
- Fall back to
sendActivity (new message) if updateActivity is unavailable or fails
Environment
- OpenClaw version: 2026.3.2
- Channel: MS Teams (Bot Framework)
- Chat type: Personal (1:1 DM)
Bug: FileConsentCard stays in Allow/Deny state after file upload completes
Component:
@openclaw/msteamspluginFile:
extensions/msteams/src/monitor-handler.tsSeverity: Low (cosmetic — file uploads succeed, but UX is degraded)
Summary
When a bot sends a file via
FileConsentCardin 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
FileConsentCardshould be replaced in-place with aFileInfoCardshowing the file name and a download link. The consent buttons should no longer be visible.Actual Behavior
The
FileInfoCardis sent as a new message viacontext.sendActivity()instead of updating the original card viacontext.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 theFileInfoCardas a new activity:Instead, it should use
context.updateActivity()with thereplyToIdfrom the invoke activity to replace the original consent card:Reproduction
Suggested Fix
updateActivitytoMSTeamsTurnContexttypecontext.updateActivity()with the invokereplyToIdto replace the consent cardsendActivity(new message) ifupdateActivityis unavailable or failsEnvironment