Agent Atlas / Chapter 5

Delegation Is a Distributed System

A subagent is a remote worker with its own lifecycle, context snapshot, authority, failures, and result stream. Treating delegation as a prompt trick hides the contracts that determine whether the work can be trusted.

Learning objective

Use public evidence to answer: What contracts keep delegated agent work attributable, bounded, and recoverable?

Working question

What contracts keep delegated agent work attributable, bounded, and recoverable?

More agents without identity, authority, cancellation, correlation, and join semantics create more ambiguous failure.
A parent run scopes three child workers with separate identities and authority, then verifies lineage, freshness, and results before merging.
Delegation control plane Delegated work crosses control, policy, execution, observation, and integration boundaries. Open full-size diagram
Case file 05 / Thread lineage

The child has two identities: parentage and history

Codex separates parent_thread_id from forked_from_thread_id. The first records the active delegation relationship; the second records where copied conversation history originated. A child can belong to one parent while beginning from another thread's snapshot.

Collapsing those fields destroys the distinction between control topology and data provenance. It also makes recovery, permissions, and result integration harder to reason about when a child resumes or reports late.

Latest newsroom receipts

What changed since the first Atlas draft

Mechanism trace

What actually happens

  1. Parent run

    goal, topology, authority

  2. Child A

    scoped task and context

  3. Child B

    separate lifecycle

  4. Child C

    correlated events

  5. Verify and merge

    lineage, freshness, result

Spawn is a lifecycle transition

A production delegation surface needs more than spawn. Codex groups spawn, send, resume, wait, and close as a multi-operation protocol. Each operation implies valid state transitions, idempotency rules, terminal states, and behavior when control messages arrive late.

SubagentStart runs before a child's first model request and receives its identity and resolved type. This is a concrete interception point for policy, tracing, and task envelopes, but it does not by itself guarantee deadlines, cancellation, or safe result merging.

Topology, context, and authority are separate

Parentage answers who controls the child. Fork lineage answers which history produced its initial state. Authority answers which tools, credentials, and approvals it may use. Copying context must not silently copy privileges.

Hermes propagates approval context into local and remote execute_code worker threads and applies a fail-closed guard before child scripts start. Authority must cross execution boundaries explicitly and refuse work when required control context is missing.

Every event needs a return address

Session IDs, thread IDs, turn IDs, task IDs, request IDs, tool-call IDs, and parent-child relationships form a correlation spine for reconstructing distributed work. Timestamps and display names are not substitutes for explicit identifiers.

Crush exposed the failure case by carrying a caller RunID through events while commands shared a channel. Without strict correlation, an error from another prompt can terminate or contaminate the current command.

Completion requires join and merge semantics

A child reporting success does not mean its output is still applicable. The parent may have changed files, revoked authority, exceeded a deadline, or accepted another result. Join must validate the input snapshot, output schema, terminal status, and freshness.

Cancellation must be observable and monotonic. A cancelled child may still emit buffered events or finish remote work. The parent needs a policy for discarding late results, compensating side effects, and recording why an otherwise valid result was rejected.

Failure modes

Where the contract breaks

Orphaned child execution

Parent cancellation or shutdown does not propagate.

Failure signalChild tool calls continue after the parent reaches a terminal state.

Misattributed result or error

Events share a channel without run, parent, and child identifiers.

Failure signalOne job changes state immediately after an unrelated child's event.

Stale result integration

The child works from an old snapshot while the parent changes the same state.

Failure signalThe result lacks an input version, freshness check, or merge decision.
Release tests

What the product must prove

  1. Enumerate every delegated job with job ID, parent, fork source, child kind, state, deadline, and authority profile.
  2. Verify spawn, send, resume, wait, close, and cancel transitions reject invalid terminal-state changes.
  3. Trace one child result from input snapshot through tools and approvals to the parent's accept, reject, or merge decision.

Projects In This Lesson

14 projects

Recent Reporting For This Lesson

6 articles