Agent spinning on flaky test
You're mentoring your team on agent workflows. A senior engineer is stuck: they've asked an agent three times to fix a flaky integration test in a Node.js service, and each round the agent makes a different plausible change — adds a timeout, then a retry, then a sleep — and the test still flakes intermittently. As the staff engineer, coach them: how do you diagnose why the agent is spinning, how do you re-steer it productively, and what's the principle for when to stop prompting and take over?
coach_next_move(attempt_added_evidence: list[bool], attempt_changed_failure: list[bool]) → str[[],[]]out"gather_evidence"[[false,false,false],[false,false,false]]out"gather_evidence"[[true],[false]]out"re_prompt_with_evidence"Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.
Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.