← Back to archiveField note / 2026.12.03

Harness Engineering. Part 4: Many sessions, one human

In the previous part, we built a harness that lets a single session run unattended: the agent gets a goal, checks its own work and comes back with a result. We ended with an uncomfortable observation: while the agent works, we wait.

The natural next step is to stop waiting and start another session. And another one. This is where things get interesting, because the problems we face now are mostly not about the agent workflow, but about human attention management and agent orchestration.

This is the fourth post in the Harness Engineering series. If you missed the previous ones, start with Part 1: Evolution of AI-assisted workflows, Part 2: The human is the loop and Part 3: Tell the agent when it’s wrong.

Stage 3: Many projects, many branches, many sessions

Multiple sessions in progress, local and remote (cloud), longer sessions.

As we said, Stage 3 starts with a break: you cannot control every step anymore. Several sessions compete for your attention at once, and you physically can’t review every edit, every tool call and every intermediate result.

That forces us to delegate more: decision-making, verification and the act → learn → improve loop. Everything from Stages 1 and 2 still applies, but now it has to work without you watching.

Previously we listed the new problems of this stage:

  • secure isolated environments
  • work across multiple repositories
  • agent-to-agent communication
  • end-to-end verification of larger chunks of work
  • local environment performance and uptime
  • automated improvement and self-healing processes
  • observability and control

Let’s go through them, starting from the most basic one: two agents must not step on each other’s toes.

Isolation, layer by layer

Running two sessions in the same checkout is the fastest way to learn why isolation matters. One agent switches the branch, the other one commits half of its colleague’s changes. One runs the formatter, the other one sees a thousand modified files and “fixes” them.

I suggest looking at isolation as a set of layers, and each layer covers a different kind of shared resource.

Files: one worktree per session

Git worktrees give every session its own directory and its own branch on top of the same repository:

git worktree add ../my-app-fix-login -b fix-login
git worktree add ../my-app-add-search -b add-search

Each session works in its own folder, builds and tests its own copy and ends as a clean, reviewable branch.

You don’t have to manage it by hand. For example, the GitHub Copilot app lets you start a session in a New worktree or in the Current checkout.

GitHub Copilot app: the “Where to work” menu with the New worktree option enabledGitHub Copilot app: the "Where to work" menu with the New worktree option enabled

But we have another problem: a worktree isolates files. It doesn’t isolate your database, your ports, your caches or your credentials.

Setup and cleanup

A fresh worktree is an empty shell: no dependencies, no generated files, no local config. It needs to be prepared before the agent can build and test.

Old rules still apply: the agent’s environment must be able to run the checks without a human preparing it.

Setup scripts make a fresh workspace ready to build. Cleanup scripts remove what it leaves behind. In the Copilot app, this lives in the repository configuration:

scripts:
  - name: Setup
    command: npm ci
    triggers:
      - session.create
  - name: Run
    command: npm run dev
  - name: Cleanup
    command: rm -rf node_modules
    triggers:
      - session.archive

Keep the setup fast and idempotent. If it takes ten minutes, every new session starts with ten minutes of idle time.

Ports

Every session that runs the web app needs a dev server, and five dev servers can’t all listen on port 3000.

Ports have to be allocated per session and passed everywhere: to the app, to the tests and to the browser tools. Otherwise, the agent will happily run Playwright against someone else’s instance, see a green result and report success.

The simplest approach: never hard-code the port. Read it from an environment variable, pick a free one at startup and print the URL so that both the agent and the tooling can find it.

Databases and shared state

Files are easy to isolate; state is harder. Sessions that share a database, a cache or test fixtures will break each other’s tests in ways that look random. And from Part 3, we know what random failures do to the agent: they teach it to ignore failures.

There are two options:

  • isolate: a container per session, a per-session schema or database, seeded fixtures
  • coordinate: explicit locks or queues for the resources you really can’t duplicate (a shared staging environment, a rate-limited external API)

Prefer isolation. Coordination is one more thing that can go wrong while you’re not watching.

Local or cloud?

Here comes the question from Part 1: can you really run ten copies of your application on your laptop? Probably not. Even if you can, your machine needs to stay awake, online and not overheated for the sessions to finish.

We have three complementary tools:

  • local sandboxing: the session runs on your machine, but its commands are restricted in what they can reach. Useful when the agent needs your local tools and services.
  • cloud sandboxes: the whole session runs in an isolated environment hosted elsewhere. Your machine is not involved, you don’t have to stay connected, and you can run several heavy sessions in parallel.
  • remote hosts: when supported, deploy your agent to an external machine (VM or physical device) and send your session there.

Cloud environments bring their own harness work: the environment must be reproducible, have the right tools installed and have access to what the agent needs, and nothing more. Dev containers and customized agent environments are the outer-loop pieces you own here.

GitHub Copilot app: the “Run on” menu with Cloud selectedGitHub Copilot app: choose where the session runs, on this computer or in the cloud

A good side effect: once the environment is fully described in code, it’s reproducible for humans too.

Work across repositories

Some features don’t stay in one repository. A change to an API means changes to its clients, a shared library bump touches every consumer.

A single session can’t do much if it only sees one repository. The harness needs to:

  • give the agent access to all the repositories involved (and only those)
  • make the relationship between them discoverable: which repository owns what, how they are built and released together
  • keep the changes linked: one feature, several branches and pull requests that must land together or in a defined order

Some tools already treat this as a first-class concept. For example, projects in the Copilot app can span multiple repositories and coordinate sessions toward a shared goal, and a cloud sandbox can clone several repositories into one environment.

Orchestration: brain and hands

Once we have many sessions, someone has to decide what runs, in which order and what to do with the results. We don’t want that someone to be us all the time.

A common pattern is a parent (orchestrator) session that plans and coordinates, and child sessions that do the work:

  • the parent breaks the goal into tasks and identifies dependencies
  • independent tasks run in parallel, dependent ones wait
  • each child gets the context and tools it needs, and nothing more
  • the parent reviews and combines the results

This is the same idea as sub-agents from Part 2 and Part 3, scaled up: from a noisy research task to whole branches of work. In the Copilot CLI and the Copilot app, /plan followed by /fleet does exactly that: the main agent splits the task and runs subagents in parallel where possible. For more structured, repeatable flows, see my earlier posts on custom agents and dynamic workflows.

Desktop apps provide a shared communication transport that all sessions can use to coordinate their work and send messages to each other.

GitHub Copilot app: a “Codebase architecture review” parent session with nine nested child sessions, running in the cloud or in worktreesGitHub Copilot app: a parent session with its child sessions, each running in the cloud or in its own worktree

In the Copilot app, they are rendered as nested (child) sessions. In the screenshot above, we see a typical workflow:

  • Coordinator starts with the problem (architectural review) and manages multiple nested sessions
  • Child sessions, when spawned (directly by the orchestrator or by the user via the /spawn command), run their work end-to-end and report their status
  • Coordinator commands them to create a pull request and merge when ready
  • Child sessions report their merge status back to the Coordinator
  • Coordinator updates the plan, signals every active child session to rebase onto main and spawns new sessions that are now unblocked

The same signal channel allows the Coordinator to manage sessions that belong to another repository, but that gets less visual sometimes, so I’d still prefer Projects.

Interception points

Not every step needs a human, but some do. Define them upfront:

  • approving a plan before a large change starts
  • choosing between options with real trade-offs
  • anything irreversible: merging, deploying, deleting data

Everything else should flow without asking. If the orchestrator asks you about every small thing, you’re back to Stage 1, only with more tabs open.

Verifying larger chunks of work

The checks from Part 3 run inside each session. That’s necessary, but not sufficient. Five branches that each pass their own tests can still break each other when they meet.

End-to-end verification moves one level up:

  • each session ends with a reviewable unit: a branch or a pull request with green checks
  • integration checks run on the combined result, not only on each piece
  • the end state is verified against the original goal and its acceptance criteria, not against what each child decided to build

Review agents help here, but they also add up. More sessions mean more pull requests, and every one of them still lands in someone’s review queue. We need to keep an eye on that queue: if review becomes the bottleneck, the parallelism upstream doesn’t help.

Elevate reviews

The increasing volume of reviews calls for new approaches too.

  • Automations: first pass from one or several agents that focus on different parts of the process.
  • Focus assistant: tools or agents should bring important changes to human attention (screenshots, diagrams, test coverage, architectural changes and major decisions or assumptions made)
  • Deterministic checks: trustworthy quality and security scans combined with tests and verification pipeline should pass before a human takes their first look
  • Pull request readiness: agents can and should monitor the state of pull request (automatically fix any issues found, rebase and resolve merge conflicts)
  • Divide and conquer: splitting the results of one session into stacked pull requests allows us to focus our verification on smaller chunks of produced work. The work can be merged in parts (one or several PRs from the stack, or the whole stack at once).

Observability and control

The tools we use should provide us with information about:

  • which sessions are working, which are waiting for me and why
  • which ones are stuck, looping or burning tokens without progress
  • what each one has produced so far

The end goal is: human attention goes only to the sessions that need a decision. Everything else should be visible but quiet.

Keeping the harness healthy

As we said before, harness engineering is a process: we still need to treat agent misses as incidents, fix the cause and review old checks. At this scale, doing that manually doesn’t keep up.

Some of that loop can be automated too: recurring jobs that look for flaky tests, outdated instructions or broken setup scripts and propose fixes. Self-healing doesn’t mean nobody is responsible, but it means the boring part of the maintenance doesn’t depend on someone remembering to do it.

Desktop apps should (and they do!) provide ways to schedule recurring sessions, triggered by a schedule or an event, and perform these types of housekeeping work.

What’s next in the series

With isolated environments, orchestration and visibility in place, we stop working with individual sessions and start working with a process: intent goes in, reviewed changes come out. Tools like the Copilot app and the like become local software factories that you operate from your laptop. If you’re at this stage, congratulations, it’s been a long journey and honestly not everyone is here by the time of me writing this post.

The major challenge with this stage is that it has one single point of failure: your local software factory is local. One computer to run the process (even if some parts of it have moved to the cloud already).

In the next part, we’ll look at Stage 4, Software Factories: what changes when most of the flow is handled by agents, what remains human work, and how much of it we can realistically build today.

Stay tuned!

Further reading

Disclosure

I’m employed by GitHub at the time of writing this post. All opinions are my own.

Tagged