Repository navigation
Description
What
Native depth-1 child agents: a parent tole session spawns N child tole
sessions (never grandchildren). uteke is the parent↔child communication
channel. Worktree is PARENT-ONLY (decision 2026-10-05, 3rd round):
children never have a worktree knob — per-child worktree options are a
storage-boomerang (N model-spawned worktrees bloat the repo even if the
work is cleaner); the operator decides, once, at parent launch.
User requirements:
- 1 parent → N children, depth capped at 1.
- Worktree mode: an operator-level flag on the PARENT session
(e.g.tole run/chat --agents-worktree), default OFF. When the
operator enables it, every spawned child gets its own worktree; the
MODEL cannot request worktrees per-spawn. - Hard limits: concurrent children, per-child budget/timeout.
- uteke mailboxes: ephemeral by default, auto-cleaned — no spam.
Design sketch
Execution — mirror the proven jobs pattern
agent_start {prompt, allow?, budget?, keep_mailbox?}(Risk::Write,
approval-gated; NO worktree parameter) → spawns a durable child
tole runsession with its own JSONL, registry, usage ledger.agent_poll {agent_id}(ReadOnly) → status + log tail; loop-guard
exempt likejob_poll.
Structural depth cap (the security crux)
- The child's registry is built WITHOUT
agent_start— it cannot
become a grandparent by construction. - Bypass to close: the child still has
run_commandand could spawn
tole run(verified live 2026-10-05). Fix: in child mode, the
destructive-payload scan additionally refuses spawning thetole
binary itself. - Child allowlist ⊆ parent allowlist; Destructive still requires an
interactive approver, unchanged.
Worktree: PARENT-ONLY, operator-gated
--agents-worktreeon the parent (default OFF). Enabled: each child
spawns intogit worktree add .tole-worktrees/<agent-id> -b agent/<issue>; the child's jail is that worktree. Merge-back stays
human (push stays human).- Storage stays bounded STRUCTURALLY: the model has no worktree
argument to flip; worktree count ≤ MAX concurrent children (default
small); worktree removal is part of the child lifecycle (merge →
remove worktree → clean mailbox). - Disabled (default): children share the parent's jail — fine for
read/analysis subtasks.
uteke mailboxes — scoping AND lifecycle
Scoping (no cross-talk):
- Each child runs with
TOLE_MEMORY_NAMESPACE=agent-<agent-id>—
siblings structurally cannot see each other's namespaces. - Briefs down: ONE
uteke_documentper child. Results up: the child's
settle summary only; the parent reads it deterministically (exact
namespace/tag) — point-to-point mailboxes, never a shared pool.
Lifecycle (no spam):
- Ephemeral by default: when
agent_pollreports settled AND the
parent consumed the summary, the mailbox is auto-cleaned (uteke
soft-delete namespace strategy — restorable). keep_mailbox: trueopts out for debugging (the child's durable
JSONL is the real archive; the mailbox is transport).- Worktree mode ties cleanup to merge + worktree removal; a janitor TTL
sweeps orphanedagent-*namespaces if the parent crashed.
Limits (configurable)
- MAX concurrent children per parent (default small, e.g. 4),
per-child token budget (existing BudgetExhausted), child timeout.
Phasing
- serve-based orchestration + uteke mailbox handoff — available TODAY.
agent_start/agent_poll+ structural depth cap + policy subset +
mailbox lifecycle.--agents-worktreeparent flag.- Optional decision layer: jev/laya
decidetool (issue Design: jev_decide tool — TypeSafe Jev (System One) as an optional fast decision layer (probe-gated, Read-Only) #172).
Why
The primitives all exist (jobs pattern, session durability, jail,
memory loop namespace override, allowlist machinery, uteke soft-delete
namespaces). Parent-only worktree gating removes the storage boomerang
by construction rather than by policy; depth-1 caps the exponential
cost docs/orchestration.md warns about.
Activity
feat(tools): depth-1 child agents — agent_start/agent_poll, structura…
ajianaz commentedon Oct 5, 2026
Shipped in PR #174 (c650f71): agent_start/agent_poll, structural depth cap (+ env/wrapper bypass closure), uteke mailboxes (ephemeral default), parent-only --agents-worktree. Three CodeCora rounds hardened it: prompt flag-injection guard, child-allowlist subset enforcement, no-orphan spawn, honest liveness. 323 tests green.
chore(release): v0.6.0 (#192)
chore(release): v0.6.0 (#194)
chore(release): v0.7.0 (#225)