← Blog ·

How I run a software factory with agents

In 30 days, my main project merged 211 pull requests. Agents wrote, tested and reviewed most of the code; I chose the product behaviour and merged the product PRs. The agents run in terminal sessions on a development VM, supervised by a remote orchestrator. A local orchestrator on my machine supervises that remote one and manages the infrastructure.

  • 211 PRs merged in 30 days
  • 1 human making product decisions
  • 2 orchestrators in a hierarchy
  • 30 min between remote sweeps

01 · Responsibilities

Who controls what

The local orchestrator holds the cloud credentials and can repair the VM when the remote one cannot run. The remote orchestrator runs the agents day to day. Select a box to see its responsibilities below.

Who runs and who watches whomThe human reviews the local orchestrator, which supervises the remote orchestrator on the VM. The remote orchestrator runs the agent fleet. Cloud credentials stay on the local machine. Supervision runs from local to remote only; the human can also contact the remote orchestrator by phone.CLOUD DEV VM · 62 GB RAM · ONE WEZTERM MUX · ONE UNIX SOCKETreviewsphonesupervisesrepairssend-text · get-textPRs →Meproduct decisions & mergesLocal orchestratormy machine⚿ holds the cloud loginsRemote orchestrator/loop every 30 minno cloud credentialsAgentsone workspace per agent, coloured by identitysollunaastraFableOpusGrokflashMiMoDevinowner · executor · reviewer, one role per pane

Me the human

Does

  • Review the local orchestrator
  • Choose product behaviour and answer blocking questions
  • Merge every product PR

Never

  • Delegate the final product decision to reviewer consensus

Local orchestrator my machine

Does

  • Hold the cloud logins (Azure, AWS, Cloudflare)
  • Supervise the remote orchestrator and review its work
  • Repair the VM

Never

  • Delegate its cloud credentials to the remote orchestrator

Remote orchestrator development VM · every 30 min

Does

  • Sweep every agent pane, nudge the stalled ones
  • Route CI failures and review threads to their owner
  • Launch review rounds and report progress
  • Merge CI-only and runner-only PRs

Never

  • Hold a cloud credential
  • Supervise or control the local orchestrator
  • Merge a product PR

Agents one WezTerm mux · one unix socket

Does

  • Owner: carry the change through implementation and review
  • Executor: complete a delegated task
  • Reviewer: return findings for one review round

Never

  • Merge

Supervision runs one way, from local to remote. The remote orchestrator cannot control the local one and holds no cloud credentials. I can also follow the remote one from my phone through Remote Control and answer when it asks.

02 · Work loop

From an assigned task to a merge

The PR is the unit of work: its specification, tests, implementation, CI results and review discussions travel together. The owner agent handles the change; an executor can carry out delegated work, and a reviewer examines one round of it. Review findings and CI failures go back to the owner.

The remote orchestrator's 30-minute sweep

Agent waiting or stalled
Read the pane and follow up with that agent.
Failed CI or a review finding
Route it to the PR owner to investigate and fix.
Ready for review
Launch a new reviewer round with a fresh brief.
Unresolved product behaviour
Collect the alternatives for my decision.
Example of a concrete task brief

Illustrative format, using the decision below. This is a task description, not a captured run or a tool configuration.

Task: implement the scoped-ID response contract
Blocked on: human choice for D05
Scope: update and delete by internal ID with a filter
Cases to cover:
  - record exists and matches the filter
  - record exists but is excluded by the filter
  - record does not exist
Report: reports/scoped-id-contract.md
Include: changed files, checks run, remaining questions

A question about intended behaviour comes back to me through the decision artifact below. Once I have chosen, the implementation and tests have to match that choice. After the checks and review rounds are complete, I merge the product PR. The remote orchestrator may merge CI-only and runner-only changes.

03 · Terminal control

How the orchestrator talks to an agent

A harness is the command-line application running an agent, such as Claude Code or Codex CLI. The harness runs on the VM. My Windows WezTerm window connects over SSH through Tailscale to aWezTerm mux server: the service on the VM that owns its terminal windows, tabs and panes. Its Unix socket is local to the VM; the WezTerm protocol is carried through SSH.

On the main project's VM, my agent-spawn script creates a named workspace and, by default when tmux is installed, starts the harness in a detached tmux session. A WezTerm pane attaches to that session. The workspace groups the terminals; tmux keeps the agent running if its pane is closed. A Git worktree separately provides the code checkout.

  1. Windows clientWezTerm GUI and workspace pickerConnects over SSH through Tailscale
  2. VM: WezTerm muxWorkspace → tab → paneThe orchestrator reads and writes panes through its Unix socket
  3. VM: tmux + agentA detached session owns the harnessThe pane attaches; the agent can survive the pane closing
