ADR 0013: Cross-Runtime Children
Status: accepted, 2026-11-21.
Status: accepted, 2026-11-21.
Context
The owner wants runtimes to work together: the Orquelo agent hands a task to Claude Code or Codex ("ask Codex to review this"), and later the develop and ask-all workflows run several runtimes in one run (external runtimes, section 5). Sub-agents today live inside the agent plugin: a sub-agent is the same agent loop with other instructions, and its state is in the parent's checkpoint. Claude Code and Codex are other runtime instances, each with its own uses, login, process and checkpoint, and only the Host can run an instance's Execute, authorize it for the run's person and keep its state across a restart. So running one runtime from another has to be a Host mechanism.
Decision
plugin.ChildRunner, an optionalRuntimeHostinterface:ChildRuntimes(ctx)lists the runtime instances in the calling runtime'susesthat are ready and that the run's person may use (instancescope);RunChild(ctx, ChildRun{Key, Runtime, Text})has the Host run that runtime'sExecuteas a child of the current run and returns itsResult. Anything else is refused before it starts (runtime.child_denied). A child cannot run children.- A child is part of its parent run. It keeps the run's identity, conversation, session, workspace (the same checkout in this version) and authorization; its own
usesapply to its calls. Its progress goes to the parent's, labelled with its runtime. Its questions and approvals are the run's durable interactions, labelled with its runtime, with keys namespaced by the child key. It has a session of its own, unlessChildRun.Sessionnames one that children of the run share (a workflow role continuing its Claude Code session). It gets no steering. Its usage is recorded against the parent run. - A durable child record, owned by the Host: the table
run_children, keyed(run, key), with the runtime, state (running,succeeded,failed), checkpoint and result. A child that succeeded returns its stored result and is not run again; a running child resumes from its own checkpoint after a restart; a parked child (a question waiting) parks the parent with it. A failed child's error is returned to the parent as the child's outcome and does not fail the parent run. A child record ends with its parent run. Amended 2026-11-26 (Feishu #202): a child stillrunningwhen its run finishes ends with it,failed, "the run ended before it did"; a run that only parks does not finish, so its waiting child still resumes. - The agent's
delegategains an optionalruntimeparameter whose values are onlyChildRuntimes; the reply comes back wrapped as untrusted, as a sub-agent's does. The workflow runtime (R4) uses the same interface. - What other runtimes delivered. Added 2026-11-26 (Feishu #222, the owner's choice): each runtime keeps its own session, but when a run asks the Host for context (
ContextItems) it also gets one reference item,delivered, with the final results that runs on other runtimes delivered to the same person in the same conversation and thread since that session's key was last closed (/new, idle) or since the conversation began: the latest five, each labeled with its runtime and time, cut to 8,000 characters with a note, the files named; 16,000 characters in all, the newest always kept. A result counts once at least one of its deliveries was sent; progress lines do not. Children do not get it. It is reference material, never instructions.
Consequences
- ◆A new optional host interface, a table and an error code; runtimes that do not use them are unaffected. Process-form runtimes do not get
RunChildin this version. - ◆A child's writes are real writes in the parent's checkout; a read-only or own-worktree child comes with the workflow steps (R4).
- ◆The person's authorization is checked once per child against the child's instance, so a runtime scoped to admins cannot be reached through the agent by anyone else.
- ◆This is the thirteenth ADR, beyond the v1 guideline of about ten; the owner approved the design that calls for it on 2026-11-21.
Design: External runtimes, section 5.1.