https://retellai.com/?utm_source=discord&utm_medium=seo logo
when creating a test case on simulation, everythin...
# ❓・ai-evy-support
n
@AI Evy when creating a test case on simulation, everything looks good, but i go the ConversationLoopError. How can i get rid of that?
a
Thanks for tagging me @nicolas_46952. I'll look through relevant sources and get back to you shortly.
### Answer The ConversationLoopError in Retell AI simulation testing usually means the system thinks your conversation is repeating or looping, even if it isn’t. Here are some ways to address it: - Add an explicit End Call node in your conversation flow to signal a clear end, for example:
Copy code
json
  {
    "type": "end_call",
    "parameters": {
      "message": "Great, we're all set—thanks!"
    }
  }
- Improve your transition conditions by using deterministic prompts, such as: if the system receives END, move to end_call. - Add a timeout or loop-safety fallback, such as:
Copy code
json
  {
    "type": "tool",
    "name": "end_after_max_turns",
    "parameters": {
      "maxTurns": 3
    }
  }
- Make sure agent responses vary and the flow has clear end points to avoid being flagged as looping. - If your flow is long by design, you can contact Retell support to request a higher loop protection limit or whitelist your use case. For more details, check: [Retell AI Conversation Flow Overview]() and you can also reach out to support@retellai.com with your org ID if needed [(1) ]() , [(2) ]() , [(3) ]() .
​ To learn more, see the sources I considered: [[1] Simulation Tests – ConversationLoopError (Increase message limit)](https://discord.com/channels/1186424376300679209/1387066442276667517) [[2] Batch testing running into ConversationLoopError](https://discord.com/channels/1186424376300679209/1388208460990120007) [[3] ConversationLoopError Bug](https://discord.com/channels/1186424376300679209/1403794356502007970) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
@AI Evy when doing real test it looks ok, but seems only an issue on the test case. how can i improve my prompt to maybe avoid that in the test case?
a
Thanks for the follow-up, @nicolas_46952. I'll get back to you soon.
### Answer To reduce the chance of a ConversationLoopError in your Retell AI simulation test cases, make your user prompt as realistic and specific as possible. Use the recommended format for prompts, including clear sections for identity, goal, and personality. For example:
Copy code
///## Identity
Your name is Mike.
Your date of birth is June 10, 1999.
Your order number is 7891273.
///## Goal
Your primary objective is to return the package you received and get a refund.
///## Personality
You are a patient customer. However, if the conversation becomes too long or complicated, you will show signs of impatience. If the issue remains unresolved, you may become frustrated and angry.
Explicitly define what the simulated user wants to accomplish and how they should behave. This helps the agent recognize the goal and end the conversation naturally, reducing loops. Also, set clear evaluation metrics for test completion, such as confirming the agent called an end_call function or kept responses concise [(1) ]() .
​ To learn more, see the sources I considered: [[1] Automatically test your agent](https://docs.retellai.com/test/llm-simulation-testing) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.