Skip to content

Bug Report: VS Code/GitHub Copilot Recreates Deleted Files When Switching Chat Threads #251284

Open
@Lalitj03

Description

@Lalitj03

Does this issue occur when all extensions are disabled?: No

Version: 1.100.3 (user setup)
Commit: 258e40f
Date: 2025-06-02T13:30:54.273Z
Electron: 34.5.1
ElectronBuildId: 11369351
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Windows_NT x64 10.0.26100

Summary

When switching back to a GitHub Copilot chat thread that previously referenced files, VS Code automatically recreates those files as empty files if they were deleted.

Steps to Reproduce

  1. Open VS Code workspace with multiple files in a directory
  2. Start GitHub Copilot chat and add several files in the chat context
  3. Delete some of the referenced files using PowerShell command:
    Remove-Item -Force "file1.md", "file2.md", "file3.md"
  4. Switch to a new chat send at least one message
  5. Return to original chat thread that referenced the deleted files

Expected: Deleted files stay deleted
Actual: Empty files are recreated with the same names

System Details

  • Windows 11
  • PowerShell (pwsh.exe) as default shell
  • Files deleted using Remove-Item -Force command
  • Recreated files are empty (no original content)

Example

  • Command used: Remove-Item -Force "docs/README.md", "docs/GUIDE.md", "docs/STATUS.md"
  • Result: Empty files README.md, GUIDE.md, STATUS.md recreated when returning to chat thread

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable bugchat-agent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions