microsoft / microsoft/vscode

Copilot Chat loses custom agents and MCP servers after first prompt (workspace becomes `unknown:/`)

Open
#324,402 0 comments 0 reactions 1 assignee Claimed by @sandy081 View on GitHub
agents-window
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

**VS Code version**
1.127.0

**Copilot Chat version**
0.55.0

**OS**
Windows 11

**Issue type**
Bug

**Description**
When I start a new chat with a custom agent selected, the agent is initially visible and selectable. After sending the first prompt, the Agents view loses my custom agent(s) and MCP server(s), and the chat continues with default behavior.

I can reproduce this consistently.

**Repro steps**
1. Open workspace folder.
2. Confirm custom agent appears in Agents view.
3. Confirm MCP servers appear (including `unraid-mcp`).
4. Start new chat with custom agent selected.
5. Send first prompt.
6. Observe custom agent and MCP servers disappear from session context and fallback occurs.

**Expected result**
Selected custom agent remains active and MCP servers remain available for the chat session.

**Actual result**
After first prompt:
- custom agent disappears from active set
- MCP server count drops
- chat runs with default agent behavior

**What I already tried**
- Enabled `security.workspace.trust.enabled = true`
- Reloaded window
- Started new chats
- Issue still reproduces

**Key evidence from logs**
- Initially loads correctly:
- customizations log shows `agents = 1` and `MCP Servers = 2`
- Then workspace resolution fails:
- renderer log repeatedly shows `unknown:/...` and `ENOPRO`
- examples:
- `Failed to get installed servers from unknown:/.vscode/mcp.json`
- `Failed to resolve files at location: unknown:/.github/agents`
- After that, customizations drop:
- customizations log shows `agents = 0` and `MCP Servers = 1`
- MCP then fails:
- Copilot Chat log:
- `Failed to load tools for MCP server unraid-mcp`
- `Gateway not found`
- SSE reconnect failures / Not Found

**Relevant log files attached**
[customizationsDebug.log](https://github.com/user-attachments/files/29680325/customizationsDebug.log)
[GitHub Copilot Chat.log](https://github.com/user-attachments/files/29680328/GitHub.Copilot.Chat.log)
[mcpGateway.log](https://github.com/user-attachments/files/29680327/mcpGateway.log)
[renderer.log](https://github.com/user-attachments/files/29680326/renderer.log)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.