No pull requests: your questions about bay, answered
Gudjon Gudjonsson · Founder and CEO of OZ · 25 November 2026
After a post in a developers' group, people asked us good questions about bay. The first one comes up again and again. Git merges two changes cleanly, and each one passes its checks alone, but together they fail a test. What does bay do? Then came more: what bay replaces, GitHub Actions, CI and CD, protected main branches, urgent fixes, and the UI. This post answers each one, and shows how a fleet runs all night.
The answers in short
Each answer has its own section below.
- Two green changes that fail together: bay checks them together before the merge, or finds the culprit after it.
- What bay replaces: pull requests, the merge queue, required status checks and CI. Git and your remote stay.
- GitHub Actions: your test scripts become checks in
.bay/policy.toml, and bay's runners run them. - CD: bay deploys nothing. Your deploy tool reads main, or a branch bay moves only onto green commits.
- Protections on main: let only the runner push to main, and keep force pushes blocked.
- New config: two TOML files on main, and your workflow files can go.
The other questions:
- An urgent fix: the agent writes it, and bay merges it once your required checks pass.
- The UI: your coding agent. Ask it, and it reads bay's results for you.
- Speed: one team's median wait fell from 465 minutes to 2.4, with up to 749 merges in a day.
- Pull requests: none. People steer with a clear plan before the merge, and
bay undoafter it. - The night: runners stay up, and agents wake only for an outcome they must act on.
- Getting started: try bay on a scratch branch first, then move one stream at a time.
Two green changes: the short answer
bay acts in two places: before the merge, and after it. Each place has a fixed process, and neither one waits for a person to notice. Before the merge, bay checks the exact tree that main will get, never a change alone. After the merge, a slow check that fails turns main red, and bay names the merge that did it. The fix or the undo is an ordinary change, and it goes first in line. bay never rewrites main's history.
What bay replaces
bay replaces the pull request, the merge queue and the required status checks. An agent opens a change, submits it once, and a runner merges the exact tree that passed. The runners run your checks on your own machines, so your CI moves into bay too. One team now runs no GitHub Actions at all. bay's runners run every check, and the team's own agent harness runs its deploys. GitHub stays as its backup of main, and as a place to share links to Markdown docs.
Before the merge: a change is never checked alone
bay merges a change only on evidence for the exact tree that main will get. Say changes A and B wait in line, and A goes first. Once A merges, B's candidate is B on top of the new main. So bay checks A and B together, the test fails, and B does not merge. B's agent gets CHECK_FAILED, with the failing check in detail. It repairs B on the new main, and runs bay merge again.
Runners do not wait for B's turn to find this. With [runner] ahead, a runner that does not hold the head checks the changes behind it early. It checks each one on the main that the changes ahead of it will make. A failure there shows in detail.precheck, and the change keeps its place until bay refuses it at its turn. With batch on, a runner also checks each change that no planned batch covers alone, on main's tip. If that check fails, a wake plugin wakes the change's author once.
# .bay/config.toml on main
[runner]
ahead = 4 # check up to 4 changes behind the head early; at most 16Like batch, ahead needs a key registry that signs everything, or reuse_unsigned = true in the policy.
Batches find the change that broke them
With batch, the head's runner checks the head and the changes behind it as one tree. On a pass, they all merge in one push. On a failure, bay halves the batch until a part passes, and a part of two or more merges. The next change is the one that broke it, and it runs alone at its turn. The changes behind it go back in line, and the next batch reads the search's records on them. bay stops batching while the recent failure rate is above max_failure_rate.
# .bay/config.toml on main
[runner]
batch = { min = 2, max = 8, max_failure_rate = 0.3 }After the merge: main turns red, and bay finds the cause
Some checks are too slow for every change, such as a whole-tree test suite. Mark them stage = "post", and they run on main after the merge, so they never block one. A runner runs each one on main's newest commit, so many merges share one run. Now A and B can both merge, and the post check fails on main. When a post check's newest run on main fails, main is red on that check's paths. bay works this out from the check records each time it reads them, and no person sets it.
# .bay/policy.toml on main
[[check]]
id = "whole-tree"
stage = "post" # runs on main after the merge
environment = "linux-x86_64"
command = "scripts/bay-check whole-tree"
# .bay/config.toml on main
[runner]
post = true
bisect_post = true # find the merge that turned main redWhat happens while main is red
From there, bay goes on with no person in the loop.
- bay finds the culprit: with
bisect_post, a runner checks the middle merge, and halves the range each time. - It rules out a flake: at one merge left, it runs the check once more. A pass names no one.
- It costs few runs: n merges take at most log2(n) runs, rounded up, plus that one. Eight take four.
- The owner hears: bay tells the culprit's session how to fix it, and again if a later bisection names it.
- No change makes it worse: a change on its paths runs the check first, and a new failure refuses it.
- The repair goes first: a fix or an undo of the culprit goes ahead of the line.
Back to A and B
Say the post check passed on A's merge and failed on B's. Then the evidence leaves one merge between the pass and the failure: B. bay names B the culprit, though B passed every check it ran before its merge. B's session hears one line, such as this one:
bay: change m3x7qdk2: main is red on whole-tree; your change broke it: the check passed on the merge before it and failed on it. Changes on its paths run it before they merge. Fix it with a new change: bay start <intent> --fixes m3x7qdk2Fix it, or undo it
Both are ordinary changes, with the same required checks as any other. A fix names the merge it fixes in a Fixes: trailer. An undo takes B's edits back out of current main, in a new commit with a Reverts: trailer. After a fix, the check stays pending_fix until a new run passes, and never turns green before. Since bay 0.7.29, [red] undo_after_s lets a runner make the undo on its own when no fix comes in time.
bay start "Fix the whole-tree test" --fixes m3x7qdk2 # a fix, named in a Fixes: trailer
bay undo m3x7qdk2 # or take B back out with a new, checked changeYour CI: checks are shell commands
Two files on main take the place of your workflow files: .bay/config.toml and .bay/policy.toml. Each required check in the policy is a shell command, so your test scripts move as they are. bay runs a check with only the variables in env. It has no network unless its entry says network = true, or the machine set bay.runnerSandbox none. With expected_minimum, a check that finds fewer tests than that blocks the merge. If you keep some workflows, they still run: each bay merge is a plain push to main.
# .bay/policy.toml on main
[[check]]
id = "tests"
environment = "linux-x86_64"
command = "scripts/bay-check tests" # your own test script
adapter = ["scripts/bay-check"] # every file that decides the verdict
when_paths = ["src/**", "tests/**"] # a change elsewhere skips it
expected_minimum = 400 # fewer tests found blocks the merge
env = ["DATABASE_URL"] # the only variables the check getsWhere the checks run
bay has no hosted runners: a runner is bay runner run on a machine you own. A Linux or macOS server, cloud machine or spare desktop works, and bay runner install keeps it up as a service. Each runner serves the environments you name, such as linux-x86_64, so one check can run on several systems. A secret stays on the runner: list its name in env, and bay passes it to the check. Its name enters the check's digest, and its value never does. A CI system can also act as the runner, through the external runner contract on the Runners page.
Your CD: deploy from a branch bay keeps
bay deploys nothing: your deploy tool reads a branch, as it does today. A promotion target, such as staging, can name the checks it requires. With advance = true, a runner moves staging to main's newest commit on which they all passed. On a host from bay host, the hook refuses a push of a target onto a commit that breaks its rule. So a broken pair can reach main, but advance never moves staging onto it. A [[hold]] with a target freezes that branch: until its end, only a fix or an undo reaches it.
# .bay/config.toml on main
[[target]]
name = "staging"
requires = ["whole-tree"] # checks that must pass on the promoted commit
advance = true # a runner moves staging to main's newest promotable commit
[[target]]
name = "production"
from = "staging"
requires = ["whole-tree"]
[[hold]]
target = "production" # a freeze: main keeps merging
start = "2026-12-23T00:00:00Z"
end = "2026-12-27T00:00:00Z"
reason = "holiday freeze"Protect main
On GitHub, a branch ruleset can let only the runner push to main. Turn on its Restrict updates rule, and give the bypass to a team of one: the runner's account. Keep Block force pushes on: bay never forces a push to main. With bay's hooks, bay also refuses an agent's own push of main, so agents merge through bay. Without such a rule, bay names each commit that reached main around it, but cannot stop it. On a host from bay host with a key registry that signs everything, the host refuses such a push.
An urgent fix
The agent writes the hotfix too, like any other change. Tell it what broke, and it opens a change with --fixes, then runs bay merge. The fix merges as fast as your required checks run, plus its wait in line. So keep the checks before the merge few and fast, and run the slow ones after it. When the bad merge turned main red, its fix or undo goes ahead of the line. When production is down and main is green, hold main: then only fixes and undos merge.
bay start "Fix the checkout crash" --fixes m3x7qdk2 # names the bad merge in a Fixes: trailer
bay merge
bay undo m3x7qdk2 # or take that merge back outA hold plugin is the switch: your incident tool answers held, and every other change gives up its place. A person can still push main directly on GitHub, if the rules allow it. bay then names that commit as outside_bay, and each change in line checks again on the new main. One team had 67 such commits on 26 October, and none from 31 October on. That was the first of the six steps that cut its median wait to minutes.
# .bay/config.toml on main
[plugin.hold]
command = "scripts/bay-hold" # answers {"held": true|false, "reason": "..."} to "status"The cost, plainly
Main can be red for some minutes on the paths that broke. In return, no change waits in line behind a slow test suite. Keep before the merge what an undo cannot take back. A secret that reaches main stays in its history after an undo. A change to .bay/ decides how bay judges every change after it. And bay refuses an approval check with stage = "post": a person's yes comes before a merge.
Why it is faster
A main that merges one change at a time has a hard ceiling. It takes at most 1,440 ÷ the head's minutes merges a day. The head is the build, the checks and the push of one change. With a 20-minute suite before each merge, that is at most 72 merges a day. Move the suite after the merge, and a two-minute head allows up to 720. With batch, one passing run merges up to max changes at once.
These are ceilings, not promises: your checks and machines decide what you get.
One team runs 50 to 150 coding agents around the clock. It sends every change through bay. In one month, its median wait from bay merge to main fell from 465 minutes to 2.4. On its busiest day, it merged 749 changes. Slow whole-tree checks after the merge were one of six steps. From hours to minutes, on this blog, shows each step and its numbers.
These are one team's numbers, on its own checks and machines. Measure your own before you plan on them.
Tune bay to your team
Our purpose with bay is much faster merges and, at the same time, higher quality on main. So each merge is the exact tree that passed its required checks, and the line keeps moving. No one setting fits every team, so bay's configuration is rich. Two files on main hold it: .bay/config.toml for the repository, and .bay/policy.toml for the checks. Each team tunes bay to its code, checks, machines and tools, and tunes it again as they change.
- Which checks run: each check names its command, its
environment, and the paths inwhen_pathsthat need it. - Before or after the merge:
stage = "post"moves a slow check after the merge, so it never blocks one. - How fast the line moves:
batchchecks several changes as one tree, andaheadchecks the next ones early. - What a break does:
bisect_postnames the culprit, and[red] windowandreachset how far bay reads. - Where a person decides: an approval check names the paths that wait for a signed yes.
- What moves past main: each
[[target]]names the checks that a branch such asstagingrequires.
bay also fits the tools a team already has.
- Any build or test tool: a check is a shell command, so any tool can be one.
- Any agent product: every agent product that runs shell commands gets the same merge promises.
- Hooks: with bay's hooks, Claude Code and Codex also get early refusals and notices.
- Plugins: a wake plugin wakes your agents, and a notify plugin feeds your chat or dashboard.
- Any Git remote: bay keeps its records in your own Git remote, such as GitHub.
Start with few, fast checks before the merge, and move slow ones after it. Then change one setting at a time, and measure what it does. The Configuration page lists every key.
No pull requests
A pull request asks a person to read each change before it merges. That works at the pace of people. With dozens of agents, the reading becomes the line, and the line is the cost. bay has no pull requests. People steer before the merge, with a clear plan, and after it, with bay undo.
Before the merge, the repository says what people want, in words an agent reads. The plan lives next to the code, and .bay/policy.toml on main lists the checks each change needs. After the merge, undo a change that goes against what people want. The undo is a new, checked change, and main keeps its history.
The first week: trust bay and the agent
Expect many mistakes in the first week, from agents and from your first config. Each mistake an agent makes shows a gap in what people wrote down. Close it where the next agent reads it: in the plan, in a check, or in the config. Then the next agent meets that rule before it merges, not a person after. After that, the speed comes: one team's median wait fell from 465 minutes to 8.3 in four days. Trust the process, let the agents work, and fix the plan, not each change.
A person still decides where it counts
An approval check holds a change to chosen paths, such as billing/, until an enrolled approver signs a yes. A change elsewhere merges without one. Any review tool can read each merge after it merges, and add a review record. A review never decides a merge, and no model sits in bay's decision.
The UI is your coding agent
bay has no web pages and no app, and it needs none. Ask your agent what merged tonight, what is red, or who waits for a person. It reads bay status --all and bay status --since, and answers in plain words. No one needs to open GitHub to read a check run, and agents trade no messages about workflows. To change how bay works, ask the agent to edit .bay/config.toml or .bay/policy.toml. That edit is a change like any other, checked and merged through bay.
For an overview, ask Claude Code to build a Claude Artifact from bay's results. It can show what your team needs, such as the line, the red checks and the night's merges. An Artifact lives on claude.ai, so the results you put in it go there too. GitHub then becomes a backup of main, and a place to share links to Markdown docs. With an origin from bay host --upstream, bay's traffic stays on your network, and GitHub stays current.
Run the fleet all night
The last question: how does a fleet run overnight, without a person at each step? Harnesses that run for days and weeks need bay to go on while no one watches. First, keep the runners up.
- Runners as services:
bay runner installwrites a launchd agent or a systemd user unit that restarts the runner. - Updates on their own: at most once an hour, bay installs a newer release, never during a merge.
- New versions between merges: on macOS and Linux, a runner updates between operations and keeps its process id.
- No stuck head: a head past its time budget loses its place, so one change never holds the line.
Second, agents hear only what they must act on.
- Submit and go:
bay mergereturns at once, and a runner merges the change after its agent leaves. - One background wait:
bay merge <change> --wait=3600replaces repeated status reads. - Wake on the outcome: an idle Claude Code session wakes once with each outcome of a merge it left queued.
- Quiet retries: a block that bay retries on its own wakes no one.
- The right author: with a wake plugin, a runner wakes an author once, for an outcome they must act on.
- No lost refusals: a refusal that arrives after the agent left reaches that agent's next session.
Third, people come in only where it counts.
- Agents ask agents: with
bay talk, an agent asks another for one change, decision or check. - Approvals wait alone: a change to approval paths waits for a yes, and changes elsewhere merge.
- See who needs a person:
bay status --allnames each session that waits for a person, and why. - Read the night: in the morning,
bay status --sincelists the merges and events since you last looked. - Or get each event: the notify plugin can send each event to a chat or a dashboard.
Try it
bay is free and open source, under the MIT license, with no paid tier and no account. It works with any Git remote, such as GitHub, and needs no server of ours. Try it first on a scratch branch, such as bay-trial, then move one stream at a time. People who still work on branches can hand one to bay with bay merge --from <branch>. If you stop, main is plain Git: every merge stays a normal commit. Adopt bay step by step and the Quickstart in the docs show each step.
Merge more changes a day and Undo a merge go deeper on speed and repairs. Send us your next question, and a later post can answer it.
Gudjon Gudjonsson · Founder and CEO of OZ