# on the VM, after installing the agent scripts and a harness
$ export WEZTERM_UNIX_SOCKET="$HOME/.local/state/wezterm/dev-server.sock"
$ agent-spawn review-123 "$HOME/projects/my-project" codex my-model -- codex
41 # example remote pane ID returned by the launcher

# send the prompt, submit it, then read the output
$ wezterm cli --no-auto-start send-text --pane-id 41 "resume the review of round 3"
$ printf '\r' | wezterm cli --no-auto-start send-text --no-paste --pane-id 41
$ wezterm cli --no-auto-start get-text --pane-id 41 | tail -n 40

# run record (illustrative values)
  workspace / tmux: review-123   conversation: <saved-session-id>
  model: <actual-harness-model>   cwd: <working-directory>
  pid: 4711   report: reports/pr-123-round-3.md
owner · solreviewer · Fableexecutor · lunareviewer · Grokorchestrator

The remote orchestrator uses that same mux socket to write withsend-text and read withget-text. Sending text types the prompt; the separate carriage return submits it. These commands run on the VM, using the remote pane ID returned by the launcher or wezterm cli list.

Finding a session and keeping it alive

My session manager opens with Ctrl+Shift+S. I can search the workspaces, select one, or create one withCtrl+Shift+A. The launcher sets CLI_IDENTITY and CLI_MODEL so the picker can show the harness and model. These arguments are labels; the harness's own configuration or command-line options choose the actual model. The shared launcher and picker now serve four project VMs; the agent commands here describe the main project's setup.

What happens to an agent started with tmux enabled
EventWhat survives
Laptop disconnects or loses its networkThe agent keeps running on the VM. Reopen the box shortcut to reconnect.
Its WezTerm pane is explicitly closedThe tmux session keeps running. Attach again with tmux attach-session -t '=review-123'.
The agent's work is finishedagent-kill review-123 stops the named tmux session and closes its remaining panes.
The VM shuts down or rebootsThe live processes end. Resume from the harness's saved conversation and the written task report.

The picker lists WezTerm workspaces, so a detached tmux session can outlive its entry there. Closing panes with Delete in the picker does not necessarily stop the agent inside tmux. With AGENT_SPAWN_TMUX=0, or without tmux installed, the harness runs directly in the pane and loses that extra protection.

The pane ID targets a terminal. The workspace and tmux names group running processes. The harness session ID resumes a conversation. Each delegated run records its session ID, model, working directory, owned process and report path. The report preserves progress and open questions across sessions.

04 · Product decisions

Batch the questions that need my decision

Should an update to a missing record return an error or a result saying nothing changed? Either can be implemented and tested. The agent needs a product decision before it can choose the right tests.

As questions accumulate, I have them collected into an HTML artifact. Each entry shows the current behaviour, blocked PRs, alternatives and trade-offs. Fable and Astra recommend an option and score the alternatives. I go through the batch and choose. One button accepts every entry where the two agree.

Here is one entry, adapted into English. Try selecting an option. Choices on this page are not saved.

Inside the artifactProduct decisionsEnglish adaptation of one decision · try choosing an option
D05

Response shape for a scoped update or delete

API contractBlocks: P1 & locks PRsPending

$iid is a record's internal ID. An update or delete can narrow its scope with $kinds, $filter or $search. Today, that form returns an array, while the same scope with $id returns an object.

Current behaviour: a scoped $iid returns [] outside the scope and [object] on a match. A scoped $id returns { updated: false } outside the scope and an error if the record does not exist.

Fable 5.1 picks B (75%)Astra 6 picks B (96%)In agreement
Compare the options and choose a response contract

A Object, no error if missing

Effort M

A scoped $iid returns an object with updated or deleted. An ID that does not exist returns the same object with false, without an error.

  • +Same response shape for scoped $iid and $id.
  • +No extra reads.
  • −A missing scoped $iid silently passes while a missing scoped $id fails.
  • −Requires changes to tests and fan-out code.
Existing ID, excluded by the filter
{ "$iid": user_iid, "updated": false }
Reviewer scores for option A
Criterion · /5FA
Architecture34
Scalability55
SSOT / DRY33
Developer experience33
User experience—4
Value34
Safety43
Overall · /105/107/10

F Unifies the shape, but a missing $iid silently passes while $id fails.

B Object, error if missing

Effort M

