Skip to content

context.activity.attachments is always None in Copilot for Teams, but populated in Web Chat/Teams Bot #323

@GKatayama

Description

@GKatayama

When using the Python SDK to read files users upload in chat, context.activity.attachments works in Web Chat and Microsoft Teams (bot), but in Copilot in Teams it’s always None. I’m trying to retrieve user-uploaded files to process them inside the agent.

SDK version: 0.4.0

Python version: 3.11.9

Channels tested:
Web Chat (Test in Webchatattachments present)
Microsoft Teams (Microsoft 365 Developer Subscription; attachments present)
Copilot in Teams (Microsoft 365 Developer Subscription; attachments missing)

Steps to reproduce:

  1. Create a simple agent using Agents for Python (such as from https://github.com/microsoft/Agents/tree/main/samples/python/quickstart)
  2. Add logging of context.activity.attachments
  3. Enable MS Teams channel on Azure Bot Service resource
  4. Enable file upload in app manifest
  5. Side load custom app into MS Teams in Microsoft 365 Developer Subscription
  6. In Copilot in Teams, upload a file in a chat with the agent

Expected:
In Copilot for Teams, I expected that context.activity.attachments should contain the uploaded file(s), similar to Web Chat and standard Teams bot conversations, including a contentUrl (or equivalent) I can use to download the file.

Actual:
In Copilot for Teams, context.activity.attachments is always None, even when a user uploads a file with the message. However, the user experience shows a file upload succeeded, the agent’s turn simply receives no attachments.

Logging snippet:
Image

Enabled file upload in app manifest:
Image

Testing file attachment to user message in Copilot in Teams:
Image

Image

Logging results (Copilot in Teams - attachments is None even though file was attached to user message):
Image

In MS Teams standard bot chat and Web Chat, when uploading a file in chat, the agent logs context.activity.attachments with one or more attachments containing download URL(s), but in Copilot for Teams, context.activity.attachments is always None.

Logging results (Standard Teams chat - attachments present):
Image

Questions:

  • Is user message attachment delivery to agents supported in Copilot for Teams with the Python Agents SDK today?
  • If not supported yet, is there a workaround or ETA?
  • Is this the same for agents accessed by user in Microsoft 365 Copilot? (I am currently only testing for Copilot through the Copilot for Teams due to its availability in the Microsoft 365 Developer Subscription)

Thanks!

Metadata

Metadata

Labels

Microsoft 365 CopilotThis issue is related to Microsoft 365 Copilot

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions