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.
This first ran on the Tex (trytex.ai) blog. I'm posting it here too.
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.
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:
- No compiling on laptops. Agents and editors stay local, but cargo never runs on the laptop. A helper copies the worktree to a shared devbox (32 vCPUs, 64 GiB RAM, local NVMe) capped at three concurrent build slots so it cannot drown itself. It starts when someone needs it and shuts down after 30 idle minutes.
- Agents land straight on main. An agent writes the code, runs the tests relevant to its diff, and hands the branch to an independent reviewer session to catch bugs and fix what it finds. If the work involves a real design call, the agent writes up a proposal or demo artifact and gets a human yes on the outcome instead of a line-by-line diff. Before pushing, it smoke tests the exact change in a running app. Then
scripts/push-mainrebases onorigin/main, runs quick checks (clippy or deploy checks, usually a minute or two), and pushes to main. Outside contributors still use PRs. - Tests stay fast. Our rule is that every test should finish in under a second when run alone, using test seams instead of real timeouts, with cargo nextest running the suite in parallel. In a recent batch, 1,208 tests finished in 37 seconds.
- Expensive CI runs once, in batches, on main. A push to main only triggers quick migration and release-pin checks (about 16 to 18 seconds). At most every 15 minutes, a batch job tests main's tip, running only the jobs that the diff from
last-greencan actually break. Runner waits dropped from 10 minutes to 1 or 2 seconds. Recent batches finish in about two and a half to three minutes. - Humans gate releases, not merges. One Releaser session at a time holds a release lock. It never ships main's tip. It only ships
last-green, and only after a person approves the release plan. If a batch goes red, amain-redissue opens naming the suspect commits, pushes touching the failing job get blocked, and the session that broke it fixes it forward or reverts.
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.
I'm Todd, I work on Tex (trytex.ai). 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?
The original post is here: https://trytex.ai/blog/why-we-ditched-prs?utm_source=devto&utm_medium=social&utm_campaign=no-prs-post


Top comments (0)