Skip to content

Copilot Studio sample agent returns "No response" — responses arrive as Adaptive Card attachments, not activity.text #252

@fizamusthafa

Description

@fizamusthafa

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

  1. Set up the nodejs/copilot-studio/sample-agent per the README
  2. Connect it to any Copilot Studio agent that sends an adaptive card.
  3. Send a message via the Agents Playground
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions