process · tooling · deployment · ecowell · ai
Several AI Agents, One Codebase: What Went Wrong and What I Changed
Ecowell has seven web portals, a mobile app and one backend. To move faster I ran up to four coding agents at a time, each in its own git worktree and branch, each leaving a hand-off note when it finished. I reviewed, tested, committed and deployed.
It worked. It also broke things in ways I did not expect. Here are the five rules I wrote down afterwards.

The setup that helped
- One worktree per agent, so two agents never edit the same files.
- A hand-off file from each agent: what it did, what it did not do.
- Agents could write code but not commit or reach the database. I did that part, which kept review in one place.
The five problems
| # | What happened | The rule now |
|---|---|---|
| 1 | A deploy of one portal replaced a newer version that was already live | Before deploying, check that the live commit is an ancestor of mine |
| 2 | Uncommitted work in a main checkout was already live, and a deploy from a worktree would have erased it | Diff the main checkout before redeploying anything |
| 3 | An agent’s command to stop an emulator also stopped the agent | Never give an agent a command that matches its own command line |
| 4 | A “done” marker file arrived through a git branch from an old task | Judge completion by the process exit and the real output, not by a marker |
| 5 | One agent quietly gave up on a large SQL task, others finished theirs | Verify each deliverable. An agent’s confidence tells you nothing |
Rule 1 in detail
On 29 November two deploys overwrote newer features. The portals are hosted on Cloudflare Pages, and every deploy simply replaces what is live. I restored both by rebuilding from the right commit. The permanent fix is a two-line check:
# live commit comes from `wrangler pages deployment list`
git merge-base --is-ancestor <live-commit> HEAD && echo "safe to deploy"
If the answer is no, my branch is missing something that is already live.

Rule 3 in detail
Each agent’s whole brief is part of its own command line. When I told one to run pkill -f emulator, the pattern matched the agent’s own process, so it killed itself. Now briefs go in a file, and agents stop things by exact process id or by the tool’s own shutdown command.
What I would tell someone starting out
- Parallel work needs isolation first. Separate branches and folders cost nothing and prevent most collisions.
- You are the integration step. Agents produce pieces. You are responsible for how they fit together.
- Check what is live, not what you remember. The state of production is a fact you can query.
- Write the rule down the first time it bites. All five rules above came from one bad afternoon each.