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

Vous pouvez utiliser subagents pour déléguer des tâches à un agent isolé avec sa propre fenêtre de contexte au sein de votre session de conversation. Le subagent fonctionne indépendamment sans interrompre les commentaires des utilisateurs et retourne le résultat final à la session de conversation principale.

Subagents sont les mieux adaptées aux situations où :

  • Vous souhaitez déléguer des tâches complexes et multi-étapes telles que la recherche ou l’analyse sans interrompre votre session principale.
  • Vous devez traiter de grandes quantités d’informations ou plusieurs documents qui encombrent votre fenêtre de contexte principale.
  • Vous souhaitez explorer différentes approches ou perspectives indépendamment sans combiner de contextes.

Subagents utilisent les mêmes outils et le même modèle d’IA que la session principale, mais ne peuvent pas créer d’autres 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 Création d’agents personnalisés pour Copilot cloud agent, and Use prompt files in VS Code in the Visual Studio Code documentation.

Invoking subagents

Subagents peuvent être appelées de différentes manières :

  • Délégation automatique. Copilot analysera la description de votre demande, le champ de description de votre custom agents configuré, ainsi que le contexte actuel et les outils disponibles pour choisir automatiquement un subagent. Par exemple, cette invite délègue automatiquement la tâche à un spécialiste du refactoring custom agent :

    Suggest ways to refactor this legacy code.
    
  • Appel direct. Vous pouvez appeler directement le subagent dans votre invite :

    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 peuvent être appelées de différentes manières :

  • Délégation automatique. Copilot analysera la description de votre demande, le champ de description de votre custom agents configuré, ainsi que le contexte actuel et les outils disponibles pour choisir automatiquement un subagent. Par exemple, cette invite délègue automatiquement la tâche à un spécialiste du refactoring custom agent :

    Suggest ways to refactor this legacy code.
    
  • Appel direct. Vous pouvez appeler directement le subagent dans votre invite :

    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 peuvent être appelées de différentes manières :

  • Délégation automatique. Copilot analysera la description de votre demande, le champ de description de votre custom agents configuré, ainsi que le contexte actuel et les outils disponibles pour choisir automatiquement un subagent. Par exemple, cette invite délègue automatiquement la tâche à un spécialiste du refactoring custom agent :

    Suggest ways to refactor this legacy code.
    
  • Appel direct. Vous pouvez appeler directement le subagent dans votre invite :

    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 peuvent être appelées de différentes manières :

  • Délégation automatique. Copilot analysera la description de votre demande, le champ de description de votre custom agents configuré, ainsi que le contexte actuel et les outils disponibles pour choisir automatiquement un subagent. Par exemple, cette invite délègue automatiquement la tâche à un spécialiste du refactoring custom agent :

    Suggest ways to refactor this legacy code.
    
  • Appel direct. Vous pouvez appeler directement le subagent dans votre invite :

    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