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 them in order. Two pull requests that each passed CI can't combine into a broken main. GitHub has offered one since 2023, and Cursor's release notes describe one for Origin.

On this page
What is a merge queue?
A merge queue is a step between approval and merge. When you queue an approved pull request, the queue builds a temporary branch from the target branch, your change and every change queued ahead of yours. CI runs on that combination, and your change merges only if the combination passes.
The queue exists because the code CI tested on your branch is not the code main becomes. Your pull request passed against main as it was when you branched. By the time you merge, other changes have landed, and nothing has tested yours against them.
CI on your branch answers "does my change work against the main I branched from?" The queue asks whether it works against the main it will land on. The temporary branches and the merge order both exist to answer that second question.
This is covered hands-on in Cursor Compile 2026 — 1 short Unit, free to read.
Rather do it than read about it? Run 11 interactive Cursor walkthroughs in a simulated editor. Free, no account needed.
What problem do merge queues solve?
Merge queues stop two green pull requests from breaking main together. Take two open pull requests that both pass CI and get approved. One renames a function, and the other adds a call to the old name. Git sees no textual conflict and merges both, so main breaks even though every check passed.
GitHub's older answer is the branch protection rule "Require branches to be up to date before merging". It makes each author update their branch from the latest main and re-run CI before merging. With ten pull requests open, the first merge leaves the other nine out of date, and each author repeats the update by hand. GitHub's docs say the merge queue gives the same protection without that manual step.
- Feature
- What CI tests
- Without a queue
- Your branch against a stale main
- With a merge queue
- Your change plus everything landing before it
- Feature
- Keeping branches current
- Without a queue
- Each author updates and re-runs by hand
- With a merge queue
- The queue builds the combinations for you
- Feature
- Two green PRs that clash
- Without a queue
- Break main after they merge
- With a merge queue
- Caught in the queue, before the merge
- Feature
- Trunk state
- Without a queue
- Green until a clash lands
- With a merge queue
- Every merge lands a tested combination
| Feature | Without a queue | With a merge queue |
|---|---|---|
| What CI tests | Your branch against a stale main | Your change plus everything landing before it |
| Keeping branches current | Each author updates and re-runs by hand | The queue builds the combinations for you |
| Two green PRs that clash | Break main after they merge | Caught in the queue, before the merge |
| Trunk state | Green until a clash lands | Every merge lands a tested combination |
The queue moves the "does this combination work?" test from after the merge to before it.
Whether a queue is worth its wait depends on how many changes are in flight when main breaks. That number decides how many people the break stops and how long the fix waits to land. With three pull requests open, a broken main is a ten-minute fix. With twenty open, every one of them sits on a bad base.
How does the GitHub merge queue work today?
GitHub made its merge queue generally available in July 2023. One pass through it has four steps.
- 1A pull request passes all the checks its target branch requires. Someone with write access selects Merge when ready, which adds it to the queue instead of merging it.
- 2GitHub creates a temporary branch, prefixed gh-readonly-queue/, from the latest target branch, your change and every change queued ahead of yours.
- 3CI runs on that temporary branch. In GitHub Actions, the merge_group event starts it, so CI tests exactly what main would become.
- 4If the checks pass, the queue merges pull requests in first-in-first-out order. If they fail, it removes the pull request and rebuilds the temporary branches behind it without that change.
A failure costs the changes behind it a rebuild, but it doesn't stop the queue. Learn the queue's settings before you turn it on.
- Merge method
- Merge, rebase or squash, set per queue.
- Merge limits
- The minimum and maximum number of pull requests to merge at once (1 to 100), plus a wait time after which a smaller group merges.
- Build concurrency
- How many merge_group builds can run at once (1 to 100).
- Status check timeout
- How long the queue waits for CI before it treats the checks 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 and Ultimate feature.
Two settings decide whether the queue saves time or adds waiting. The minimum group size can stall a small team, because the queue holds merges until it fills that minimum or the wait time runs out. Set a minimum of five on a repo that lands three pull requests a day, and every merge waits out the full timer first. Build concurrency can slow it down too: at 1, the queue builds one merge group at a time, so each landing waits a full CI cycle.
Leave the minimum group size at 1 until you can see where queue time goes.
GitHub Actions workflows need the merge_group event as a trigger. Third-party CI has to run on pushes to branches that start with gh-readonly-queue/. Miss this, and queued pull requests wait until the status check timeout removes them, one by one.
If pull requests start leaving the queue instead of merging, check the runs on the gh-readonly-queue/ branches before you change a setting. A check that never started and a check that failed both end in a removal.
Why does agent-scale throughput make queues mandatory?
Clashes between green pull requests grow with the number of changes in flight. A team of people might hold ten open pull requests, while a team running parallel agents can hold fifty, opened faster than anyone merges them. Each extra open change leaves every branch's CI result older by the time it lands. A clash that a human team meets once a month can come daily, then hourly.
At that pace, nobody can update and re-run each branch before merging, so the ordering and the combination test move into the tooling. 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.
A queue also caps how fast anything lands. Once every merge goes through it, CI time per merge group sets the ceiling. GitHub can land up to 100 pull requests in one merge, but its docs note that merge limits don't combine merge_group builds, so every queued change still needs its own CI run. A slow test suite makes a slow queue, so speed up the suite before the volume arrives.
Flaky checks cost more than slow ones once the queue does the merging. A test that fails one run in twenty is survivable while a person can see it and select re-run. In the queue, a flake can remove a change that was fine, and every change behind it waits through another CI cycle. Raising the status check timeout won't help, because a flake arrives as a failure, not as a hang. GitHub's docs say that leaving "Only merge non-failing pull requests" unselected can help with intermittent failures: a pull request that failed can still merge in a group whose last pull request passed.
Quarantine flaky tests before you turn the queue on.
What does Origin's merge queue do?
Origin's merge queue tests each queued pull request on a merge commit or queue branch that Origin creates, then lands the ones that pass. Cursor describes it in the Origin release notes, and as of October 28, 2026, no page in the Origin section of its docs covers it.
- Settings
- Each repository's merge queue settings have Maximum speculation depth and Maximum concurrent validations fields, both up to 1000. New queues start at a depth of 5 with 5 concurrent validations, and a depth of 1 tests one pull request at a time.
- Merge when ready
- Merges a pull request once its requirements are met. It waits for ruleset rules to pass, even ones you could bypass. In the CLI, origin pr merge --auto turns it on.
- Removal
- The release notes name three reasons the queue removes a pull request on its own: failed required checks, a merge commit or queue branch that Origin repeatedly can't create, and a ruleset that blocks the queue's branches or refs. The pull request timeline shows a Removed from merge queue row.
- Notifications
- A Merge queue switch in personal Notifications settings sends a Slack DM when your pull request enters or leaves the queue. If checks removed it, the message lists up to 10 failing required checks.
- Audit trail
- Landings name Origin Merge Queue as the pusher in push webhooks and audit logs.
From the Origin release notes (weeks of September 28 to October 19, 2026) and the Origin CLI reference.
Origin's docs pages say little about how the queue behaves: the pull request docs still describe merging once reviews and CI are satisfied. The one docs mention we found sits outside the Origin section, in the Origin MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. Press Enter for the full definition. tool reference. It says that when a merge queue owns the target branch, a merge adds the pull request to the queue instead of landing it. If Origin queues a stack as one entry, its members land in one commit or none do. The CLI reference adds that merge when ready lands a stacked pull request once it's the lowest open member of its stack.
Graphite, which Cursor agreed to acquire, already ships a merge queue for its stacked pull requests on GitHub, and its announcement of the deal promised to double down on it. Launch coverage of the June 2026 Compile demo also described agents that fix failing builds. Cursor's Origin docs and release notes don't describe that feature.
- Option
- GitHub merge queue
- Status
- Generally available since July 2023
- Where it runs
- Org-owned public repos; private repos on GitHub 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 merge queue
- Status
- In Cursor's release notes since October 2026; not yet in the Origin docs pages
- Where it runs
- Origin repos, on plans that include Origin (not Free or Plus)
| Option | Status | Where it runs |
|---|---|---|
| GitHub merge queue | Generally available since July 2023 | Org-owned public repos; private repos on GitHub Enterprise Cloud |
| GitLab merge trains | Shipping | GitLab Premium and Ultimate |
| Graphite merge queue | Shipping | Works with stacked PRs on top of GitHub |
| Origin merge queue | In Cursor's release notes since October 2026; not yet in the Origin docs pages | Origin repos, on plans that include Origin (not Free or Plus) |
As of October 28, 2026. Origin's row comes from Cursor's release notes, because its docs pages don't cover the queue yet.
GitHub's and GitLab's queue mechanics come from their own docs, and Graphite's queue is a shipping product. Origin's queue comes from Cursor's release notes, and agents that fix failing builds come only from coverage of the Compile demo. Read the release notes and the Origin docs pages before you plan a migration around Origin's queue.
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 it merges. The up-to-date rule makes each author update their branch and re-run CI by hand, and with many pull requests open, every merge sends the others back to update again. A merge queue runs the same test for you and merges changes in order.
Does a merge queue slow down merging?
Each pull request waits longer, because it waits for a tested combination instead of merging at once. In exchange you avoid a broken main, with its reverts, blocked deploys and branches built on bad code. On GitHub, the build concurrency setting lets up to 100 merge group builds run at once, which shortens the wait.
Is GitHub's merge queue free?
For public repositories owned by an organization, yes: GitHub's docs make it available in any of them. Private repositories need an organization on GitHub Enterprise Cloud. GitLab's equivalent, merge trains, requires the Premium or Ultimate tier.
Does Cursor Origin have a merge queue?
Yes. Cursor's Origin release notes from October 2026 describe repository merge queue settings, Slack messages when a pull request enters or leaves the queue, and removal when required checks fail. The Origin docs pages don't cover it yet. To use Origin at all, you need Premium or higher, a Teams or Enterprise plan, or a legacy paid plan.
Why do pull requests get removed from a merge queue?
GitHub's docs list four reasons: CI reports failures for the merge group, CI doesn't answer before the status check timeout, someone removes the pull request, or a branch protection failure can't be resolved. Cursor's release notes describe Origin's queue removing pull requests when required checks fail, when Origin repeatedly fails to create the merge commit or queue branch, and when a ruleset blocks the queue's branches or refs.
Sources & last verified
- GitHub Docs: Managing a merge queue
- GitLab Docs: Merge trains
- Graphite: Joining Cursor
- Cursor: Origin
- Cursor Docs: Origin
- Cursor Docs: Origin release notes
- Cursor Docs: Origin pull requests
- Cursor Docs: Origin CLI pull request commands
- GitHub Changelog: Pull request merge queue is now generally available
- GitHub Docs: Merging a pull request with a merge queue
- eesel: What is Cursor Origin? (demo coverage)
- Cursor Docs: Origin MCP tool reference
Cursor ships frequently. Last updated October 28, 2026.