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-agent per 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
Description
The
nodejs/copilot-studio/sample-agentreturns"No response from Copilot Studio agent."for most interactions because theinvokeAgent()method insrc/client.tsonly checksactivity.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.textis 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
nodejs/copilot-studio/sample-agentper the READMEOutput
The streaming response handler in
src/client.tsonly capturesactivity.text:However, Copilot Studio returns responses as attachments with
contentType: "application/vnd.microsoft.card.adaptive". The actual reply text is inside nestedTextBlockelements in the Adaptive Card body. Sinceactivity.textis empty/undefined, nothing gets collected and the fallback string is returned.Adding debug logging confirms the activity has
text=undefinedbuthasAttachments=true:Screenshots
No response
Code of Conduct