Cursor Origin
Merge Queues Explained: Keeping CI Green at Agent Scale
A merge queue tests each pull request against the latest target branch plus every change queued ahead of it, then merges in order, so two individually green PRs can't combine into a broken main. GitHub ships one today. At agent throughput, where parallel agents open changes constantly, a queue stops being optional.
On this page
What is a merge queue?
A merge queue is a gate between approved and merged. Instead of landing a pull request the moment someone clicks merge, the queue builds a temporary version of the target branch that includes your change plus every change queued ahead of it, runs CI against that combination, and only merges when the combination passes.
The reason it exists is a gap most teams discover the hard way: the code CI validated on your branch is not the code main becomes. Your pull request passed against the main that existed when you branched. By the time you merge, other changes have landed, and nothing has tested your change against them.
CI on your branch answers "does my change work against the main I branched from?" The queue answers a better question: "does it work against the main it will actually land on?" That one-sentence difference is the whole feature.
This is covered hands-on in Cursor Compile 2026 — 1 short module, free to read.
What problem do merge queues solve?
The failure mode is racing green PRs. Two pull requests are open, both pass CI, both get approved. One renames a function; the other adds a new call to the old name. There is no textual conflict, so git merges both without complaint, and trunk is now broken even though every check on every PR was green.
GitHub's older answer was the "require branches to be up to date before merging" rule, which forces you to rebase onto latest main and re-run CI before merging. It works, but manually: with ten PRs in flight, whoever merges first invalidates the other nine, and each author updates and re-runs by hand, then races to merge before someone else lands. A queue automates exactly that loop.
- What CI tests
- Without a queue
- Your branch vs a stale main
- With a merge queue
- Your change plus everything landing before it
- Keeping branches current
- Without a queue
- Each author rebases and re-runs by hand
- With a merge queue
- The queue builds the combinations for you
- Two green PRs that clash
- Without a queue
- Break trunk after merging
- With a merge queue
- Caught in the queue, before the merge
- Trunk state
- Without a queue
- Green until it isn't
- With a merge queue
- Validated combination, every merge
| Without a queue | With a merge queue | |
|---|---|---|
| What CI tests | Your branch vs a stale main | Your change plus everything landing before it |
| Keeping branches current | Each author rebases and re-runs by hand | The queue builds the combinations for you |
| Two green PRs that clash | Break trunk after merging | Caught in the queue, before the merge |
| Trunk state | Green until it isn't | Validated combination, every merge |
The queue moves the "does this combination work?" test from after the merge to before it.
How does the GitHub merge queue work today?
GitHub's merge queue has been generally available since 2023, and one cycle through it looks like this.
- 1A pull request passes its required checks and gets approved. Instead of merging, you click "Merge when ready," which adds it to the queue.
- 2GitHub creates a temporary branch (prefixed gh-readonly-queue/) containing the latest target branch, your change, and every change queued ahead of yours.
- 3CI runs against that temporary branch, triggered by a merge_group event, so what gets tested is exactly what main would become.
- 4If checks pass, the PR merges in first-in-first-out order. If they fail, the PR is removed from the queue and the temporary branches behind it are rebuilt without the failed change.
The removal step is the clever part. A failure doesn't jam the queue; the failed change is ejected and everything behind it revalidates against a combination that no longer includes it. The queue also has knobs worth knowing before you turn it on.
- Merge method
- Merge, rebase or squash, set per queue.
- Group size
- Minimum and maximum PRs merged per group (1–100), with a wait timeout for filling the minimum.
- Build concurrency
- How many merge_group CI runs can be in flight at once (1–100).
- Check timeout
- How long to wait on a status check before treating it as failed.
- Availability
- Public repos owned by an organization; private repos need GitHub Enterprise Cloud.
Settings per GitHub's merge queue docs. GitLab's equivalent, merge trains, is a Premium/Ultimate feature.
Your CI has to respond to the queue's temporary branches. GitHub Actions workflows need an explicit merge_group event trigger; third-party CI has to react to pushes on the gh-readonly-queue/ prefix. Miss this and queued PRs sit until the check timeout ejects them, one by one.
Why does agent-scale throughput make queues mandatory?
The racing-green-PRs problem scales with how many changes are in flight at once. A team of humans might hold ten open PRs; a team running parallel agents can hold fifty, opened faster than anyone merges them. Every extra in-flight change makes every branch's CI result staler by the time it lands, so the combination failures a human team hits monthly become a daily event, then an hourly one.
That is why the queue shows up in every serious pitch for agent infrastructure, including Origin's. Coverage of Cursor's Compile demo framed Origin around throughput no human team produces, a claim of 22.6 commits per second into one repo. At anything like that pace, "rebase and re-run before merging" is not a policy a person can execute. Something has to serialize the landings and validate the combinations, and that something is a queue.
There is a cost to name too. Once every merge flows through the queue, the queue is your merge capacity: CI time per group and group batching set the ceiling on how fast anything lands. Grouping helps (GitHub can validate up to 100 PRs in one group), but a slow test suite becomes a slow queue, which is a good reason to fix the suite before the volume arrives.
What does the Origin pitch imply about merge queues?
Origin is built by the Graphite team, and Graphite already ships a merge queue for its stacked-PR workflow; its announcement of the Cursor deal named the stacked PRs platform and merge queue as things it will keep investing in. Coverage of the Compile demo went further, describing Origin queues that keep CI green and automated fixes for failing builds. The expected shape is a stack-aware queue: one that understands dependent changes landing in order, not just independent PRs.
Where you can actually get a queue today is a shorter list than the coverage suggests, so here it is.
- Option
- GitHub merge queue
- Status
- Shipping since 2023
- Where it runs
- Org-owned public repos; private repos on Enterprise Cloud
- Option
- GitLab merge trains
- Status
- Shipping
- Where it runs
- GitLab Premium and Ultimate
- Option
- Graphite merge queue
- Status
- Shipping
- Where it runs
- Works with stacked PRs on top of GitHub
- Option
- Origin's queue
- Status
- Reported from the demo, unconfirmed
- Where it runs
- Waitlist-only; nothing published
| Option | Status | Where it runs |
|---|---|---|
| GitHub merge queue | Shipping since 2023 | Org-owned public repos; private repos on Enterprise Cloud |
| GitLab merge trains | Shipping | GitLab Premium and Ultimate |
| Graphite merge queue | Shipping | Works with stacked PRs on top of GitHub |
| Origin's queue | Reported from the demo, unconfirmed | Waitlist-only; nothing published |
As of July 2026. Three of the four exist today; the fourth is the one built for agent traffic first.
GitHub's and GitLab's queue mechanics come from their own docs, and Graphite's queue is a shipping product. Origin's merge queue and CI auto-fixes are reported from coverage of the Compile demo; cursor.com/origin publishes no feature list. Verify at launch before you plan a migration around them.
Frequently asked questions
What is the difference between a merge queue and requiring branches to be up to date?
Both test your change against the latest main before merging. The up-to-date rule makes each author rebase and re-run CI by hand, which collapses when many PRs are in flight because every merge invalidates everyone else. The queue automates the same validation, batches it, and merges in order.
Does a merge queue slow down merging?
It adds latency per PR, since your change waits for a validated combination instead of merging instantly. In exchange it removes the much larger cost of a broken trunk: reverts, blocked deploys and every branch rebasing onto a bad main. Group batching claws most of the throughput back.
Is GitHub's merge queue free?
It is available on public repositories owned by an organization at no extra cost. For private repositories the organization needs GitHub Enterprise Cloud. GitLab's equivalent, merge trains, requires a Premium or Ultimate tier.
Does Cursor Origin have a merge queue?
Reportedly. Coverage of the June 2026 Compile demo described queues that keep CI green plus automated fixes for failing builds, and the Graphite team behind Origin already ships a stack-aware merge queue as a product. Cursor has not published Origin's feature list, so treat the specifics as unconfirmed.
Sources & last verified
- GitHub Docs — Managing a merge queue
- GitLab Docs — Merge trains
- Graphite — Joining Cursor
- Cursor — Origin (waitlist)
Cursor ships frequently. Facts verified against primary sources on July 16, 2026.