Agent Mode drops workspace scope at Thinking -> Analyzing transition (files panel clears, workspace MCP count decreases)

Open
#320,798 0 comments 0 reactions 1 assignee View on GitHub

@zhichli is already working on this.

Since Jun 10, 2026.

Assessment

This issue has not been assessed yet.

Description

stale triage-needed
Summary

In VS Code Insiders Agent Mode, a new session starts with the correct workspace
scope and workspace MCP servers visible. After the first prompt, when status
changes from Thinking to Analyzing, the session detaches from workspace scope.
The right-hand files list clears and workspace MCP servers disappear from
Customizations.

Environment
  1. VS Code: 1.124.0-insider
  2. Copilot extension: 0.52.2026060802
  3. OS: Windows
  4. Workspace: D:/WorkPlannerAgent (opened as workspace)
  5. MCP setup: workspace .vscode/mcp.json file present and valid
Repro steps
  1. Open workspace D:/WorkPlannerAgent in VS Code Insiders.
  2. Open Agent Mode window.
  3. Confirm right panel shows workspace files.
  4. Confirm Customizations shows 12 MCP servers (includes workspace-scoped servers).
  5. Send first prompt in a new session.
  6. Observe status transitions from Thinking to Analyzing.
Actual result
  1. During Thinking: scope remains correct.
  2. On transition to Analyzing:
    • right-hand files panel clears
    • workspace scope appears dropped
    • MCP count in Customizations drops from 12 to 9
Expected result

Workspace scope should remain attached for the entire session. Workspace files
and workspace-scoped MCP servers should not disappear after first prompt.

Frequency

Happens consistently in this workspace/session flow.

Impact

High. Agent loses repository context and workspace MCP tools, preventing normal
planning workflows.

Additional notes
  1. Folder selector was explicitly set before first prompt.
  2. Symptom still occurs exactly at Thinking -> Analyzing transition.
  3. This suggests failure during tool/context assembly or scope rebind in the analyze phase.
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.