Skip to content

[msteams] FileConsentCard not updated after user accepts — consent card remains frozen #47268

@cwatts-sage

Description

@cwatts-sage

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

  1. Send a file from bot to user in a Teams DM (triggers FileConsentCard flow)
  2. User clicks "Allow" on the consent card
  3. File uploads successfully
  4. Observe: Original consent card still shows Allow/Deny buttons
  5. Observe: A separate FileInfoCard message appears below

Suggested Fix

  1. Add optional updateActivity to MSTeamsTurnContext type
  2. After successful upload, use context.updateActivity() with the invoke replyToId to replace the consent card
  3. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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