LAYER 05 · Scale beyond one agent

Subagents, continuations, and jobs

Delegation transport, continued conversation, and long-running control are three different abstractions

22 min3 source anchorsupstream@47f9438
provider transport + activation + job registry
The question this chapter resolves

After starting a subagent, who owns it, who may continue it, and who must stop it?

Build intuition

Delegation is outsourcing: the provider is the transport, the descriptor is contractual identity, continuation is the follow-up channel, and the job registry is the project control board.

MECHANISM

Mechanism

ctx.subagents selects in-process spawn/fork, ACP, Codex, Claude Code, or DSH SDK providers. Requests carry depth, cwd, persona, tool visibility, and a durable descriptor.

Activation orchestrates continuation and tool-subagent-control sends follow-ups. Long-running delegation registers with ctx.jobs; ownerSession controls access and agent disposal cancels and awaits the job.

Step 1 of 6

Declare request

Description, parent agent, depth, tool filter, and persona.

INVARIANTS

What extensions must preserve

  • Absolute delegation depth is consistent across providers
  • Tool filtering is visibility, not security permission
  • Job.done resolves only after the producer releases resources
FAILURE MODES

The tempting wrong turns

  • ×Calling a new model request a full subagent
  • ×Cancelling only the job record but not producer work
  • ×Using guess-resistant JobId as access control
VERIFY IN SOURCE

Do not trust the conclusion—verify it

These anchors are pinned to official deepseek-harness@47f9438; account for later breaking changes when reading current upstream.

KNOWLEDGE CHECK

Pause for ten seconds before revealing

Why can toolFilter not be treated as a security sandbox?

Why the next chapter follows

Subagents solve delegation. Next, model-written workflows orchestrate many agents and durable schedules wake future turns.

Learn DeepSeek Harness

An independent learning project. Explanations derive from source; upstream remains authoritative.