A team reports that their code-review agent continues running and submitting new review comments long after the pull request has already been approved and merged. The agent never stops on its own. What is the most likely root cause of this behavior?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Picture a security guard who has never been told the building closes at 5 PM — they'd patrol forever. Your agent was never told what 'done' looks like. Every agent needs success criteria (how do I know I've succeeded?) and a termination condition (stop when that state is reached).
Full explanation below image
Full Explanation
An agent that runs indefinitely is exhibiting one of the most common agentic design failures: missing termination conditions. This is distinct from a bug — the agent is working as coded, but the code never specifies when it should stop.
The correct answer is B. Success criteria define what the agent is trying to achieve, and termination conditions are the concrete, checkable states that confirm the objective has been met. For a code-review agent, the success criterion might be 'all review comments have been addressed and the PR has received at least two approvals.' The termination condition that signals this in code would be: 'if PR status == merged OR PR status == approved AND comment_thread_count_open == 0, halt execution.' Without both of these, the agent has no basis on which to stop — it will continue executing its loop indefinitely.
Why the other options are wrong:
Option A — system prompt length — is a red herring. Losing track of instructions due to context length is a separate problem (and more common in long conversations, not short agentic tasks). Even a perfectly concise prompt does not help if there is no termination logic.
Option C — switching LLM models — doesn't address the root cause. A more capable model will still loop forever if there is no condition instructing it to stop. Model capability is about reasoning quality, not control flow.
Option D — a PR status API bug — would manifest as incorrect status checks, not as infinite continuation. If the agent could not read the API at all, it would likely throw errors, not quietly keep posting comments. The scenario describes normal operation that simply never terminates, which points to a design omission rather than a code bug.
For the exam: 'runs indefinitely,' 'never stops,' or 'keeps retrying after completion' always indicate missing success criteria and/or termination conditions — a foundational Domain 1 concept.