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

Вы можете использовать subagents для делегирования задач изолированному агенту с собственным контекстным окном внутри вашей сессии чата. subagent работает независимо без паузы для отзывов пользователя и возвращает итоговый результат в основную сессию чата.

Subagents лучше всего подходят для ситуаций, когда:

  • Вы хотите делегировать сложные, многоступенчатые задачи, такие как исследование или анализ, не прерывая основную сессию.
  • Вам нужно обрабатывать большие объёмы информации или несколько документов, которые будут загружать основное окно контекста.
  • Вы хотите исследовать разные подходы или точки зрения независимо, не смешивая контексты.

Subagents используют те же инструменты и модель ИИ, что и основная сессия, но не могут создавать другие 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 Создание кастомных агентов для Copilot cloud agent, and Use prompt files in VS Code in the Visual Studio Code documentation.

Invoking subagents

Subagents может быть вызван по-разному:

  • Автоматическое делегирование. Copilot проанализирует описание вашего запроса, поле описания настроенного custom agents, а также текущий контекст и доступные инструменты для автоматического выбора subagent. Например, этот запрос автоматически делегирует задачу специалисту по рефакторингу custom agent:

    Suggest ways to refactor this legacy code.
    
  • Прямой призыв. Вы можете напрямую вызвать subagent в вашем prompt:

    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 может быть вызван по-разному:

  • Автоматическое делегирование. Copilot проанализирует описание вашего запроса, поле описания настроенного custom agents, а также текущий контекст и доступные инструменты для автоматического выбора subagent. Например, этот запрос автоматически делегирует задачу специалисту по рефакторингу custom agent:

    Suggest ways to refactor this legacy code.
    
  • Прямой призыв. Вы можете напрямую вызвать subagent в вашем prompt:

    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 может быть вызван по-разному:

  • Автоматическое делегирование. Copilot проанализирует описание вашего запроса, поле описания настроенного custom agents, а также текущий контекст и доступные инструменты для автоматического выбора subagent. Например, этот запрос автоматически делегирует задачу специалисту по рефакторингу custom agent:

    Suggest ways to refactor this legacy code.
    
  • Прямой призыв. Вы можете напрямую вызвать subagent в вашем prompt:

    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 может быть вызван по-разному:

  • Автоматическое делегирование. Copilot проанализирует описание вашего запроса, поле описания настроенного custom agents, а также текущий контекст и доступные инструменты для автоматического выбора subagent. Например, этот запрос автоматически делегирует задачу специалисту по рефакторингу custom agent:

    Suggest ways to refactor this legacy code.
    
  • Прямой призыв. Вы можете напрямую вызвать subagent в вашем prompt:

    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