Skip to content

Subagents started by other subagents can't be multi-turn: mode "background" is silently ignored and write_agent refuses them #5543

Backlog

Description

@jrseliga

Describe the bug

Multi-turn subagents work only at the top level. A subagent started by another subagent always runs synchronously and can't receive follow-up messages, even when the caller asks for background mode. The changelog says "Multi-turn subagents are always enabled, so you can send follow-up messages to running agents," and it doesn't mention a depth limit.

What actually happens:

  • The parent's task call returns the child's final answer inline instead of "Agent started in background".
  • write_agent to the child fails: write_agent only supports background agents. Agent <id> is in sync mode. A new background task must be started for follow-up messages. But the call that started it did ask for background mode.
  • The task tool schema shown to the parent subagent lists only agent_type, context_tier, description, model, name, prompt and reasoning_effort, with no mode. Passing mode: "background" is accepted and silently ignored.
  • In events.jsonl, every subagent started by a subagent has "executionMode":"sync","resumable":false. That held in 27 of 27 nested starts that requested background, across several sessions. Top-level starts that request background get "executionMode":"background", and write_agent works on them.

This breaks layered delegation. A lead agent that delegates to a specialist can't send it a follow-up, such as answers to questions the specialist asked. It has to start a new subagent and repeat all the context.

Affected version

Copilot runtime 1.0.111-0 (bundled in VS Code 1.147.0, commit 8a14f0cc1b08d531eb83255ea3764ae22aa932b5, via the Agent Host), macOS 27.2.1

Steps to reproduce the behavior

  1. From the top-level session, start agent A with task and mode: "background".
  2. Have A start agent B with task and mode: "background". In the prompt, ask B to remember a code, e.g. "Remember the code 6612 and reply only 'ok'."
  3. Observe that A's task call returns B's answer (ok) inline, not "Agent started in background".
  4. Have A call write_agent to B's agent_id: "What code did I give you?"
  5. Observe the error: write_agent only supports background agents. Agent <id> is in sync mode.
  6. Optionally check events.jsonl: B's subagent.started event has "executionMode":"sync","resumable":false.

Expected behavior

A subagent started by another subagent with mode: "background" runs in the background like a top-level background agent, and write_agent/read_agent work on it, so B answers with the code it was given. This should be subject to the existing subagents.maxDepth and concurrency limits.

If nested background agents aren't meant to be supported, reject mode: "background" from a subagent with a clear error, and document that multi-turn subagents are top-level only. Today the parameter is silently dropped and the failure only shows up later, in write_agent.

Additional context

  • The SDK's session event types document subagent resumable as "Currently always false."
  • Nested chats created with the VS Code Agent Host's create_session can be resumed (via send_message / get_session_context), but they can't run as a custom agent. So there's no delegation path that gives both a specific custom agent and a conversation the caller can resume below the top level.
  • I found this through the VS Code Agent Host. Does the Agent Host need a matching change (e.g. to show nested background agents or to expose mode in the subagent tool schema)?

Activity

  1. added theissue type on Nov 21, 2026
  2. added
    area:agentsSub-agents, fleet, autopilot, plan mode, background agents, and custom agents
    and removed on Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:agentsSub-agents, fleet, autopilot, plan mode, background agents, and custom agents

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions