# Multi-agent delegation introduces ownership

Codex exposes child-thread lifecycle controls, including spawning, messaging, waiting, and interruption. Pi's coding-agent supplies an optional example that launches child processes; its separate durable package demonstrates owned child conversations. Goose runs foreground subagents in separate persisted child sessions and returns their results and approval requests through the parent workflow. [Codex controls][c-agents], [pi example][p-agents] and [durable example][p-durable-agents], [Goose subagents][g-agents].

Separate conversation state does not prove separate filesystem access. Two agents can have independent histories and still overwrite the same file. The delegation contract should identify task ownership, workspace isolation, cancellation propagation, approval routing, budgets, and what the parent receives.

**Design implication:** delegate independent work with a bounded result contract. For shared mutations, provide explicit ownership or conflict handling rather than assuming a coordinator can repair every race afterward.

## Sidekick: owned child turns and peer panels

Native delegation admits an owned child turn only while its parent attempt still owns the running turn. The parent tool intent records the child identity in the same transaction. The child then has its own attempt, scoped context, intent recovery, cancellation checks, and settlement. A retry can reason about that existing child instead of blindly spawning another worker. [Child linkage][s-child], [child execution][s-execution] (private source).

Panels use a different topology: peers receive persisted permission to speak, called floor grants. When the last statement in a locked batch completes or fails, finalization produces a directive to wake the moderator. This is event-driven coordination with durable state determining which work becomes eligible next. It coexists with an explicit model/tool loop inside each native worker. [Panel completion][s-panel].

[c-agents]: https://github.com/openai/codex/blob/8c076942cb70fba8e5c4732c23f1faabc4aed484/codex-rs/core/src/tools/handlers/multi_agents_v2.rs#L1-L66
[p-agents]: https://github.com/earendil-works/pi/blob/482c1381a00d8d00bc81697e4a980c593db6803e/packages/coding-agent/examples/extensions/subagent/README.md#L1-L110
[p-durable-agents]: https://github.com/earendil-works/pi/blob/482c1381a00d8d00bc81697e4a980c593db6803e/packages/durable/test/examples/22-subagent-foreground.ts#L42-L82
[g-agents]: https://github.com/aaif-goose/goose/blob/34a222e3f2b95d8b4a43482b53c2cc957ecce26d/crates/goose-agent/src/subagent.rs#L57-L290

[s-child]: https://github.com/datex/sidekick/blob/463d653124e1c2cda46a3f14f01f3d6f384326b1/backend/src/sidekick/services/tool_executor.py#L46-L126
[s-execution]: https://github.com/datex/sidekick/blob/463d653124e1c2cda46a3f14f01f3d6f384326b1/backend/src/sidekick_worker/workflows/agent_delegation_workflow.py#L803-L893
[s-panel]: https://github.com/datex/sidekick/blob/463d653124e1c2cda46a3f14f01f3d6f384326b1/backend/src/sidekick/services/panel_session_service.py#L433-L508
