Orchestrations
An orchestration is a graph of agents that work together. The CLI treats the orchestration and its member agents as one unit: a single pull recursively fetches the graph plus every member agent, and a single push updates each member before updating the graph itself. A local manifest can also be claimed with orchestration create. See the orchestration manifest reference for every field.
Self-delegation
Self-delegation is available only in enabled organizations. Access is checked for the human owner of the root task. An edge whose from and to name the same member grants that agent permission to start managed children of itself. It carries description and payload_schema just like a peer edge and survives pull, push, status, sync and templates. The edge is permission, not an automatic execution loop.
CLI self-edges and runtime_mode are supported in @brainbase-labs/cli 0.58.0 and later. Upgrade with npm install -g @brainbase-labs/cli@latest. Start a new task after adding the self-edge. Brainbase connects the sandbox's self-delegation tools automatically when the feature is enabled for the root task's human owner and a self-edge governs the task. No agent secret is needed.
Use runtime_mode: auto in the member's agent manifest to allow the configured lead to choose offered harness/model pairs for children. Fixed mode uses the lead's effective pair; Auto alone grants no permission without the self-edge. Each child keeps the same agent identity, its own task and workspace, and lifetime-frozen execution settings. See the self-edge example and Runtime configuration.
The default C = 4 limits simultaneous runnable child turns across the root's tree, not total children or spend. The lead and persons can queue work at full capacity; a running child that needs another unavailable slot receives descendant_capacity_blocked. There is no lifetime child-count cap or separate depth cap. Every ancestor counts toward the integration-origin restriction set, which is bounded at 10,000 task IDs, so a tree can be about 10,000 levels deep. See Child capacity.
The limit for a new tree comes from the member agent's self_delegation_concurrency_limit, or the global default of 4 when the agent has none. The top-level self_delegation_concurrency_limit in brainbase-orchestration.yaml is still accepted and stored, and pull and push preserve it, but it has no effect on the limit. A value sent when creating a task has no effect either. The server captures the effective value and source when each tree enrolls; already-running trees are unchanged. With Unlimited, payer and credit gates, sandbox start-up admission of 8 at once per web process, and provider quotas still apply.
Orchestration pull refuses to overwrite an unpublished concurrency edit in the orchestration or any linked member manifest. Push the edit first, or use orchestration pull --force to discard it explicitly. Unrelated pushes leave the cloud limit and its sync baseline alone.
Removing the self-edge prevents new children while preserving admitted child reads and subtree Stop. Stop does not delete the tree. Deleting a task or agent with retained enrollment is refused with enrollment_retained before teardown.
Commands
brainbase orchestration create # claim the local manifest
brainbase orchestration list # list orchestrations under a team
brainbase orchestration pull <id> # fetch the graph + every member agent
brainbase orchestration push # push each member, then the graph
brainbase orchestration status # preview what would push / pull
orch is an alias for orchestration — brainbase orch list works too.Creating from a manifest
orchestration create claims the brainbase-orchestration.yaml in the current folder. Each members[].slug must have a linked agent checkout at agents/<slug>/; the command resolves those links to cloud agent IDs, validates the graph, creates it under the selected org and team, and stores the orchestration identity in gitignored .brainbase/ state. Use --org <id-or-slug>, --team <id>, and --yes for non-interactive creation.
Updating only the graph
Pass --graph-only to push to update membership, edges, edge settings, and schedule triggers without pushing each member agent's content. Use it when you've only changed the graph and don't want to re-push unchanged members.
brainbase orchestration push --graph-only
Edge settings and schedules
edges:
- from: planner
to: worker
settings:
max_handoffs: 2
triggers:
- type: schedule
node_id: 11111111-1111-4111-8111-111111111111
is_active: true
config:
cron_expression: "0 9 * * *"
to:
- agent: planner
Edge settings are free-form and round-trip through create, pull, push, and status drift. Schedule triggers are writable orchestration-level configuration: node_id must be a unique UUID, cron_expression must use standard five-field cron syntax, and every to[].agent must name a member. Omitted is_active defaults to false. Schedule config is normalized to cron_expression plus non-empty configured_props; other runtime-only config keys are not written back. Treat configured_props as integration-specific unless the trigger provider documents a field.
brainbase.agent.yaml.Drift and status
orchestration status compares local and cloud membership; edge description, payload schema, and settings; and schedule node ID, active state, normalized config, and target edges. It also reports member revision drift, missing local member checkouts, and orchestration cloud revision drift even when the modeled graph still matches.
Adding a member agent
add-agent <name> (alias add) creates a new member agent in the orchestration, wires its edges with --from and --to (each repeatable), and pushes the result. Pass --no-push to stage the change locally without pushing.
brainbase orchestration add-agent triage --from intake --to resolver
brainbase orch add researcher --to writer --no-push # stage without pushing
Scope a listing to a specific org or team with --org <id-or-slug> and --team <id>.