The task looked trivial on paper: add a rate limiter to a small Python service and update three call sites. I handed it to a coding agent running on MonkeyCode, an open-source project with free model access and a free server option. Disclosure: This article was prepared as part of MonkeyCode's product outreach. I did what most engineers would do with a ten-million-token allowance: give the agent a generous budget and walk away.

Three hours later I returned to a two-thousand-line diff for what should have been a forty-line change. The test suite was green, which made the failure harder to explain, but the agent's log told a clearer story. The same file had been edited fourteen times, and each edit appeared to revert the previous one before adding something new. The agent was oscillating between two designs, and nothing in my setup was designed to notice.

My first hypothesis was prompt ambiguity, because the task description did leave room for interpretation about where the limiter should live. I rewrote the prompt with explicit constraints, pinned the exact function names, and added a sentence demanding a minimal diff. The second run was faster, but the log showed the same oscillation pattern, which ruled out the prompt as the primary cause.