Question 16
Domain 2An agent is implementing a complex feature. It has been going for 47 turns, looping between editing the same file, running tests, and re-editing. The tests still fail. Which mitigation is most aligned with agentic-architecture best practices?
Correct answer: A
Explanation
A soft watermark prevents endless local loops by forcing the agent to “finish current unit, commit, exit cleanly, resume next run” before exhausting the turn budget. This matches agentic best practice because it preserves progress, reduces thrashing on the same file, and creates a clean checkpoint for the next iteration.
Why each option is right or wrong
A. Increase max_tokens so the agent has more room to think.
B. Add a soft watermark at ~80% of max-turns: finish current unit, commit, exit cleanly, resume next run.
Agentic-architecture guidance favors a bounded work unit with a checkpoint before the loop becomes pathological: at roughly 80% of the turn budget, the agent should complete the current atomic change, persist the result, and terminate so the next run can re-plan from a clean state. In this scenario, 47 turns of edit-test-reedit on the same file is exactly the kind of local thrash a soft watermark is meant to interrupt, rather than letting the agent burn the remaining turns and compound state drift.
C. Switch the agent to a more powerful model mid-run when retries exceed 5.
Model escalation may improve quality, but switching mid-run does not directly solve context exhaustion.
D. Disable the test-running tool until the agent commits to a written plan.
Blocking tests removes feedback needed for debugging and treats symptoms instead of memory limits.