Skip to content

Copilot removes large chunks of code #251806

Open
@TriggeredBanana

Description

@TriggeredBanana

Type: Bug

Whenever I make a simple request not only does copilot more frequently get stuck fixing indents and and formatting issues that are not even there. When it is supposed to add a simple feature or method it randomly decides to remove 400, 800+ lines of codes that has nothing to do with its task. For example, I ask to add a small thing to the application and copilot decides to literally nuke (remove) the entire UI from existence. Its simply not usable, or at least not safe to use when it can remove important parts of the code randomly.

Log over copilot iterations:
Let me start by implementing the necessary changes:

multi_model_generator.py+128-0
Now I need to add the methods to handle custom safetensors models. Let me add them after the existing methods:

multi_model_generator.py+97-794
I need to fix the syntax error with the quotes:

Let me check the exact content around those lines:

Read multi_model_generator.py, lines 2350 to 2360

I can see the issue - the f-string is missing the closing quote. Let me fix it:

multi_model_generator.py+1-1
Now let me fix the second occurrence:

Read multi_model_generator.py, lines 2400 to 2410

multi_model_generator.py+1-2
Let me check the context around that area to fix the indentation:

Read multi_model_generator.py, lines 2390 to 2410

I can see the indentation is wrong. Let me fix it:

multi_model_generator.py+1-1
Let me rewrite this whole method properly. Let me find where this method starts and fix it:

Read multi_model_generator.py, lines 2385 to 2440

I can see there's still an indentation issue. Let me fix it:

multi_model_generator.py+2-2
There seems to be a formatting issue. Let me delete and rewrite this method entirely:

multi_model_generator.py+2-2
Let me check what's before this method to understand the indentation:

Read multi_model_generator.py, lines 2385 to 2395

I see the issue - the method definition needs proper indentation. Let me fix it:

multi_model_generator.py+2-2

VS Code version: Code 1.101.0 (dfaf441, 2025-06-11T15:00:50.123Z)
OS version: Windows_NT x64 10.0.19045
Modes:

System Info
Item Value
CPUs AMD Ryzen 7 5800X3D 8-Core Processor (16 x 3394)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
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
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 31.90GB (16.65GB free)
Process Argv --crash-reporter-id b511b655-eb2c-4814-9938-47e1c196e715
Screen Reader no
VM 0%
Extensions (49)
Extension Author (truncated) Version
better-comments aar 3.0.2
vscode-color-picker Ant 0.0.4
path-intellisense chr 2.10.0
doxdocgen csc 1.4.0
dscodegpt Dan 3.12.89
dart-code Dar 3.112.0
flutter Dar 3.112.0
docker doc 0.10.0
vscode-html-css ecm 2.0.13
auto-close-tag for 0.5.15
copilot Git 1.335.0
copilot-chat Git 0.28.0
better-cpp-syntax jef 1.27.1
cmake-language-support-vscode jos 0.0.9
rainbow-csv mec 3.19.0
vscode-containers ms- 2.0.3
vscode-docker ms- 2.0.0
csharp ms- 2.80.16
vscode-dotnet-runtime ms- 2.3.5
debugpy ms- 2025.8.0
python ms- 2025.8.0
vscode-pylance ms- 2025.6.1
jupyter ms- 2025.5.0
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.1.0
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
remote-containers ms- 0.417.0
remote-wsl ms- 0.99.0
cmake-tools ms- 1.20.53
cpptools ms- 1.25.3
cpptools-extension-pack ms- 1.3.1
postman-for-vscode Pos 1.12.1
vscode-css-peek pra 4.4.3
vscode-thunder-client ran 2.35.2
java red 1.42.0
LiveServer rit 5.7.9
claude-dev sao 3.17.12
vscode-language-pyret Set 0.1.0
pdf tom 1.2.2
intellicode-api-usage-examples Vis 0.2.9
vscodeintellicode Vis 1.3.2
vscode-gradle vsc 3.16.4
vscode-java-debug vsc 0.58.2
vscode-java-dependency vsc 0.24.1
vscode-java-pack vsc 0.29.2
vscode-java-test vsc 0.43.1
vscode-maven vsc 0.44.0
JavaScriptSnippets xab 1.8.0

(1 theme extensions excluded)

A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
c4g48928:30535728
azure-dev_surveyone:30548225
2i9eh265:30646982
962ge761:30959799
2e7ec940:31000449
pythontbext0:30879054
cppperfnew:31000557
dwnewjupyter:31046869
pythonrstrctxt:31112756
nativeloc1:31192215
5fd0e150:31155592
dwcopilot:31170013
6074i472:31201624
dwoutputs:31242946
customenabled:31248079
hdaa2157:31222309
copilot_t_ci:31222730
e5gg6876:31282496
pythoneinst12:31285622
bgtreat:31268568
4gafe986:31271826
c7cif404:31314491
5b33h341:31326279
pythonpulldiagcf:31325931
996jf627:31283433
pythonrdcb7cf:31303019
usemplatestapi:31297334
0aa6g176:31307128
7bj51361:31289155
747dc170:31275177
aj953862:31281341
generatesymbolt:31295002
convertfstringf:31295003
slnless:31330092
0g0a1943:31327026
nesew1to4:31330636
1292j425:31329156
82j33506:31327384

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions