Copilot Studio Agent in Teams Group Chat stuck with ContextTokenLimitExceeded and cannot be reset

Ya BrightBetter 0 Reputation points
2026-10-16T04:31:05.39+00:00

Hi everyone,

I'm experiencing an issue with a Copilot Studio agent deployed to Microsoft Teams.

The agent works normally in the Copilot Studio Test Pane, but in a specific Teams Group Chat it continuously returns:

ContextTokenLimitExceeded

What I've observed:

  • The issue occurs only in one Teams Group Chat.
  • The agent works correctly in the Copilot Studio Test Pane.
  • Clicking "Start over" does not resolve the issue.
  • The error returns immediately after starting over.
  • The agent cannot be removed from the affected Teams Group Chat.
  • Other users in the same chat experience the same behavior.
  • The conversation appears to be stuck in a broken state.

I've also verified that the standard system topics (Conversation Start, Reset Conversation, Fallback, etc.) are enabled.

Based on the behavior, it seems that the Teams conversation state may not be resetting correctly and the previous context is still being loaded.

Has anyone experienced a similar issue?

Is there any way for an admin or maker to:

  1. Force-reset the conversation state for a Teams chat?
  2. Clear the conversation memory/context associated with a specific thread?
  3. Remove and recreate the agent session without creating a new Teams chat?

Any guidance would be appreciated.

Thank you.

Microsoft Copilot | Microsoft 365 Copilot | Development
0 comments No comments

2 answers

Sort by: Most helpful
  1. Austin-H 8,555 Reputation points Microsoft External Staff Moderator
    2026-10-16T05:04:46.2633333+00:00

    Hi Ya BrightBetter

    There is an important distinction between resetting conversation variables and clearing the conversation history used by the agent.

    Microsoft’s system topics documentation states that the Reset Conversation topic does not clear conversation history by default. Therefore, having this topic enabled does not necessarily mean that “Start over” clears the previous context. This is worth checking, although it does not establish the cause of your error.

    Please have the maker inspect the Reset Conversation topic:

    Check whether it includes a Clear variable values node with Conversation history for the current session selected.

    If that option is missing, add a separate node with that selection, retaining the existing variable-clearing node.

    Save, test, and publish the change, then check the reset behavior in Teams.

    Microsoft documents this option for clearing the history used by the generative planner. It is not a documented method for deleting the Teams chat itself, and it cannot be assumed to recover a conversation if the error prevents the reset logic from running.

    As the forum’s AI recommended, /debug clearstate is another documented reset action for agents in Teams. If you have not tried it, please record whether the agent acknowledges the command and whether a short follow-up message immediately produces the same error. The Teams deployment guidance documents this command, but does not establish it as a guaranteed fix for this specific failure.

    Regarding an administrator forcing a reset of a specific thread from outside the conversation: I could not find a documented admin control or public API for that operation, or a verified procedure to recreate the agent session in the same group chat. The maker-side history-clearing option above is different from a backend thread reset.

    If the problem persists, please check the affected chat in Teams on the web and test the same published agent in another Teams chat, if available. These comparisons help establish whether the failure remains limited to the original thread. There is not enough evidence here to justify disconnecting the Teams channel or changing organization-wide app settings.

    Your administrator can then open a Copilot Studio support request through Power Platform admin center > Support > Support requests > Get support.

    Provide the agent/environment IDs, affected conversation ID, UTC timestamp, full error details, reset results, and the exact behavior when removing the agent fails. Share identifiers privately through the support request and redact them from public screenshots. Ask support to investigate both the persistent error and failed removal, and determine whether the existing chat can be recovered.

    This is a user-to-user forum, so I cannot inspect or reset the service-side conversation state.


    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?

    0 comments No comments

  2. AI answer

    2026-10-16T04:31:27.22+00:00

    For a Teams chat that is stuck in a bad conversation state, the supported reset actions are:

    1. In the Teams chat with the agent, enter start over, goodbye, or another phrase that triggers the end-of-conversation topic.
    2. Start a new conversation so Teams loads the latest agent state.
    3. If the problem continues, enter /debug clearstate in the Teams chat to clear the conversation context and force Teams to reload the agent state.

    This matches the documented recovery path when a conversation remains stuck after a tool or flow error.

    If the issue still affects only that specific Teams group chat after start over and /debug clearstate, the available context does not provide a maker or admin method to force-clear a specific Teams thread from the backend or recreate the session in-place without using the chat itself.

    A related documented case for Teams-specific unresponsiveness is to republish the Teams channel if the agent’s Microsoft Entra app registration is missing:

    1. In Copilot Studio, open the agent.
    2. Go to Channels > Microsoft Teams.
    3. Disconnect the Teams channel.
    4. Wait one to two minutes.
    5. Reconnect the channel and publish again.

    If the agent responds in Copilot Studio but not in Teams more broadly, also verify the Teams admin setting at Teams admin center > Teams apps > Manage apps > Actions > Org-wide app settings and ensure Let users interact with custom apps in preview is On.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.