Code RoomAgent spinning on flaky test
MediumPrep Room Coding #4256

Agent spinning on flaky test

Vibe & agenticAlgorithms & data structuresSenior–Staff~20 min

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?

Implement
coach_next_move(attempt_added_evidence: list[bool], attempt_changed_failure: list[bool]) → str
Examples
in[[],[]]out"gather_evidence"
in[[false,false,false],[false,false,false]]out"gather_evidence"
in[[true],[false]]out"re_prompt_with_evidence"
What a strong answer looks like

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.

0:00 of about 20 min

Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.

Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.