# Manager agent + worker agents in separate git worktrees: the orchestration patterns that survived contact with real overnight runs — retained record

> Retained reddit record from reddit:AI_Agents.

Canonical: https://highsignal.app/data/records/653086d7d4cf250c

[← sources](https://highsignal.app/data)


source: [reddit](https://highsignal.app/data/reddit) (reddit:AI_Agents)  published 2026-09-04 18:20 ingested 2026-09-05 02:37

[original source ↗](https://www.reddit.com/r/AI_Agents/comments/1w7ccdr/manager_agent_worker_agents_in_separate_git/)

## retained text



```
Architecture I ended up with, after a lot of things that did not work. Posting the orchestration side specifically, since most threads here focus on single-agent tool use.

Shape:

One long-lived manager agent. It plans, allocates, reviews and reconciles. It never writes code. Making this a hard rule rather than a tendency changed the quality of everything downstream.

Workers are separate headless agent processes, each pinned to its own git worktree, so two workers can never write the same file. One writer per worktree, always.

Every unit of work is a brief written to disk before dispatch, not a prompt typed into a channel. Every worker gets a unique report file path and writes findings there as it goes. The manager reads the report file; the worker's returned message is a convenience copy, never the source of truth.

Things that only became obvious after running it unattended:

Silence is not "no findings". One night, 6 of 10 workers ended without returning anything through the return channel. All of the work existed on disk. One had completed an entire phase gate I nearly re-dispatched from scratch. An idle agent is not a completed task, so I read the file first and only chase the actual gap.

Exit codes lie in both directions. I have had workers exit non-zero having fully succeeded, and exit zero having done nothing. The status line in the report file is the only signal I trust.

A grep over a log is also a liar. I had a ledger that grepped each worker's log for its trailing status string, and that string diverged from what the report actually said. Derived summaries rot; read the artifact.

Concurrency cap matters more than I expected. I run at most two workers at once. Beyond that they contend for the same test runners and dev ports, and I lose more time to phantom failures than I gain in parallelism. Related: never kill processes by name pattern, because a dev-stack script that kills everything on a port range will happily take out another lane's work.

Budgets in the prompt are advisory; watchdogs are not. I state a tool-call budget in every brief, and the runs that blow up are precisely the ones that ignore it. So there is now an external process that polls the session file, counts turns, and terminates past a cap.

Verification has to be adversarial and structural. The worker that wrote a change is never the one that verifies it, and never the one that reviews its own staged diff for scope. Both of those are separate agents with no knowledge of the change. This single rule fixed more than any prompt engineering I ever did.

What I am still unhappy with, and would love input on:

The manager's own context is the bottleneck on multi-day work. It rides for days behind a state file. I am considering a short-lived manager per phase, but I do not have a clean way to carry accumulated decisions across without a fresh manager re-reading everything.

Unit-of-work sizing. Many small briefs were very expensive because each worker pays a large re-orientation cost. Fewer, larger briefs are cheaper but drift further before anyone notices. Does anyone have a heuristic better than intuition?

Drift detection. Mine is a fresh agent that diffs current completion claims against the original acceptance criteria, because long chains reliably inflate their own progress. Is there something better than a periodic audit?

Has anyone automated the rule-improvement loop, where past sessions are mined for repeated corrections and turned into new enforcement? I do it by hand monthly and it is the highest-leverage hour I spend, but it should not be manual.
```



document fetched 2026-09-05 00:19 · canonical https://reddit.com/r/AI_Agents/comments/1w7ccdr/manager_agent_worker_agents_in_separate_git
