AI overwriting local file with remote

Open
#321,301 2 comments 0 reactions 1 assignee View on GitHub

@DonJayamanne is already working on this.

Since Jun 14, 2026.

Assessment

This issue has not been assessed yet.

Description

info-needed

Type: Bug

AI completed a task to add code and also deleted 200 lines of unrelated code. When confronted, it agreed and tried to restore code to orginal. Instead of simply restoring from the restore point it created it went to the remote repo and tried to restore the page from there. In my opinion this is a critical security violation and should only be attempted when asked as a last resort. It's own internal restore point should have been the first choice. A setting to prevent such an action was not found in settings. A major oversight.

VS Code version: Code 1.124.2 (6928394f91b684055b873eecb8bc281365131f1c, 2026-06-12T00:12:36Z)
OS version: Windows_NT x64 10.0.19045
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz (8 x 2494)
GPU Status 2d_canvas: enabled
GPU0: VENDOR= 0x8086, DEVICE=0x0416 [Intel(R) HD Graphics 4600], DRIVER_VENDOR=Intel, DRIVER_VERSION=20.19.15.4624 ACTIVE
GPU1: VENDOR= 0x10de, DEVICE=0x1392 [NVIDIA GeForce GTX 860M], DRIVER_VERSION=23.21.13.8873
GPU2: VENDOR= 0x1414, DEVICE=0x008c [Microsoft Basic Render Driver], DRIVER_VERSION=10.0.19041.7181
Machine model name:
Machine model version:
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: unavailable_off
webgl: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 31.45GB (17.70GB free)
Process Argv --log github.copilot-chat=trace --crash-reporter-id bcc84c10-db2e-497b-84c4-818ecbeeb061
Screen Reader no
VM 0%
Extensions (11)
Name Identifier Author Version
PHP Intelephense bmewburn.vscode-intelephense-client bmewburn 1.18.4
markdownlint davidanson.vscode-markdownlint DavidAnson 0.61.2
PHPUnit emallin.phpunit emallin 4.16.1
GitHub Actions github.vscode-github-actions github 0.32.0
Rainbow CSV mechatroner.rainbow-csv mechatroner 3.24.1
C# Dev Kit ms-dotnettools.csdevkit ms-dotnettools 3.20.199
C# ms-dotnettools.csharp ms-dotnettools 2.140.9
.NET Install Tool ms-dotnettools.vscode-dotnet-runtime ms-dotnettools 3.1.0
Chat Customizations Evaluations ms-vscode.vscode-chat-customizations-evaluations ms-vscode 1.0.7
YAML redhat.vscode-yaml redhat 1.23.0
PHP Debug xdebug.php-debug xdebug 1.40.1
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.