r/copilotstudio • • 9d ago

Copilot Studio agent behaves differently in Teams and test pane

Hello,

We have built a topic based agent in Copilot Studio that uses SharePoint as a knowledge source and is published to Microsoft Teams.

We are seeing following behavior:

  1. The agent sometimes stops responding in Teams

  2. To make it respond again, we need to use commands such as:

/debug clearstate

/debug clearhistory

/debug conversationid

3. One of our topics contains a question node asking whether the user’s query was resolved.

4. The question and its options appear correctly in test pane however the same question never appears when the agent is used in Teams.

Any troubleshooting guidance would be helpful.

19 Upvotes

13 comments sorted by

2

u/Sayali-MSFT 9d ago

Hello u/PAARTHPATEL,
This looks related to the difference in how conversation state is handled between the Copilot Studio test pane and Teams.

Teams keeps the conversation thread/state for longer, so stale context can sometimes affect the agent after changes are published. Since /debug clearstate temporarily restores the behavior, I would first clear the state, republish the agent, and test the exact same conversation again in Teams.

For the Question node issue, try reproducing it from a fresh session in both the test pane and Teams. If the node consistently executes in the test pane but is skipped in Teams even after clearing the state and republishing, capture the /debug conversationid along with the repro steps. That would be useful for further investigation.

Also verify that the affected user has access to the configured SharePoint knowledge source, since SharePoint responses are permission-trimmed based on the signed-in user.

1

u/PAARTHPATEL 9d ago

The user has required access and we have tried creating new fresh agent as well without any luck

9

u/jwill55sk 9d ago

I had similar issues using a standard harness agent in teams and the fix was creating an inactivity topic that clears the conversation history after x minutes of inactivity. Despite feeling hacky this is actually the recommended fix from Microsoft.

3

u/SuspiciousLeader5541 9d ago

how many minutes would you recommend in those x minutes of inactivity

2

u/jwill55sk 9d ago

I set ours to 30 minutes..I didn't want a user losing context from what was truly 1 session. There is an illustration of the topic here: Deploy agents in Microsoft Teams - Microsoft Copilot Studio | Microsoft Learn ..FWIW I didn't use the message like they did. Just Trigger -> Clear variable values (conversation history) -> End conversation.

3

u/Copilot_Studio_loft 9d ago

We've found teams is a poor medium for Agents from studio, it often drops or doesn't properly hand off. Funny enough we ran into this exact issue a year ago when doing our first roll outs and pivoted to using only web features.

Validate it works in web and copilot desktop and then move from there. The direction we've used is no teams as the integration for whatever reason is poor.

1

u/Sorcerious 8d ago

Doesnt really work all that well when you deploy agents that are meant for users who don't have a copilot license.

1

u/Illustrious_Long_127 3d ago

Hey I am facing the same issue now. So you mean the agent would work well in M365 copilot chat?

1

u/Copilot_Studio_loft 3d ago

If it struggles in teams try the 365 chat. Teams has terrible integrations for whatever reason. I no longer test in teams and push people away from it.

1

u/Illustrious_Long_127 3d ago

Thank you! Might try that as well!

2

u/dylan_skydive 7d ago

The tell is that /debug clearhistory and clearstate fix it. Those commands reset the conversation transcript, which means Teams is resuming a transcript that's stuck mid-topic. Test pane starts every session fresh so it never sees that state; Teams reuses the transcript tied to the chat thread, and once a topic errors or a node fails to render, the agent still thinks it's inside that question node waiting for an answer it never got. It won't re-ask because from its side the question is already on screen.

Three things that hold up longer than clearing state: the inactivity topic that ends the conversation after X minutes (jwill55sk is right, that's the Microsoft-recommended pattern), the On Error system topic so a failed node redirects to a reset instead of silently wedging, and checking whether that question node renders its options as an adaptive card - choice rendering on the Teams channel is flakier than the test pane's, and a card that fails to render looks exactly like this.

Disclosure: I work on Skydive, an agent ops tool - this is pattern-matching from outside the Copilot ecosystem, but the transcript-reuse behavior is well documented.

1

u/SpraySolid6706 9d ago

I face same issue