Agents on the release train: how we ship
Many coding agents, one release path: a worktree per session, small commits to main, and one orchestrator shipping one commit through one CI run.
Many coding agents, one release path: a worktree per session, small commits to main, and one orchestrator shipping one commit through one CI run.
Coding agents optimise for finishing the task, not your scope, so drift builds up. Write scope as a contract, turn criteria into tests and verify continuously.
Each customer's Twin runs as a full stack on its own server, shipped as immutable images through one path: one CI run, staging, then production on one commit.
A recurring report. A slow review. A prototype that needs to work in the real world.
A small team can run many coding agents on a production platform without chaos if writing code and shipping it stay strictly apart. Each agent session works in its own git worktree and lands small, checked commits straight onto main. One session alone, the release orchestrator, takes a commit to production along one release train: cut a release tag, run CI once on it, verify that exact commit on staging, then ship the same commit to production. Nothing reaches a customer any other way.
That's how we build and ship the Company Twin, where agents now write most commits. Quality rests on checks rather than trust: every session runs the typecheck and affected tests before pushing, the release's single CI run gates production, the author verifies its change on staging, and independent review sits on top. In the last mile problem for coding agents, we looked at keeping one agent on scope; here's how we keep many of them out of each other's way.
Key takeaways
Simple rule: no two sessions ever share a working directory. Every agent session gets its own git worktree, cut from the tip of main, with five rules about everyone else's work:
It's classic trunk-based development, and coding agents make the case for it twice as strong. They produce changes fast and in parallel, so a branch that sits open for a week racks up conflicts with code nobody has read yet. Small commits straight to main keep merges tiny, make every change attributable, and letgit bisect pinpoint a regression in minutes. Every commit uses Conventional Commits with a co-author trailer naming the agent that wrote it, so the log always shows who (or what) changed what.
One shared resource needed its own rule. A local container instance that several sessions test against runs only pushed main, rebuilt by one owner from a clean checkout nobody edits. A session rebuilding it from its own worktree would yank every other session's code out from under them, so none are allowed to.
Because every other setup we tried failed in ways that were hard to spot. We started with an automatic release train and retired it in favour of explicit releases. We built a coordination service for release requests; it just stuck another moving part between every agent and every release, so we tore it out in September. We tried letting each session stage its own commits; their staging deploys overwrote each other, and a few commits hit staging without CI.
So one session, the release orchestrator, alone cuts release tags and deploys staging and production. Releasing is procedural work, which suits one patient session: inspect the range, cut the tag, wait for Test, stage, verify, roll out in waves. Everyone else pushes to main and hands over.
Once a session's change lands on main, it hands over without waiting to be asked. It files or updates a release record on the board with the commits, the services they deploy and anything they need (a migration, a secret, a customer's go-ahead), then messages the orchestrator with the commit and what to check. The orchestrator batches whatever is ready:
We used to run CI twice: once on every push to main, then again on the tag. The exact same release went out either way, while the duplicate doubled load on the same runners. Now the rule is one CI run per release, and precut gives any session quick local feedback before it pushes.
The final step goes back to the session that wrote the code. Once staging is serving a release with its commit, that session verifies the affected user flow on staging, comments the proof on the board record, and reports the URL, the commit actually serving and the outcome. A pushed commit, a filed request or a queued rollout is not delivery; only the verified flow is.
The board is the Tasks channel inside our own Twin, and agents drive it through the same CLI any customer uses. Each piece of work gets one record rather than one per session or commit, with a kind and a reference that's never reused:
| Kind | Ref | Holds |
|---|---|---|
| Task or project | W | A piece of work, its owner and what done means |
| Decision | D | A choice a person must make, with the options |
| Release | R | The commits, what they deploy, what they need and the rollout state |
| Check | C | Something to try on a build |
| Incident | I | What broke, with a neutral title when the detail is sensitive |
Fields hold current state: status and owner; Waiting on and Ask; the agent, its session and latest update; commits, deploys, needs and rollout; done when, and the evidence. Comments hold history: progress, findings and proof. Saved views give everyone their slice: what needs me, which agents are working, the release train, open decisions and what's ready to test.
When an agent needs a human decision, it sets Waiting on to that person, writes the Ask with its recommendation first and the options underneath, and mentions them so they're notified in the app and in Slack. People reply by comment or in chat by reference ("D106 a"). Nobody has to babysit an agent's terminal to see what it's blocked on.
Writes follow normal shared-database hygiene: agents read before writing, pass the record's version (or an idempotency key for a new record) and read the result back. Even then, two agents once grabbed the same next reference at the exact same millisecond; the fix was to retry "take the next number and add" until the board confirms creation.
Agents repeat mistakes with a consistency humans don't, which is actually good news, because a repeatable mistake can be designed out. The clearest example was shell exit codes.
# Wrong: the pipeline's status is tail's, so a failing test still pushes.bun test src/feature | tail -3 && git push # Wrong: the ';' means nothing stops after the check.bun run check:lists > log; echo "exit=$?"; git push # Right: gate the push on the check's own exit code.bun run check:lists > log 2>&1 || { tail log; exit 1; }git pushOver four days, sessions pushed past a failing check this way seven times. Most were harmless. One wasn't: a script marched straight past a failed check because || exit 1 only saw the exit status of tail. A close cousin hid failures in background logs: writing check > log; echo exit=$? >> log always exits zero because echo ran last. And a fresh worktree without dependencies installed fails every check in milliseconds, so a recheck has to run on a checkout that actually matches what's being pushed.
The guardrails that stuck:
Implementation stages
The parallel-session cap came from one evening when twelve sessions ran at once on a single machine. Load average climbed past 20 (and at times past 60), five-second test timeouts failed in almost every session, and five sessions finished with good work stranded as local commits. Running more sessions didn't ship more work; it just left more of it one step short of main.
One thing is deliberately absent from our guardrails: asking a human to click approve on every tool call. Checks are automated and boundaries are structural. No agent holds a production credential: no server key, no shell on a customer box, no deployment database. The orchestrator submits signed, short-lived requests; a separate runner checks each against policy and executes it. Other sessions can't deploy at all, and the governed door is the only way in. Safety comes from those boundaries rather than a stream of approval prompts nobody reads.
Decisions, release timing and anything a customer has to agree to. The orchestrator ships when a person gives the go-ahead rather than on its own schedule. A migration's safety review is signed by a person: an agent drafts and proves it, yet doesn't sign it. And every agent instruction file carries the decisions people have made alongside the reasons behind them, so the next session doesn't relitigate them. Skills and instructions are hypotheses to test rather than prompts to polish, as our product team sets out in a skill is a hypothesis.
If you're moving from one coding agent to several, the order matters:
We set this up with client engineering teams as part of delivery, alongside the evaluation practice in evaluating AI systems at scale.
We put this same engineering discipline (isolated worktrees, one release path and staging proof) into client teams. Read how we deliver →