A merge queue tests each pull request on top of the ones ahead of it, so one failure restarts everything behind it. That sets a ceiling on how many pull requests it can land per hour, and coding agents now send more than it can take.
Engineer's view. This is optimistic locking under contention. Each transaction validates against everything committed before it, and one abort throws away the work queued behind it. More workers only waste more work. Throughput is set by the abort rate and the transaction time. Agents raise the load and leave that ceiling where it was.
TL;DR. A merge queue's speed is capped by how often a queued change fails and how long CI takes, not by how many pipelines run at once. More pull requests from agents push it into long waits unless you cut one of those two.
Explain Like I'm 5
A school lunch line has one rule. Each kid must show their tray to the cook, and the cook
checks it against every tray that went before.
The cook can look at twenty trays at once. If a tray is wrong, that kid steps out. Every kid
behind them has to show their tray again, because the cook checked it next to the wrong one.
On a normal day the line moves fine. Then a class of fast kids joins. They bring three times
as many trays. The cook is not slower. The line still backs up, because each wrong tray sends
everyone behind it back to the start.
The Problem
You have shipped this bug already, in a system with no model in it.
Your service used optimistic locking. Each write read a row, changed it and committed only if
nobody else had changed it first. At low traffic it was fast. Then traffic tripled. Writes
started aborting and retrying, and each retry raced the next wave. Latency went from
milliseconds to seconds. Adding app servers made it worse, because they only added contenders.
The limit was never the servers. It was how often a commit failed, times how long it took.
A merge queue has the same shape. It is the gate that lands pull requests on main one
tested batch at a time. GitHub calls it the merge queue. GitLab calls it a merge train. Each
pull request is tested on top of main plus every pull request ahead of it, so main never
breaks. When one fails, everything behind it was tested on a tree that included the failure.
All of it reruns.
Coding agents change the arrival rate. At Anthropic, merges grew from about 2,500 a day in May
2026 to over 30,000 a day by September. They stopped using a merge queue. A team without that
option has to know where its queue's ceiling is.
The fix: measure your queue's failure rate and CI time, compute its ceiling, and lower the
failure rate before adding pipelines.
Read the full post on The AI Commit
How Many Pull Requests a Merge Queue Can Land in an Hour carries the rest: the fix and why it works, the code to change for each role, how to tell it worked, when it is the wrong tool, and an interactive model you can play with.
Originally published at theaicommit.com, a daily AI engineering lab for software engineers. The original has an interactive version you can play with, and the full runnable code is on GitHub.
Top comments (0)