letta-code — sub-agent delegation (Agent tool → child letta process)

letta-code — sub-agent delegation (Agent tool → child letta process) A sequence diagram generated by Archify. Agent(prompt, type) launchSubagent spawn; prompt on stdin --new-agent --system <type>, --permission-mode unrestricted task id + output file depth 0 never waits new agent + conversation fork: hidden copy of the parent conversation own split loop + tools end_turn result event (final text) report <task-notification> ≤ 30k chars only a long-lived host consumes it new turn: report only answer using the report Launch Child turn Report Parent loop · TUI / SDK / listener · Sequence participant Parent loop TUI / SDK / listener Agent tool · task.ts · Sequence participant Agent tool task.ts Subagent manager · spawn + parse · Sequence participant Subagent manager spawn + parse Child letta · headless, stream-json · Sequence participant Child letta headless, stream-json Backend · agents + conversations · Sequence participant Backend agents + conversations Legend main request return message