Copilot overwriting newer files when switching between nested workspaces
@hediet is already working on this.
Since May 20, 2026.
Assessment
This issue has not been assessed yet.
Description
Type: Bug
Hello,
I have been noticing a "weird behaviour" when using copilot in 2 workspaces, where second workspace is nested in the first one, some files started randomly getting overwritten with their old version.
I have found out i am not in fact going insane, and managed to get reproduction steps and video:
Example hiearchy:
In this example workspace B is nested in the workspace A, with some files
- Workspace A
somefile-A.ts- Workspace B
somefile-B.ts
Example scenario:
- Open up workspace A
- Update
somefile-B.tsvia copilot edit, but do not accept changes - Open up workspace B, change content of
somefile-B.tsto something entirely different, save changes - Open up worspace A again, and revisit conversation from step 2 with unconfirmed (but still already written) changes
somefile-B.tsreverts changes made in step 3 back to copilot cached state from conversation from step 2
Why this sucks:
When working in monolith architecture where you want to work in 2 different scopes:
- Monolith scope for managing project-project interactions
- Single project scope for finetuning internal logic without needing to have monolith context
And current behaviour does really mess you up if you do this after huge edits and have no idea what is going on and why it occured, I lost a lot of hours facepalming and scrathing my head.
My ideas for solving this
- Some popup informing me that current file contents are newer than ones cached in that copilot session, and asking ME as developer if i want to revert back to copilot cached version or keep the newer one (even though that would invalidate the copilot session diff)
Right now this is done automatically and is destructive
Video evidence of this happening
(NOTE: file names differ from hiearchy from example, autosave is on)
https://github.com/user-attachments/assets/a5d72dd5-3402-4e77-b9ab-2feeacab92b4
Here is my vscode and copilot version:
Visual Studio Code
Version: 1.120.0 (system setup)
Commit: 0958016b2af9f09bb4257e0df4a95e2f90590f9f
Date: 2026-05-12T20:17:22Z (1 wk ago)
Electron: 39.8.8
ElectronBuildId: 13870025
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Windows_NT x64 10.0.26200
Identifier github.copilot-chat
Version 0.48.1
Last Updated 4 days ago
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.9k
- PR merge metrics
- PR metrics pending
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/vscode
-
testplan-item
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
new release
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
testplan-item
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
testplan-item
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
All issues in microsoft/vscode
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·