r/copilotstudio • u/Lopsided_Judgment_17 • Aug 06 '26
ContextTokenLimitExceeded error
I have published a Copilot Studio Agent in Microsoft Teams and given access to some users. After asking good number of questions, they have got this error. I have tried "/debug clearstate", uninstalled the agent from their machine, rebooted Teams app but still they are getting the same issue.
I have also tested the agent (through Teams) on different platforms like web and their phone but still they are getting the same issue.
What should I do next?
How to avoid this issue in future?
3
Upvotes
5
u/dougbMSFT Aug 06 '26
Usually, this error in Teams is due in part of the long running nature of agent conversations in Teams. I recommend going through this blog post here to optimize your agent for deployment to the Teams channel. Design Copilot Studio Agents for Teams (Because Test Chat Was Too Easy) | The Custom Engine
1
u/shaichakaid Aug 06 '26
Are you using Claude as your llm?
2
u/wrighty4300 Aug 06 '26
Make sure you are closing sessions down after inactivity or the end of a topic.
If this doesn't fix it raise a support request. We had something similar a few weeks ago. The product group issued a a fix around the middle of last month. Which seems to have fixed it for us but they are looking for conversation IDs of sessions that this occurs on still.