SubAgents: continuable background sub-agents (durable children you can message, resume, and interrupt)

Author: DouweMCreated Aug 13, 2026Updated Oct 1, 2026
Labelsharness

Transferred from pydantic/pydantic-ai-harness#603 after harness moved into this repo. Harness paths map to src/pydantic_ai_harness/pydantic_ai_harness/, tests/harness/ and docs/harness/.

Idea

Extend SubAgents beyond one-shot delegation with a continuable background child contract: a child agent that keeps a durable session you can send follow-up messages to, that resumes cold from its persisted history when needed, and that reports back to the parent asynchronously.

Sketch of the contract (adapted from the strongest open implementation of this we've seen, DeepSeek Harness's subagent subsystem, launched 2026-08-13):

  • A child has at most one live activation; its inbox is the only FIFO queue — followup() enqueues, wakes a live child, or cold-resumes it from the persisted session.
  • Interrupt is authority-checked (only the durable direct parent or an exact live ancestor may interrupt).
  • Parents get an unconditional "settled" notice when a child ends, and children get a scoped report channel with quiet (inject, no parent turn) vs wake-up (new parent turn) delivery.
  • Provenance-tagged messages: a runtime notice about a child settling is a different message kind from content the child wrote, so transcripts never credit the child with words it didn't produce.
  • Capability flags checked at start, fail loud: a delegation request needing e.g. an output schema or tool filter on a backend that lacks it is rejected with a typed error, never accepted-then-ignored.
  • Durable discovery without resuming: enumerate the child tree from persisted session metadata, with per-child diagnostics so one damaged child can't hide healthy siblings.

Reference: https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/subagent.md — they also ship external delegation backends (Claude Code, Codex, remote-over-SDK) behind the same provider seam, which is a separate but related idea.

Why now

  • Always-on / long-running agent compositions (messages + schedules) need children that outlive a single tool call.
  • Our production agents (pydanty, the gh-aw shim) both lean on sub-agents; background continuation keeps parent context small without losing the child.
  • Related current work: pydantic/pydantic-ai#9237/#589 (usage-limits propagation through SubAgents).

Filed from the docs-strategy competitor research; no commitment implied — this is the idea row Douwe asked for.