-
Notifications
You must be signed in to change notification settings - Fork 33
Description
Description
The nodejs/copilot-studio/sample-agent returns "No response from Copilot Studio agent." for most interactions because the invokeAgent() method in src/client.ts only checks activity.text, but Copilot Studio delivers responses as Adaptive Card attachments (application/vnd.microsoft.card.adaptive), not plain text.
Expected behavior
The sample agent should extract and return the text content from Adaptive Card attachments when activity.text is empty, so users receive the actual Copilot Studio response instead of "No response from Copilot Studio agent.".
SDK Version
latest (as of March 2026)
Language/Runtime
Node.js 22.x
OS
Windows 11
How to Reproduce
- Set up the
nodejs/copilot-studio/sample-agentper the README - Connect it to any Copilot Studio agent that sends an adaptive card.
- Send a message via the Agents Playground
- The agent replies with `"No response from Copilot Studio agent."
Output
The streaming response handler in src/client.ts only captures activity.text:
for await (const activity of this.client.sendActivityStreaming(userActivity, this.conversationId)) {
if (activity.type === ActivityTypes.Message && activity.text) {
responses.push(activity.text);
}
}However, Copilot Studio returns responses as attachments with contentType: "application/vnd.microsoft.card.adaptive". The actual reply text is inside nested TextBlock elements in the Adaptive Card body. Since activity.text is empty/undefined, nothing gets collected and the fallback string is returned.
Adding debug logging confirms the activity has text=undefined but hasAttachments=true:
[CS Activity] type=message, text=(none), hasAttachments=true
[CS Attachment] contentType=application/vnd.microsoft.card.adaptive, content={"type":"AdaptiveCard","body":[{"type":"TextBlock","text":"Here is your report..."}]}
[CS Result] 0 response(s) collected
Screenshots
No response
Code of Conduct
- I agree to follow the Microsoft Open Source Code of Conduct.