Copilot Agent sometimes replaces contents of one file with contents of another file
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 28/100
- Type d'issue
- Bug
- Clarté
- À clarifier
- Activité
- À l'abandon
- Stack technique
- macos, swift
- Domaine
- desktop-dev, devtools
Piste de recherche
Commencez par examiner les logs liés et comparer le visualiseur de diff de l'UI de chat avec les changements affichés dans Xcode's git view. Concentrez-vous sur les modifications de Agent portant sur plusieurs fichiers et sur le comportement après avoir saisi « continue » ; le travail est terminé lorsque le problème est reproduit et qu'il est vérifié que chaque fichier reçoit les changements prévus sans que le contenu d'un autre fichier ne le remplace.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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
- Ask an Agent to perform some more complicated changes in a non-small code base.
- 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:
after typing continue, the previous changes are applied automatically and the new changes are applied incorrectly once again:
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.
- Langage dominant
- Swift
- Étoiles
- 6.3k
- Forks
- 2k
- Merge moyen
- 3 j 21 h
- PR mergées (30 j)
- 2
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de github/CopilotForXcode
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
github/CopilotForXcode#181 · 2 réactions ·
-
Add ability to attach Copilot window only to Xcode projects/workspaces, ignoring standalone files Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 68/100
github/CopilotForXcode#945 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 35/100
github/CopilotForXcode#943 ·
-
Luisgerardomartinezlara Ouverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 10/100
github/CopilotForXcode#936 · 2 commentaires ·
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 10/100
github/CopilotForXcode#934 ·
Toutes les issues de github/CopilotForXcode
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
maxgoedjen/secretive#840 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
manaflow-ai/cmux#13763 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
openwallet-foundation/multipaz#2028 ·