Same object shape as A. An ID that does not exist fails with NotFound, or returns false with updateMissingOk, as it does without a scope.

  • +Scoped $iid and $id handle a missing record consistently.
  • +Catches an incorrectly typed internal ID.
  • −The helper must distinguish a missing record from one excluded by a filter.
  • −Needs a missing-record test for each operation.
ID does not exist
error: NotFound(missing_iid)
Reviewer scores for option B
Criterion · /5FA
Architecture55
Scalability44
SSOT / DRY55
Developer experience55
User experience—5
Value45
Safety44
Overall · /108/109/10

F Aligns scoped IDs in both response shape and failure behaviour.

C Keep the array and document it

Effort S

Keep the query-style path: [] when nothing matches and [object] when it does. Document this behaviour in the reference and decision log.

  • +No code or test changes.
  • +Existing callers expecting an array keep working.
  • −Response shape depends on the ID notation and scope.
  • −Conflicts with the reference promising an object for both ID forms.
Current response shape
[]  // no match
[object]  // match
Reviewer scores for option C
Criterion · /5FA
Architecture22
Scalability54
SSOT / DRY22
Developer experience21
User experience—2
Value22
Safety53
Overall · /103/103/10

F Preserves a shape that conflicts with the public reference.

A Turns an execution detail into an inconsistent public contract.

Choosing B gives the owner two requirements: return an object for a scoped internal ID, and distinguish a missing record from one excluded by the filter. Those become implementation work and test cases.

05 · Cost efficiency

From API calls to harness subscriptions

When I was running the work through APIs, Foundry Models reached $12,156.39 in one day, on 20 Sept 2026. I then spread work across harness subscriptions. WezTerm CLI let the orchestrator operate those harnesses in their terminals, with each harness using its configured account.

Foundry Models · daily recorded cost in USD
14 Sept–20 Sept 2026$6,838per day · seven-day average

$47,866.19 over the week.

5 Oct–11 Oct 2026$192per day · seven-day average

$1,343.70 over the week. 97.2% lower.

Foundry daily cost, 1 September to 12 October 2026Peak $12,156.39 on 20 Sept. The weekly daily average fell from $6,838.03 for 14 Sept–20 Sept to $191.96 for 5 Oct–11 Oct. Daily values are available in the table below.$0$4k$8k$12k1 Sept: $304.501 Sept2 Sept: $108.573 Sept: $136.694 Sept: $156.515 Sept: $23.956 Sept: $25.127 Sept: $14.988 Sept: $796.208 Sept9 Sept: $1,259.9210 Sept: $627.0511 Sept: $1,538.2612 Sept: $504.2713 Sept: $2,712.1314 Sept: $8,154.5015 Sept: $9,515.2415 Sept16 Sept: $21.7717 Sept: $5,455.2018 Sept: $5,816.8719 Sept: $6,746.2220 Sept: $12,156.39$12,15621 Sept: $4,773.9822 Sept: $2,334.5222 Sept23 Sept: $1,657.0324 Sept: $3,081.6925 Sept: $4,705.4426 Sept: $3,616.7327 Sept: $4,821.4628 Sept: $1,349.7929 Sept: $1,316.4629 Sept30 Sept: $1,360.791 Oct: $207.412 Oct: $19.833 Oct: $256.234 Oct: $143.975 Oct: $96.026 Oct: $315.876 Oct7 Oct: $398.858 Oct: $297.359 Oct: $99.9810 Oct: $103.7911 Oct: $31.8312 Oct: $52.9012 Oct

Scroll the chart to see all dates →

Peak: $12,156.39 on 20 Sept. Select a bar to inspect a day.

Azure Foundry usage cost before tax; excludes subscriptions and infrastructure. The two full weeks are not adjusted for workload.

Daily figures and query method

Azure Cost Management, ActualCost / PreTaxCost, retrieved 14 Oct 2026. One subscription, all resources billed as Foundry Models. Other Azure services, harness subscriptions, other API providers and taxes are excluded. These are recorded usage costs, before reconciliation with credits or payments. The selected weeks show the change in spending; they do not establish a migration date.

Queried through Azure CLI with az rest against the Cost Management Query API. Filter: ServiceName = Foundry Models. Sum PreTaxCost daily across resource IDs; keep the returned USD currency. September and October were queried separately and checked for additional pages. The table stops on 12 October to leave time for recent charges to arrive.

Daily Foundry Models cost · USD before tax
Date (2026)Cost
$304.50
$108.57
$136.69
$156.51
$23.95
$25.12
$14.98
$796.20
$1,259.92
$627.05
$1,538.26
$504.27
$2,712.13
$8,154.50
$9,515.24
$21.77
$5,455.20
$5,816.87
$6,746.22
$12,156.39
$4,773.98
$2,334.52
$1,657.03
$3,081.69
$4,705.44
$3,616.73
$4,821.46
$1,349.79
$1,316.46
$1,360.79
$207.41
$19.83
$256.23
$143.97
$96.02
$315.87
$398.85
$297.35
$99.98
$103.79
$31.83
$52.90

