Skip to content

[ENHANCEMENT] Add subagent tool to offload focused tasks #11741

@kels-ng

Description

@kels-ng

Problem (one or two sentences)

Add a subagent tool so the model can run a focused sub-task in the background. The subagent’s result or summary is returned as the tool result and the main task continues in the same chat, without creating a new user-visible task.

Context (who is affected and when)

  • Keeps context in one place – Research, exploration, or multi-step sub-tasks can be done without switching to a new task or losing the current conversation. Reduce context pollution in main chat.
  • Clearer control – subagent_type lets users and the model choose read-only exploration vs. sub-tasks that may edit files or run commands.
  • Better flow – The main task gets a single, structured result from the subagent instead of long inline outputs, so the model can reason and continue more reliably.
  • Fits existing mental model – Subagents are for offloading work inside a task; creating a new user-visible task stays the job of the existing new_task tool.

Desired behavior (conceptual, not technical)

  • The model calls the subagent tool with:

    • description – Short label shown in the chat (e.g. “List exports in src”, “Check README”).
    • prompt – Full instructions for the subagent. Its result/summary is returned as the tool result.
    • subagent_type – "explore" (read-only: search, list, read only) or "general" (full tools: read, edit, run commands).
  • The sub-task runs in the background; the user stays in the current task.

  • Progress is shown in the chat (e.g. “Running subagent: …”, current step).

  • When the subagent finishes (or is cancelled), its result is passed back to the model as the tool result so the main task can use it in the next step.

Constraints / preferences (optional)

  • Feature is experiment-gated (e.g. under Settings → Experimental). Default: off, so current behavior is unchanged until users opt in.
  • When enabled, the model can call the subagent tool when it needs to offload a focused sub-task or do read-only exploration without leaving the current task.

Request checklist

  • I've searched existing Issues and Discussions for duplicates
  • This describes a specific problem with clear context and impact

Roo Code Task Links (optional)

No response

Acceptance criteria (optional)

No response

Proposed approach (optional)

No response

Trade-offs / risks (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions