microsoft / teams-ai

SDK focused on building AI based applications and extensions for Microsoft Teams and other Bot Framework channels
MIT License
349 stars 142 forks source link

[Bug]: Handoff activity does not get triggered when the deeplink URL message is sent from M365 Copilot (or any other client) #1779

Closed dannygar closed 3 days ago

dannygar commented 4 days ago

Language

Javascript/Typescript

Version

latest

Description

Following this Developer Guide, I've created both the BotFramework project, based on this repository, and the Teams AI Library project - both implementing the handoff use case scenario. While the BotFramework project is property get triggered every time the deeplink URL (https://teams.microsoft.com/l/chat/0/0?users=28:${botId}&continuationToken=${continuationToken}) is clicked from M365 Copilot response, the Teams AI Library seems to ignore this event. The sample of the handoff code implementation using Teams AI Library can be viewed here: https://github.com/microsoft/teams-copilot-starter/blob/main/src/bot/teamsAI.ts#L377

Reproduction Steps

1.Add handoff handler to your Bot
2. Using M365 Copilot and the Developer Guide (link provided above) implement the Copilot plugin that returns the item containing the deeplink ("https://teams.microsoft.com/l/chat/0/0?users=28:${botId}&continuationToken=${continuationToken}") to the Bot chat.
3. When clicking on the deeplink URL, the Bot's chat is opened, but nothing is received in the bot handoff handler (nor there any other activities are triggered)
...
The expected behavior:
3. when clicking on the deeplink URL, the Bot's chat is opened and the Bot's handoff handler receives the activity containing the `continuationToken` passed in the deeplink URL.
aacebo commented 3 days ago

@dannygar is the bot receiving an activity payload to your endpoint /api/messages before the adapter.process is called?

aacebo commented 3 days ago

also it looks like your deeplike is not following the design document that states to use query param continuation not continuationToken image image