Work covered by a harness plan uses its included capacity, subject to that plan's limits. To calculate the factory's total cost, I still need to add the subscriptions, development VM, CI and other API providers to the Foundry figures.

06 · PR process

When a PR is ready to merge

A defect fix starts with a failing regression test. The owner implements the fix, runs the checks and submits the PR for review. Findings go back to the owner to verify and fix, and then another review round starts. The stages below spell out each gate in order.

  1. 1

    Red tests owner agent

    For a defect fix, write a regression test that reproduces the defect and fails. For other changes, choose validation that demonstrates the intended behaviour.

  2. 2

    Execution owner agent

    The owner implements the change and makes the relevant checks pass. A behaviour change carries its spec, tests and implementation in the same PR.

  3. 3

    Mutation proof owner agent

    For a regression fix, remove the fix and confirm that its test fails, then restore it. The test should distinguish the broken behaviour from the corrected one.

  4. 4

    CI for this commit disposable runners

    CI checks the commit proposed for merge on fresh runners. A fix made during review changes that commit, so its checks need to run again before merge.

  5. 5

    Bot reviewer bot

    A first automated review pass on the diff.

  6. 6

    Bloat pass DeepSeek flash

    One question: what in this diff does not need to exist.

  7. 7

    Drift pass DeepSeek flash

    A second pass for single source of truth: copies of the same fact that could drift apart.

  8. 8

    Panel Fable 5.1 · astra · Grok 4.7

    Three reviewers, three harnesses. Each gets a brief that leaves out what earlier rounds found, so nobody anchors on the last reviewer.

    Example An infrastructure PR passed CI, but the panel found two high-priority issues: a content-security policy baked into an image shared across environments, and a shared configuration key that would change a second environment on its next deployment.

  9. 9

    Verify, fix, repeat owner agent · orchestrator

    The owner checks findings against the code before changing it. Resolve confirmed critical and high-priority issues, then the remaining valid findings, and repeat the review. Each round uses new reviewer sessions.

    Example The deepest PR so far took 17 rounds.

  10. 10

    Confirmed orchestrator

    The orchestrator confirms that the required checks and review rounds are complete. Product choices must be resolved before the PR is ready to merge.

  11. 11

    Merge me

    I merge. A CI-only or runner-only PR may be merged by the remote orchestrator instead.

Each new panel round gets a brief without the previous reviewers' findings, to reduce anchoring on their conclusions. The owner still has to verify every finding against the code. In one measured test-auditor run, about one in five findings was wrong.

07 · Results

211 PRs in 30 days

These are the merge counts and timings for one repository from 13 September to 12 October 2026. Open-to-merge time includes waiting and review, as well as implementation.

211PRs merged, 30 days
34peak in one day
18.8 hmedian open to merge
115merged within 24 hours
Merges per day, 13 Sep to 12 Oct 2026
01734Sep 13Sep 20Sep 27Oct 4Oct 11
Hours from open to merge · median 18.8 h · 115 of 211 within a day
02958< 1 h1–6 h6–24 h1–3 d3–7 d> 7 d
Diff sizes and weekday breakdown
Changed lines per PR · median 654 · p90 7,294
02957< 100100–499500–1,9992k–9,99910k+
Merges by weekday (UTC)
02652MonTueWedThuFriSatSun

115 of the 211 PRs merged within a day of opening. The log counts merged changes; it does not measure how much useful product work each one delivered.

08 · Failures

Where the workflow broke

Overlapping PRs piled up. Before assigning more work on a topic, the orchestrator needs to check the open PRs and their owners. This remains coordination work; terminal access alone does not resolve conflicting changes.

A reboot lost unwritten progress. That is why each run has a report path. A useful report names the change, the checks already run, the open questions and the next action.

A relayed approval was rejected. I had to confirm the instruction in the receiving agent's session. The orchestrator's message and the harness's permission system are separate things. The harness can still require my approval in its own session.

The VM housekeeping behind the workflow

Finished reviewers left sessions open, and worktree build caches filled the disk. With tmux, closing a WezTerm pane can leave the agent running, so finished agents need to be stopped explicitly, and obsolete worktrees and caches need to be removed. A machine-wide queue limits heavy builds to three concurrent slots.

The CI side is its own page: A fresh VM for every CI job.