Deep Dive: Agent Orchestration Patterns
Follows a dispatched agent through its full lifecycle - foreground vs background execution, auto-backgrounding of long tasks, sidechain transcripts for resume, layered tool filtering, and result handoff - then catalogs six reusable orchestration patterns: worker pool, pipeline, supervisor-worker, adversarial verification, fork-join, and resume chain. The adversarial verification agent, which must run real commands and issue a PASS/FAIL verdict while being forbidden from editing the project, gets special attention as a defense against LLM self-verification failure modes.
View source on GitHubKey takeaways
- 01
Never trust an implementer's self-verification: a separate read-only agent must build, test, and probe adversarially
- 02
Re-inject critical constraints every turn - long conversations make agents forget their rules
- 03
Layer tool filtering: global denylist, per-agent-type restrictions, then per-instance allowances
- 04
Every agent creation needs matching cleanup - eight resource types released in one finally block
- 05
Explicit communication beats assumption: teammates are told exactly which tool makes messages visible
- 06
Token economy is architectural: read-only scouts skip project docs and run on cheaper models
Flows built on this research
Agent Architecture
Implement the Six Core Orchestration Patterns
Worker pool, pipeline, supervisor-worker, adversarial, fork-join, resume chain - build the reusable orchestration patterns every serious multi-agent system converges on.
4 steps · 120-180 minutes
Agent QA & Security
Stand Up an Adversarial Verification Agent
Stop trusting your agent's own 'it works': dispatch a read-only verifier that must run real commands, probe adversarially, and return an evidence-backed PASS/FAIL verdict.
4 steps · 90-150 minutes
Agent Architecture
Choose the Right Dispatch: Spawn, Fork, or Direct
Three ways to hand work to a sub-agent - fresh-context spawn, cache-sharing fork, or just doing it yourself - and the decision matrix for picking per task.
4 steps · 90-150 minutes
Agent Architecture
Sub-Agent Delegation with Context Isolation
Delegate bounded work to sub-agents that run in fresh context and return only distilled results - the pattern behind scalable long tasks.
4 steps · 90-150 minutes
Harness Engineering
Verification Loops: Never Trust an Unrun Edit
Wire verification into your agent so every edit is checked by machines - syntax, tests, behavior - before it counts as done.
4 steps · 60-100 minutes
Harness Engineering
Observability for Agent Runs
Instrument your agent like production software: traces, session replay, cost tracking, and failure analysis on open standards.
4 steps · 90-120 minutes