Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Copilot Agent sometimes replaces contents of one file with contents of another file

Đang mở
#617 5 bình luận 2 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
28/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
macos, swift
Lĩnh vực
desktop-dev, devtools

Hướng nghiên cứu

Bắt đầu bằng cách xem lại các log được liên kết và so sánh trình xem diff của UI trò chuyện với các thay đổi được hiển thị trong Xcode's git view. Tập trung vào các chỉnh sửa Agent trên nhiều tệp và hành vi sau khi nhập “continue”; được xem là hoàn tất khi tái hiện được vấn đề và đảm bảo mỗi tệp nhận đúng các thay đổi dự kiến mà không bị nội dung của tệp khác thay thế.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

reviewed

Describe the bug
Sometimes when Copilot Agent mode works on a more complicated task, it can happen that the contents of one file are replaced with the contents of another file.

One example: Say we have some files A, B and C that Copilot tries to edit.
Copilot successfully suggests edits for all three files, but looking at the changes actually applied to Xcode only files A and B have the correct changes applied, while C now also contains the same code as for example B.

Versions

  • Copilot for Xcode: 0.44.0
  • Xcode: 26.0.1
  • macOS: 26.1 (happend on 26.0 as well)

Steps to reproduce

  1. Ask an Agent to perform some more complicated changes in a non-small code base.
  2. Watch as the changes are applied incorrectly.

Screenshots
correct edits in the chat ui diff viewer, but incorrectly applied when viewed from the Xcode git view:
Image

after typing continue, the previous changes are applied automatically and the new changes are applied incorrectly once again:
Image

Logs
Here are the logs from the time frame I've tried to reproduce the issue.
The stuff further down is probably more relevant, as I wasn't immediately able to reproduce it.
However, I don't really know what part of these logs actually contains useful information.

Additional context
Interestingly, opening the suggested changes from the chat ui (see example above), the changes for file A, B and C are valid.
They just seem to be applied incorrectly.
Also, the agent was stopped because it reached the maximum attempts limit.

Typing continue made the situation even weirder:
Staying with the example above, where previously there suggested changes were displayed in the chat ui, now only one change is shown.
Applying this change correctly, the whole issue described above would've been resolved.
However, this change was applied incorrectly as well:

actual edits before "continue":
A -> edited A
B -> edited B
C -> edited B

actual edits after "continue":
A -> edited A
B -> edited B -> edited A
C -> edited B

Please note that this A, B, C example might not 100% accurately describe the actually displayed behavior; it's just supposed to roughly illustrate the problem

I was only able to reproduce this in a more complex codebase (i.e. in my own project, where the code can get quite messy and complex in a few places).

When trying to reproduce the issue I used Grok Code Fast 1, I don't know which model I used when I first discovered this problem.

I tried to reproduce the issue in the Simple SwiftUI project, but I had no success.
However, I was able to reproduce the problem in my own project (this is not open source so I can't link to the code here).
I didn't have the time to try it on another larger project though.

Ngôn ngữ chính
Swift
Star
6.3k
Fork
2k
Merge trung bình
3 ngày 21 giờ
Pull request đã merge (30 ngày)
2

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của github/CopilotForXcode

Tất cả issue của github/CopilotForXcode

Issue tương tự

Thêm issue về Swift

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.