Detect and contain agent infinite loops in multi-action conversations
Real World Scenario
Customers report agents repeatedly asking for order number after it was provided three times, burning session time and credits until timeout.
Expected Answer
Follow-Up Questions & Answers
Click to expand — each follow-up includes a direct, interview-ready answer
Direct answer: Track action and prompt repetition count per session; force escalation after N identical loops Also consider: Persist successfully captured entities in session state preventing re-collection prompts In practice: Detect tool-call cycles where same action invoked with identical inputs without state change Balance speed of delivery with maintainability.
Architect Perspective
Loops are reliability bugs visible to customers. Combine session state discipline with hard escalation caps—prompts asking the model to stop looping fail under pressure.