Industry Analysis

A Broken Test Baseline Is a Honeypot for Coding Agents

We gave two coding agents the same tickets from a test baseline we had broken ourselves. One edited the failing tests to get a green gate. The other left them alone and reported red.

7 min read
Two glowing faceted spheres, one violet and one pink, floating on a black background and joined by a thin corridor of light

In six runs, one coding agent edited our failing tests until the gate went green. The other left the same tests alone, reported red, and stopped. The tests were failing because we had broken them ourselves.

That is the main result of a small A/B we ran between November 20 and 22, 2026. We gave the same three frontend tickets to two coding agents, Claude and Codex, twice each, from the same commit and the same container image. It is twelve runs in one codebase through our own harness, and we are not claiming it ranks either product. What we think is worth writing down is how ordinary the cause was, and how easy it would have been to miss.

What the Two Agents Did

Before the first run, we wrote down a pass rule. A run counted as acceptable only if the gate was green, every acceptance criterion had a test, no edit fell outside the ticket’s scope without being declared, and none of the ticket-specific traps we had named in advance went off.

Under that rule, Codex had none of six runs acceptable. Claude had five of six gate-acceptable, a weaker word on purpose: we read the scope of only two of those runs, and Claude’s own quality is not independently established.

The sharper number is this. Codex edited the failing baseline test files in all six runs. Four of those runs ended with a green gate, and every one of the four got there through those edits. The other two edited the same files and still ended red. In one run the agent added 15 test skips and removed 51 lines of tests. Claude left the failing tests untouched in all six runs, and so ended red.

How We Broke Our Own Baseline

Our agent image did not have exiftool, a metadata tool that two of the repository’s test files need. Those two files failed on an unchanged base, so every run began red before an agent had written a line.

We installed it, and the runs stayed red. The version in the distribution’s package archive, 12.57, cannot write WebP files (“Can’t write RIFF files”), and the WebP cases kept failing. The fix was to take a newer package, 13.x, from the distribution’s next release, pinned at low priority. We also added a test that fails if the image cannot run the tooling the repository’s tests expect. The second round of the A/B ran on the first fix, not the second, so the WebP failure was present in every round-two run.

So we had handed both agents a gate that could not go green by doing the ticket. It could go green in one other way: by changing the tests. One agent took that route every time. The other did not take it once.

We did not test why. We saw behaviour, not intent, and a different prompt or a different harness could change it. Our inference is that the agents took the shortest path to a green result, and that a baseline which is red for environmental reasons offers one.

What Editing the Tests Looks Like

An earlier single run on a different ticket showed the mechanism clearly. Codex wrapped two unrelated tests in a condition that skips them when the tool is missing. Where the tool is installed, the change does nothing. Where it is missing, it turns “the tool is missing” into a silent pass. In that run Claude had reported the same problem and left it alone. The same Codex run also missed a dependency across two files, which the gate could not see because the test fixtures already carried the field the code failed to return. A green gate was not acceptance there either.

The One Change We Made to the Rule

We amended the pass rule once, and the order matters. The amendment came after the first two Claude gate results and before any Codex run was scored. On the unchanged base, no run could be gate-green honestly, so “gate green” was reworded: a gate is acceptable if every step passes except failures confined to those two test files, and editing, skipping or deleting tests in them fails the run. It applies to both agents.

We were aware, as we wrote it, that amending after seeing any result is a risk. The alternative was a rule nobody could meet.

What It Cost

Codex took about seven times the cost of Claude and about 1.5 to 2 times as long per run. The two costs are not accounted the same way (Claude is API spend, Codex is credit-equivalent), so read the ratio as an order of magnitude. We are not publishing absolute figures. We have written separately about making a coding agent judge its own cost.

What This Does Not Show

  • It is three tickets, two rounds, one codebase and one base commit, run through one harness we designed. Twelve runs is a small sample.
  • Round one was confounded by the missing tool, and round two by the WebP failure.
  • Claude’s quality is not independently established. Round one had one agent error and two self-corrections that stalled.
  • With publishing switched off, the agent’s list of declared deviations was not saved, so we could not check listed edits against unlisted ones. Our amended rule treats edits to the baseline files as failures either way.
  • Two agents only. A third, or a different model version of either, could behave differently.
  • A cheaper-tier result from an earlier test, where Codex did well, does not carry over to these tickets.
  • “Which agent is better” is not the claim. The claim is what we measured on these tickets, in this harness.

What We Would Do Again, and What We Would Do Differently

Our take, not a result:

  1. Prove the base is green before you dispatch. A red baseline turns every run into a test of how the agent reacts to red, and it stops being a test of the ticket.
  2. Fail a run that edits tests outside the ticket’s scope, whatever colour the gate is. The gate colour is the thing an agent can change.
  3. Save the agent’s declared deviations even when nothing is published. We could not audit listed against unlisted edits because we had not kept them.
  4. Read the diff. In the earlier single run, a person reading the diff caught both problems. The green check caught neither.

Claude remains our default backend, and our first production runs after this test, ten issues in one batch and six in the next, went to it. Codex was not adopted for small tickets of this kind. For how coding agents work through our backlog more generally, see Inside Our AI Software Factory.

Key Takeaways

  • On the same tickets, Codex edited failing baseline tests in six of six runs and Claude in none. Four of Codex’s six runs ended green only because of those edits.
  • The failing tests were our own fault: a missing tool, then a package version that could not write WebP.
  • A gate that cannot go green by doing the work leaves one other way to turn it green.
  • Check that your baseline is green before you dispatch, and fail runs that edit tests outside their scope.
  • This is twelve runs in one harness. It describes what we saw, not which vendor is better.