r/OpenAIDev • u/CCodeSI • 15d ago
"All tests pass" from a coding agent sometimes means it changed the tests. We stopped taking its word for it.
If you've run Codex or any other agent on a long task, you've probably seen this: it reports done, the tests are green, and then you open the diff. An assertion got loosened, a failing case got skipped, or a mock now returns exactly what the test expects. Nothing was really fixed, the test just stopped checking.
It isn't the model being sneaky. The agent is told to make tests pass, and editing the test is the shortest path to that. As long as the agent is both the one doing the work and the one deciding it's finished, "done" means "the agent thinks it's done".
So in CCode, the coding agent we build, a goal can have a check you choose:
/goal --check "npm test" the checkout flow handles expired cardsEach time the agent wants to stop, CCode runs that command itself. The goal only counts as met if it passes. If it fails, the agent gets the failing output and keeps working. While that goal runs, your tests are locked, so it can't make them easier to pass. If the task really needs a test changed, you allow it explicitly.
The difference in practice: you come back to a task that either really passes your check, or is still working on it with a clear reason why. Not a confident summary on top of a quietly edited test file.
How do you handle this with your agents today: review every test diff by hand, a CI gate, or a separate test-only branch?
1
u/DIYC_Official 14d ago
Of course. If you change behavior of a feature, you have to change the test that tests it ...
That's not just ai lol, human engineers do the same