Which runtime safeguards prevent an agent from looping indefinitely?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
A step budget, repeated-call detection, and no-progress detection genuinely stop runaway loops; bigger context windows and faster models do not.
Imagine a robot vacuum stuck in a corner, bumping the same wall over and over. How do you stop it from doing that forever? You could give it a timer that switches it off after a set number of bumps. You could notice it keeps hitting the exact same spot and force it to turn somewhere new. Or you could check whether the room is actually getting cleaner, and stop it if nothing is changing. Those three tricks each catch a stuck robot. What does not help is buying a robot with a bigger memory, or a faster motor. A bigger memory just lets it remember more bumps. A faster motor just lets it bump the wall quicker. Neither one notices that it is stuck. Agent loops are the same: you need a real stopping rule, not just more room or more speed.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
Separate the options into safeguards that detect non-termination versus ones that only change cost or capacity, justify the three correct picks, then explain crisply why a bigger context window and a faster model add no exit condition and so cannot stop a loop.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Picking the bigger context window or the faster model. Both change how much or how fast the loop runs, but neither detects that the agent has stopped making progress, so neither prevents the loop.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.