Skip to main content
Skip to content

Using subagents in your IDE

Delegate a self-contained subtask to a separate agent that works in its own context and reports back to your main chat session.

Introduction

Puede usar subagents para delegar tareas en un agente aislado con su propia ventana de contexto dentro de la sesión de chat. El subagent funciona de forma independiente sin pausar los comentarios del usuario y devuelve el resultado final a la sesión de chat principal.

Subagents son más adecuados para situaciones en las que:

  • Quiere delegar tareas complejas y de varios pasos, como la investigación o el análisis sin interrumpir la sesión principal.
  • Debe procesar grandes cantidades de información o varios documentos que desordenan la ventana de contexto principal.
  • Quiere explorar diferentes enfoques o perspectivas de forma independiente sin mezclar los contextos.

Subagents utilizan las mismas herramientas y el mismo modelo de IA que la sesión principal, pero no pueden crear otros subagents.

Subagents are available in Visual Studio Code, JetBrains IDEs, Xcode, and Eclipse. They are not currently available in Visual Studio. The steps to enable and invoke them differ by editor, so click the tabs above for instructions for your IDE.

For the agent session that subagents are delegated from, see Using agent mode in your IDE.

Enabling subagents

  1. In the Copilot Chat window, click the tools icon.
  2. Enable the runSubagent tool.

If you use custom prompt files or custom agents, ensure you specify the runSubagent tool in the tools frontmatter property. See Creación de agentes personalizados para Copilot cloud agent, and Use prompt files in VS Code in the Visual Studio Code documentation.

Invoking subagents

Subagents se pueden invocar de diferentes maneras.

  • Delegación automática. Copilot analizará la descripción de su solicitud, el campo de descripción de sus custom agents configurados, y el contexto actual y las herramientas disponibles para elegir automáticamente un subagent. Por ejemplo, este mensaje delegaría automáticamente la tarea en un especialista en refactorización custom agent:

    Suggest ways to refactor this legacy code.
    
  • Invocación directa. Puede llamar directamente a subagent en su solicitud:

    Use the testing subagent to write unit tests for the authentication module.
    
  • Calling the #runSubagent tool.

    Evaluate the #file:databaseSchema using #runSubagent and generate an optimized data-migration plan.
    

When the subagent completes its task, its results appear back in the main chat session, ready for follow-up questions or next steps.

Further reading

To use subagents, you must have custom agents configured in your environment. See Using custom agents in your IDE.

Enabling subagents

  1. Click Tools in the menu bar, then click GitHub Copilot, then Edit Settings.
  2. In the popup menu, click Chat, then click the Enable Subagent checkbox.

Invoking subagents

Subagents se pueden invocar de diferentes maneras.

  • Delegación automática. Copilot analizará la descripción de su solicitud, el campo de descripción de sus custom agents configurados, y el contexto actual y las herramientas disponibles para elegir automáticamente un subagent. Por ejemplo, este mensaje delegaría automáticamente la tarea en un especialista en refactorización custom agent:

    Suggest ways to refactor this legacy code.
    
  • Invocación directa. Puede llamar directamente a subagent en su solicitud:

    Use the testing subagent to write unit tests for the authentication module.
    

When the subagent completes its task, its results appear back in the main chat session, ready for follow-up questions or next steps.

Further reading

To use subagents, you must have custom agents configured in your environment. See Using custom agents in your IDE.

Enabling subagents

  1. Click Editor in the menu bar, then click GitHub Copilot then Open GitHub Copilot for Xcode Settings.
  2. Click Advanced in the chat panel, then under Chat Settings click the Enable Subagents toggle.

Invoking subagents

Subagents se pueden invocar de diferentes maneras.

  • Delegación automática. Copilot analizará la descripción de su solicitud, el campo de descripción de sus custom agents configurados, y el contexto actual y las herramientas disponibles para elegir automáticamente un subagent. Por ejemplo, este mensaje delegaría automáticamente la tarea en un especialista en refactorización custom agent:

    Suggest ways to refactor this legacy code.
    
  • Invocación directa. Puede llamar directamente a subagent en su solicitud:

    Use the testing subagent to write unit tests for the authentication module.
    

When the subagent completes its task, its results appear back in the main chat session, ready for follow-up questions or next steps.

Further reading

To use subagents, you must have custom agents configured in your environment. See Using custom agents in your IDE.

Enabling subagents

  1. Click the icon in the status bar.
  2. In the popup menu, click Edit Preferences.
  3. Under Chat, click the Enable sub-agent check box.

Invoking subagents

Subagents se pueden invocar de diferentes maneras.

  • Delegación automática. Copilot analizará la descripción de su solicitud, el campo de descripción de sus custom agents configurados, y el contexto actual y las herramientas disponibles para elegir automáticamente un subagent. Por ejemplo, este mensaje delegaría automáticamente la tarea en un especialista en refactorización custom agent:

    Suggest ways to refactor this legacy code.
    
  • Invocación directa. Puede llamar directamente a subagent en su solicitud:

    Use the testing subagent to write unit tests for the authentication module.
    

When the subagent completes its task, its results appear back in the main chat session, ready for follow-up questions or next steps.

Further reading