Skip to content

Duplicate code printed below correct code in same code block #286397

@jeffaxup

Description

@jeffaxup

Type: Bug

  • ask Gemini 2.5 Pro to generate new changes and to give the complete contents of the file with those changes.
  • It gives the changes, but at the end it generates the filename, followed by a duplicate set of those changes. So if you copy/paste the code segment you have incorrect code.
  • This has been happening for at least 6 mos or longer.
  • There is a related problem where if Gemini 2.5 Pro has to edit multiple files at the same time, instead of putting each file in a separate code block it will put all the changes into one code block (along with comments, incorrectly formatted as code.)
  • This is a serious ongoing issue regarding code quality, and it gets in the way of auto-applying changes accurately.
  • I believe this is probably a Gemini 2.5 Pro specific issue, but this is the main model I use for everything.

Extension version: 0.35.3
VS Code version: Code 1.107.1 (Universal) (994fd12, 2025-12-17T14:15:14.850Z)
OS version: Darwin arm64 24.6.0
Modes:

System Info
Item Value
CPUs Apple M4 Max (16 x 2400)
GPU Status 2d_canvas: enabled
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: enabled_on
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) 2, 2, 2
Memory (System) 64.00GB (0.35GB free)
Process Argv --crash-reporter-id 5cad0c4e-247c-4a20-810a-cecab405b0ff
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31436602
aj953862:31281341
6abeh943:31336334
envsdeactivate2:31353495
cloudbuttont:31379625
todos-1:31405332
3efgi100_wstrepl:31403338
use-responses-api:31390855
anonusage:31403420
je187915:31401257
3i15c187:31428712
ec5jj548:31422691
terminalsuggestenabled:31431119
cmp-ext-treat:31426748
cp_cls_c_966_ss:31442353
c0683394:31419495
478ah919:31426797
ge8j1254_inline_auto_hint_haiku:31431912
a5gib710:31434435
38bie571_auto:31440726
request_with_suggest:31435827
rename_enabled:31436409
7a04d226_do_not_restore_last_panel_session:31438103
anthropic_thinking_t:31432745
h0hdh950:31428394
9ab0j925:31438092
cp_cls_c_1081:31433293
copilot-nes-oct-trt:31432596
nes-jump-ctrl:31442063
nes-slash-models-on:31441832
nes-set-to-on:31441941

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions