# bay 0.7: an origin near your machines

> bay 0.7 serves bay's traffic from an origin on your own network, and the hosted remote stays current. Each machine also sets its own limits.

Gudjon Gudjonsson, Founder and CEO of OZ. 2026-11-25. Source: https://getbay.io/blog/bay-0-7 (HTML).

bay 0.7.0 came out yesterday. bay is for teams that run many coding agents in one codebase, often on the same files. Git itself is fine, but the human-paced branch and merge workflow breaks at that speed. With bay, each agent submits once, and bay merges only what passed on the latest main. The 0.7 releases move bay's traffic near your machines, and let each machine set its own limits.

## An origin near your machines

Many teams keep main on a hosted remote, such as GitHub. Each `git fetch`, `git pull` and `git push` then goes to the hosted remote and back. A clone fetches the newest main, and each agent pushes its work, across the internet every time. An origin is a bay host on your own network that keeps the hosted remote current. bay's reads then make a round trip on the local network. The origin pushes to the hosted remote with its own machine's Git login.

```sh
# On the origin's machine
bay host /srv/git/app.git --upstream git@github.com:example/app.git
bay host serve /srv/git/app.git   # keep it running under a supervisor
```

Move every machine to bay 0.7 first. An older bay refuses `[origin]`, so each of its commands that reads the config fails. Then merge the origin's address into `.bay/config.toml` on main. bay sends its refs, its notes and main through the origin. Other branches and tags keep their remote. Serve your machines from an origin, at getbay.io/docs/origin, shows each step.

```toml
# .bay/config.toml on main
[origin]
url = "ssh://git.internal/srv/git/app.git"
```

## The hosted remote stays current

A new origin works in `through` mode. It takes a push only after the hosted remote took it. If another writer moved that ref on the hosted remote first, the origin refuses the push as stale. bay then reads the new value and tries again. `bay host serve` brings in what other writers push to the hosted remote, so the two stay in step.

## Faster still: tail mode

In `tail` mode, the origin holds the newest copy of bay's own refs and notes. They reach the hosted remote in the next pass of `bay host serve`. Main still goes to the hosted remote first, and the origin takes it only after the hosted remote did. What is live on one machine, such as leases and runner records, stays on the origin. The origin logs a ref that another writer moved on the hosted remote as `STRAY`, and writes over it.

```sh
git config bay.upstreamMode tail   # in the origin, after a day with no strays
```

Switch only after a whole day in which the serve's log shows no pass with `mirrored.strays` above 0. Then no other writer still writes bay's refs to the hosted remote. An origin that tails stays in `tail` mode, even if its config says `through` again. At that point the hosted remote can be behind, and its values would undo newer writes. If the origin does not answer, each machine uses the hosted remote, unless the origin wrote there that it tails. `bay doctor` in the origin names its hosted remote and its mode, and goes red without its hook.

## One push less for each merge

A merge's checked record and its evidence now go out in the merge's own push. That saves one push to the host for each merge. A host from `bay host` judges main on the evidence in that push, as well as on stored evidence.

## Each machine sets its own limits

A runner's machine often runs other work too. Now the machine can say when it is too busy to start a check. `bay.checkStartLoad1` sets a limit on the one-minute load average. `bay.checkStartCpuSome` sets a limit on CPU pressure, in percent. At or above either limit, the runner claims nothing new, and the change waits with `BOX_BUSY`. A runner on another machine takes it, or this one does once the load falls below both limits.

```sh
git config --global bay.checkStartLoad1 24     # start no check at load 24 or above
git config --global bay.checkStartCpuSome 40   # or at 40 % CPU pressure
```

bay judges these two limits on Linux only. Two more keys let one machine take a smaller share of the work. `bay.runnerParallelChecks` and `bay.runnerAhead` only lower the repository's `[runner]` values on that machine, and never raise them. The runner reads each one when it uses it, so a new value needs no restart.

## Agents wait in the background

An agent now waits for its merge with one background command. The wait hears of a merge on another machine within one heartbeat of its runner. bay's agent texts name this wait in place of status reads. bay's skill shows one script for each change: start, edit, commit, merge and that wait.

```sh
bay merge <change> --wait=3600   # run it as a background task
```

## Batches merge more of what passed

- **Early passes count**: a head merges the longest front part of its batch that passed a check before its turn.
- **Past a head in its check**: a change can merge first when that check never read or listed it.
- **Even batches**: with footprint lanes, a batch ends at a change whose slowest check is slower than the head's slowest.

## Logs that say more

- **What a change waits behind**: a queued change names the head it waits behind, and that head's holder.
- **Why a push failed**: a runner's journal names why the host refused a merge's push, with the host's own reason.
- **Tree time**: a check's log names how long bay took to make its tree, and if it was whole.

## Get started

bay is free and open source under the MIT licence, with no paid tier and no account. Install bay on a new machine, or run `bay update` on a machine that has it. 0.x means a minor release can still change a command, and the changelog names each change.

```sh
curl -fsSL https://getbay.io/install.sh | sh   # a new machine
bay update                                      # a machine with bay
```
