The problem

When AI agents write most of the code, the number of pull requests goes up sharply and so does the bill for testing them. In one 30-day window our pipelines ran 1,125 times and used 19,244 billed minutes. Pull request checks took 25 to 30 minutes, which is long enough to break anyone’s concentration, human or agent.

The easy fix is to run fewer tests. I ruled that out at the start. The rule for the project was written at the top of the plan: do not thin the gates.

What I did

Measured first. Before changing anything I broke down every billed minute by workflow, job and step. Most of the cost sat in a few places, and some of it was pure waste: duplicated setup, jobs that ran when nothing relevant had changed, and tests that could not safely run in parallel holding back those that could.

Trimmed the waste. The main workflow went from 159 billed minutes per pull request run to 80. Package tests went from 21.8 minutes to 13.7. That alone saved about 3,800 minutes a month.

Moved the heavy work. The Spark and container test jobs moved to a small pool of Mac minis we already owned. The same tests ran 1.8 times faster one at a time and about 5 times faster with parallel workers.

Kept a way back. Owned hardware fails. A heartbeat check watches the runners, and if they stop answering, the jobs fall back to hosted runners automatically. Nobody waits on a dead machine.

The result

Hosted usage was projected to fall from about 4,500 minutes a week to about 900. Pull request checks dropped to between 5 and 13 minutes. No test was removed: the suite still holds about 20,400, and jobs run whenever the files they cover change.

The general point

Cost work goes wrong when it starts with a target and works backwards. Starting with measurement usually finds that the expensive part is not the valuable part, and you can cut one without touching the other.