Agent question
Why does my AI agent skip or break tests?
Short answer: Because nothing makes the tests part of done. An agent stops when the code looks right, and if no rule tells it to run the tests, or a failing test looks like someone else's problem, it reports done anyway. Put a rule in the instructions file it reads on every task: run the tests, say how many passed, and don't call it done while any test fails.
Common causes
- No rule says to run the tests, so the agent stops once the change compiles.
- The full suite is slow, and there is no quick command for just the tests that matter.
- Tests already fail on the main branch, so one more failure looks normal.
- The agent can't run the suite where it works: a missing tool, database, or environment variable.
- Done was never defined, so the agent decides for itself when to stop.
How to check
Take your agents' last few weeks of tasks. For each one marked done, note whether tests ran, how many passed, and whether a test that passed before now fails. Tasks marked done with no test run are skipped tests. Tasks that leave a newly failing test are broken tests. Look at which agent and which kind of task each one comes from.
What to change
- Add one line to CLAUDE.md, AGENTS.md, or your Cursor rules: run the tests before calling a task done, and say how many passed.
- Give the agent a fast command for the tests near its change, and run the full suite in CI.
- Keep the main branch green, so a new failure stands out.
- Write the test setup down once where the agent reads it at the start.
Where Overdrive helps
Your agents can report tests run and tests passed with each task. Overdrive's Agent health page flags skipping tests and breaking tests for each agent, and Fix it gives your own agent the rule to add. Overdrive then re-checks the tasks that follow and marks the issue resolved, or back if it returns.