How Camelia delegates work with spawn_subagent
When Camelia decides a task belongs to a specialist, she hands it off using a single tool: spawn_subagent. Understanding this mechanism explains how a one-line request turns into focused specialist output.
The handoff
Camelia calls spawn_subagent(role, task), where role is one of the six fixed roles (research, reasoning, design, document, patent, manufacturing) and task is the work to do. This runs one role-specialized LLM call and returns that specialist's markdown back to Camelia.
Single-call, not recursive
A sub-agent runs as one call. Within a flow, the runner is explicitly a flat DAG — no step spawns further steps, so sub-agents do not recursively spawn more sub-agents. This keeps delegation predictable and bounded.
Where it fits in Camelia's loop
Camelia operates a bounded agent loop: model → tool calls → execute each (logged) → loop → final answer, capped at six model turns per request. spawn_subagent is one of the tools she can call inside that loop, alongside tools for listing projects, reading and writing documents, generating CAD, running integrations, and more. She can delegate to a specialist, take the result, and continue working — for example handing the output to another role or saving it.
Optional saving
The result of a spawn_subagent call can optionally be saved as a document into a project folder you choose, so a delegated brief or plan becomes a real artifact rather than only appearing in chat.
What you do
You don't call spawn_subagent yourself — you describe what you want, and Camelia chooses the right role and task. Being specific about the deliverable (a research brief, a design spec, a sourcing plan) helps her route to the correct specialist.