Use this when a model must decide the plan, not your code. One supervisor spawns workers, steers them, and stops when a check passes on a worker's real output. Budget, journaling, and depth limits are defaulted.
Use a sibling instead when your code owns the plan.
../quickstart is the loop you write yourself with plan and decide.
../graphs is a fixed topology authored as data.
../supervisor-loop is this same call with a real worker backend, such as a sandbox or a coding CLI.
../delegate is the zero-configuration entry: one intent string in, one result out.
TANGLE_API_KEY=sk-tan-... pnpm build && pnpm tsx examples/supervise/supervise.tsA key is required, because the supervisor's brain and the worker both call the router.
MODEL and TANGLE_ROUTER_URL are optional.
On success it prints the delivered output:
[OK] delivered: {"content":"READY"}
When no worker delivers, it prints the reason and the spend instead:
[--] no winner (budget-exhausted) — 1 child(ren) down, spent 4210 tokens / $0.0031
Three settings are worth knowing.
profile.harnesspicks what drives the supervisor's brain. This example usescli-base, the router-backed brain with no coding agent. Setopencode,claude-code, orcodexto run a coding CLI in a sandbox.backendis where the workers run. This example usesrouter-tools. Change it tosandboxplus a harness to run each worker as a coding agent in a real box.deliverableis the completion check. It is optional, and it is what makes "done" mean verified.
Multi-agent orchestration usually becomes glue code: spawn, track, collect, and guess when the work is done. This is one call with defaults, so you write a goal and a profile instead of a framework. "Done" is your check against a worker's output, so a worker cannot claim success, and a failure reports the real reason and the spend.
Run the offline resource accounting example:
pnpm tsx --tsconfig tsconfig.examples.json examples/supervise/named-resources.tsBudget.resources pairs each caller-owned name with a unit and limit.
Executors report matching Spend.resources totals or incremental resource usage events.
Every child must declare all dimensions enforced by its parent.
Reservations include all standard and named channels atomically.
Known unused allocations return to the pool.
Missing or unknown enforced measurements block further admission and remain unknown after restart.
The runtime trusts executor measurements; it does not measure accelerator use or network traffic itself.
A model-driven root also needs a measured receipt for every enforced dimension.
A custom child executor alone cannot supply the root's measurements.
The existing router.complete transport can return them as usage.resources:
return {
...completion,
usage: {
...completion.usage,
resources: {
compute: { unit: 'millisecond', amount: measuredComputeMs, known: true },
transfer: { unit: 'byte', amount: measuredTransferBytes, known: true },
},
},
}The transport must forward the Runtime-authored request without changing its model, profile, tools, or settings.
It must derive those amounts from trustworthy measurements for that completion.
An explicit measured zero is valid; an omitted dimension remains unknown and blocks admission.
Buffered and streamed Router responses use the same receipt validation.
After a transport retry, the final measured subtotal remains available, but completeness becomes unknown because earlier attempts lack receipts.
Inline Router executors sum turn receipts and preserve unknown measurements across turns.
Custom tool-loop brains can return the same map as resources on their existing response.
Real HTTP resource-policy coverage is in tests/runtime/router-resource-policy.test.ts.