#6581·deepagents

Async subagents should be able to share the parent's filesystem / sandbox

Author: open-swe[bot]Created Sep 27, 2026Updated Sep 29, 2026
Labelstype:featuretopic:subagentsorg:internalpriority:hightopic:sandboxestopic:filesystemtopic:async-subagents

Area

deepagents (SDK): subagents (AsyncSubAgentMiddleware / SubAgentMiddleware)

Feature description

Async subagents can't share the parent agent's filesystem or sandbox.

Sync task subagents already share both: they get the parent's backend instance, and files state goes to the subagent and comes back. start_async_task works differently. It creates a new thread on an Agent Protocol server and only sends {"messages": [{"role": "user", "content": description}]}. On hosts that scope resources per thread (e.g. Managed Deep Agents gives each thread its own sandbox), that means:

  • the async subagent can't see the parent's working tree, installed deps, or build artifacts
  • the parent can't see anything the subagent writes, unless it goes through git or external storage
  • the parent only learns the subagent is done by polling check_async_task
  • the subagent can't be used for parallel work on the same tree, which is how models trained on native harnesses use subagents

Other harnesses share by default. Claude Code and Codex CLI subagents run in the parent's working directory and sandbox, and worktree isolation is opt-in. Hermes switched delegate_task children to one shared sandbox for this reason (NousResearch/hermes-agent#15873).

One potential proposed solution

Background subagents that run inside the parent's thread, and wake the parent through a queue when they finish. #6563 implements this:

  • task(..., run_in_background=True) starts the declared subagent on the parent's event loop, under the parent's config. Thread-scoped backends and tools (including the sandbox) therefore resolve to the parent's thread, the same way Claude Code's run_in_background works.
  • When the subagent finishes, its report goes to an on_background_complete callback. On an Agent Server, the host queues a run on the parent's thread with that report. Parallel subagents can each wake the parent in turn, with no polling and no new threads or sandboxes. (This pattern already runs in Content Studio on Managed Deep Agents.)

Open questions:

  • Only the report comes back, not a state update. The state-backed (StateBackend) case needs a way to merge files changes, or should be documented as unsupported.
  • How this relates to AsyncSubAgentMiddleware: replace it for same-deployment subagents, or have async tasks optionally attach to the parent's sandbox (e.g. forward a sandbox ID in the run config/context) for truly remote graphs.