Skip to content

Copilot Chat agent mode stuck in infinite loop editing the same file over and over #257885

@jasonkcarter

Description

@jasonkcarter

Type: Bug

I don't know how reproducible this is, but I've included the gist of my chat history below by the end of the chat, the Markdown file in question got a spinning icon next to the file name in its tab, and the Keep/Undo history above the chat box exploded with thousands of references to the same file. The file change counter continued incrementing higher as if there were multiple files being edited. I clicked the stop generating button, and by that time (just about 20 seconds), the counter was already as "2080 files changed". It also miscounted the number of images in the directory I passed, doubling the actual count.

Image

This was all using Google Gemini 2.5 Pro Preview as the model during the chat session in question. Clicking the redo button with Claude Sonnet 4 active as the model did not produce the same bug.

jasonkcarter: I have a copied chat log from Github Copilot Chat agent mode with Claude Sonnet 4. However, it is missing many details that are included in the UI, like "✅Read 📄Docs/MyFile.csv, lines 1100 to 1110" and "Searched text for Constants.(SomeText|SomeOtherText) (**/*.cs), 20 results" and "Searched for files matching **/FolderName/*FileName*.sql, 2 matches" and "📄MyFile.csv +5 -5"

For prompts from the user jasonkcarter, it's also missing the list of files that were included with the prompt for context.

I have taken screenshots of the full chat history and saved them the .github/chats/ folder as PNG files of the pattern .github\chats\data-dictionary-generation_2024-07-25_##.png, where ## represents the numerical ordinal of the screenshot in chronological order.

Please iterate through all these files in order, transcribe the images into text including all of the missing annotations mentioned above, and update .github\chats\data-dictionary-generation_2024-07-25.md with the missing annotations. I have attached the first image to get started.

GitHub Copilot: Of course. I will systematically go through the screenshots provided, transcribe the missing details, and update the chat log in data-dictionary-generation_2024-07-25.md.

First, I will list all the relevant screenshot files to process. I will start by transcribing the user's request from the first image and updating the markdown file. Then, I will proceed with the remaining images in chronological order, transcribing each one and appending the content to the markdown file.



Made changes.


I have updated the chat log with the content from the first image. I will now proceed to transcribe the remaining 53 images in chronological order, appending the transcribed text with all the missing annotations to the markdown file, data-dictionary-generation_2024-07-25.md.

jasonkcarter: That was perfectly done. Please proceed to the next two images.

GitHub Copilot: Of course. I will now transcribe the next two images in the sequence and append the content to the markdown file.


Made changes.




Extension version: 0.29.1
VS Code version: Code 1.102.2 (c306e94f98122556ca081f527b466015e1bc37b0, 2025-07-22T12:15:48.520Z)
OS version: Windows_NT x64 10.0.26100
Modes:

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) Ultra 7 155H (22 x 2995)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: enabled_on<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>opengl: enabled_on<br>rasterization: enabled<br>raw_draw: disabled_off_ok<br>skia_graphite: disabled_off<br>video_decode: enabled<br>video_encode: enabled<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: enabled<br>webgpu: enabled<br>webnn: disabled_off|
|Load (avg)|undefined|
|Memory (System)|63.51GB (36.95GB free)|
|Process Argv|-n --crash-reporter-id 825e5e66-e835-47d0-b4ed-c23b6e97ddf5|
|Screen Reader|no|
|VM|0%|
</details><details>
<summary>A/B Experiments</summary>

```
vsliv368:30146709
binariesv615:30325510
9b8hh234:30694863
h48ei257:31000450
nativeloc1:31344060
dwcopilot:31170013
6074i472:31201624
dwoutputs:31242946
9064b325:31222308
copilot_t_ci:31333650
e5gg6876:31282496
pythoneinst12:31285622
c7cif404:31314491
pythonpulldiag:31343502
996jf627:31283433
pythonrdcb7:31342333
usemplatestapi:31297334
0aa6g176:31307128
747dc170:31275177
6518g693:31334701
aj953862:31281341
generatesymbolt:31295002
convertfstringf:31295003
pylancequickfixt:31350061
9d2cg352:31346308
convertlamdaf:31350062
usemarketplace:31343026
nesew2to5:31336538
agentclaude:31335814
b6b4d950:31327385
nes-diff-11:31337487
replacestringexc:31350595
nes-set-on:31340697
6abeh943:31336334
yijiwantestdri0626-t:31336930
0927b901:31350571
4gdec884:31348710
0cj2b977:31352657

```

</details>

<!-- generated by issue reporter -->

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions