r/devtools • u/Ok-Emu-8106 • Oct 10 '26
Building a check for agents "fixing" failing tests by weakening the test
Pattern I keep running into with Cursor/Claude Code: test fails, agent can't fix the code, so it changes the test. Swaps a real call for a mock, loosens an exact assert to something trivially true, or adds a skip/xfail. CI goes green and nothing was actually fixed.
Working on a check in Vast for this. Deliberately deterministic, diffs the AST of the test before/after the PR and flags mock substitution, weakened asserts, and new skip/xfail added in the same commit as the code change. No LLM in the loop, since a model judging whether a test is fake felt like the wrong place for another trust assumption.
Limitations so far: PR-time only, no historical backfill, and I'm sure there are patterns I'm missing.
What other ways have you seen agents get a test green without fixing the bug?