microsoft / microsoft/Agent365-Samples
Copilot Studio sample agent returns "No response" — responses arrive as Adaptive Card attachments, not activity.text
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 108
- Forks
- 59
- PR merge metrics
- No merged PRs in 30d
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in nodejs/copilot-studio/sample-agent/src/client.ts, focusing on invokeAgent() and its sendActivityStreaming loop. Check how message activities expose Adaptive Card attachments and their nested TextBlock content; done means responses from those cards are collected instead of the fallback message when activity.text is empty.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100