Custom agent frontmatter is not automatically loaded on VSCode startup.

Open
#321,765 16 comments 0 reactions 1 assignee View on GitHub

@aeschli is already working on this.

Since Jun 17, 2026.

Assessment

This issue has not been assessed yet.

Description

  • Copilot Chat Extension Version: Built-in
  • VS Code Version: 1.124.2 (Universal)
  • OS Version: macOS 26.5.1 (25F80)
  • Feature (e.g. agent/edit/ask mode): agent
  • Selected model (e.g. GPT 4.1, Claude 3.7 Sonnet): GPT-5.4 (but happens with other models as well)

Problem:

After restarting VS Code, selecting a custom agent does not reliably load the metadata configured in its frontmatter into the chat UI.

The chat window keeps using the model and tools that were already active in the chat session instead of switching to the model and tools configured for the selected agent. Agents with user-invocable: false are still shown in the UI.
It seems that this does not only affect the UI, but the whole chat functionality, in particular this also affects subagents.

The configuration only starts working after opening the corresponding agent file and saving it again without making any changes. After that, the configured model and tools are applied correctly and non user invocable agents disappear.

Steps to Reproduce:

  1. Enable allowInvocationsFromSubagents
  2. Create one or more custom agents and subagents with frontmatter that defines description, model, and tools.
  3. Restart VS Code.
  4. Open the chat view and select one of the configured agents.
  5. Observe that the chat UI does not update to the model and tools defined in the selected agent's frontmatter.
  6. Ask the agent to trigger a subagent.
  7. Observe in Debug View that the subagent request uses the model and tools currently active in the chat window instead of the ones configured in the selected subagent.
  8. Open the corresponding .agent.md file.
  9. Save the file again without making any changes.
  10. Observe that after saving, the agent metadata is loaded and the configured model/tools are then applied.

Expected:

Selecting an agent or subagent after restarting VS Code should immediately apply the frontmatter-defined description, model, and tools.

Actual:

After restart, custom agent frontmatter is not automatically loaded. Easily visible by non user-invocable agents still appearing in the UI, but also causing sideeffects to agents that are selected and subagents that are indirectly called.

Logs:

This log snippet shows that the description of the research and scout agents was not loaded:

<agent>
<name>research</name>
</agent>
<agent>
<name>scout</name>
</agent>
<agent>

(Taken from Debug Chat Panel - subAgent Tool call - Requests - System)

In other logs, for example tool/runSubagent-..., the model used for the subagent does not match the model configured in the subagent frontmatter.

Example frontmatter configuration:

model:
  [
    GPT-5.4 mini (copilot),
    Gemini 3.5 Flash (copilot),
    Claude Haiku 4.5 (copilot),
  ]

Observed in logs:

model            : gpt-5.4
resolved model   : gpt-5.4-2026-03-05

The same logs also show that the tools used are the ones active in the chat window at that moment, not the tools configured in the subagent frontmatter.

Dominant language
TypeScript
Stars
193k
Forks
42.9k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/vscode

All issues in microsoft/vscode

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.