Bartender: Continuous Worktree Reconciliation with Author-Routed Conflict Handback for Resident Multi-Agent Development
When several coding agents edit one codebase, current tools use one of two arrangements. A shared working copy keeps every agent on the same state but lets them overwrite each other. Per-agent Git worktrees isolate work but are merged only on demand, one worktree at a time, and discarded afterwards, so branches drift apart between merges. This paper describes Bartender, the synchronization mechanism of Kota, an open-source environment for resident coding agents—agents that persist in a workspace across tasks and sessions. Bartender keeps a persistent worktree for each agent and synchronizes all worktrees frequently: it integrates every worktree that applies cleanly onto the shared branch, holds the ones that conflict, and hands each conflict back to the agent that authored it, together with the current base and the failing commit. We state the mechanism's premises and give a mathematical account of why it is designed this way. A discrete-event simulation then tests the expected benefits of frequent synchronization, and of real-time conflict resolution by the owning agent, against on-demand synchronization and human review. In the simulation, in-place repair needs up to 2.8 times as many repairs and 12 times as much repair work as Bartender at high overlap, and repairing each conflict at once keeps virtually every conflict resolvable within the observation window, where a wait of four characteristic times leaves 48–73 percent unresolved.
Authors
- Nan Wu (ORCID: https://orcid.org/0009-0001-4129-9569)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-09-16
- DOI
- https://doi.org/10.5281/zenodo.22802897
- Primary Topic
- Multi-Agent Systems and Negotiation
- Type
- preprint