· Markdown

Something had to give: why we ditched PRs

Something had to give: why we ditched PRs. Left, five pixel-art agents queue behind CI: about 40 minutes of CI per change, about half of it waiting for a runner. Right, agents go straight to main and batch CI to last-green: 17-second push checks, 3-minute batches.

Pull requests make sense when a human opens one or two a day. Once we had a handful of coding agents working in parallel, opening a PR for every change turned CI into a parking lot.

We did it the standard way at first. Every change waited in line, ran the whole test suite, merged to main, and then ran the whole test suite all over again. We didn't mind reviewing the code, but the waiting was killing us.

What we tried first

Early on, we treated agent sessions just like human engineers. An agent finished a task, opened a PR, waited for CI, got a review, and merged. Then main kicked off another full CI run.

In one two-day stretch in late November, we logged about 101 PR runs and 74 push runs. Most of those push runs were just re-testing what the PR had already passed, while every job fought over the same runners. By November 23, we had 369 PRs in a repo that was less than a month old.

We also write Rust. We want Rust in production because it is fast, memory safe, and thread safe, but compiling it is brutal. Having several agents run cargo at the same time on a laptop basically melted the machine.

What broke

We had already moved CI off GitHub-hosted runners and onto our own devbox after hitting a billing lock on minutes. Sharing that box between dev builds and double-run CI meant a single flake or slow job backed up everyone.

We measured 14 green PR runs on November 16 to see how bad it was. On average, a rust job waited 609 seconds (about 10 minutes) just to grab a runner, then ran for 211 seconds. The docker job waited 636 seconds and ran for 374. The final ci gate didn't even start until 1,184 seconds in, almost 20 minutes after the run began. We were spending more time waiting for a machine than actually running tests.

On bad days, when agent PRs stacked up behind each other, a small change felt like it sat in line for hours. Even at the 20-minute average, running that gauntlet twice per change ate the whole day.

Before: an agent's change opens a PR, runs full CI (about 20 minutes), gets a human and agent review, merges to main, and runs full CI again (about 20 minutes). A runner took about 10 minutes to free up, so a change spent about 40 minutes in CI.

What we do now

On November 23, we merged PR #431 ("CI: commit to main, test main in batches, release only from last-green"). We have opened zero PRs since.

Here is how a change actually gets from an agent to production now:

After: an agent's change runs its relevant tests, gets an independent agent review, is smoke tested in the running app, and lands with push-main. Quick checks take seconds; batch CI tests main's tip at most every 15 minutes; a green batch moves last-green, and the Releaser ships it on a person's yes. Runner waits went from about 10 minutes to 1 or 2 seconds, CI on a push to main from about 20 minutes to 16 to 18 seconds, and two full test runs per change became one batch of about 3 minutes.

For real design work, a design artifact and human approval sit in front of the relevant tests. We don't require that for every small fix.

What is still awkward

There is no human reviewing code before it hits main. Humans approve designs (when there is one) and the release plan. If that makes you uneasy, it made us uneasy too. Bad commits do land on main. Between November 23 and December 6, we hit 11 main-red issues. Most were fixed in 3 to 30 minutes, though two took over an hour. Main breaking isn't rare, so the whole thing depends on last-green holding the line and people fixing breaks fast.

The one-second test rule is also looser than it sounds. It applies when running tests one at a time, and a few tests (like evals and stall checks) are allowed to take longer. Under parallel load, nextest still flags plenty of tests as SLOW (147 of 1,208 in a recent run), and it only hard-kills a hang at 60 seconds.

This also only works because we are a small team that trusts its own sessions. Outside contributors still go through normal PRs. Mitchell Hashimoto's company, Superlogical (building Rex), described a similar setup on X with "limited to no PRs," where everyone pushes to main with machine-aided review before and human plus machine review after, while still opening a PR when working outside their comfort zone. That exception makes a lot of sense.

Where we landed

If agents can write code as fast as they can type, a workflow built around a human opening a couple of PRs a day will spend all its time stuck in CI. Moving compiles off the laptop, keeping tests small, reviewing diffs before landing, and testing main in batches fixed the bottleneck for us. Main is allowed to go red as long as nothing red ships and the fix lands quickly.

We build teams of agents at Tex, and we had to change how we ship code ourselves or our own agents would spend all day staring at CI queues. How are you handling agent-written changes now that a PR per change doesn't scale? Ping us on X at @try_tex_ai.

Try Tex

Tex runs teams of background agents for you. Each session is real Claude Code or Codex in its own microVM, and what one agent learns goes into a shared knowledge base that every agent reads before its next run. You can start free with $10 in credit, no card: sign up at app.trytex.ai, pick a starter, watch it run, and correct it.