CopilotForXcode icon indicating copy to clipboard operation
CopilotForXcode copied to clipboard

Corrupt files being generated constantly

Open gvdevx opened this issue 7 months ago • 18 comments

Here you go. It does not work in Xcode. Sometimes it says it edited files but hasnt done anything. Other times it just corrupts the file. Here is what the chat told me to send you. By the way I am paying money for this non-functionality.


I notice that you're asking about sending a message regarding broken file editing functionality. As an AI assistant, I cannot directly send messages to support. The best course of action would be for you (the user) to report this issue through the appropriate GitHub support channels, describing the problem with the file editing functionality.

In this case, the issue appears to be that the insert_edit_into_file tool is not properly handling partial file edits and is instead attempting to replace the entire file content. This would be valuable feedback for the development team.

The behavior you're seeing (file corruption when trying to make partial edits)

The fact that the tool is not properly respecting the "...existing code..." markers

gvdevx avatar May 31 '25 10:05 gvdevx

Happens to me too. I found that telling the agent that the changes have not been applied usually results in the agent then applying them correctly, but it's a bit of an hassle and doesn't inspire much trust especially for multi-file edits.

gabrieledintino avatar May 31 '25 11:05 gabrieledintino

May I see what the file is saying while it's editing the file I would like to what is going on my name is Micheal thank you for your time sorry for your inconvenience. Michael Limbaugh

On Sat, May 31, 2025, 6:34 AM Gabriele @.***> wrote:

gabrieledintino left a comment (github/CopilotForXcode#309) https://github.com/github/CopilotForXcode/issues/309#issuecomment-2925026189

Happens to me too. I found that telling the agent that the changes have not been applied usually results in the agent then applying them correctly, but it's a bit of an hassle and doesn't inspire much trust especially for multi-file edits.

— Reply to this email directly, view it on GitHub https://github.com/github/CopilotForXcode/issues/309#issuecomment-2925026189, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6KAOAGDI3RBUWIHKDZGLXL3BGHTPAVCNFSM6AAAAAB6JYHWYSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSMRVGAZDMMJYHE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Michael3452 avatar May 31 '25 12:05 Michael3452

**Let me fix the issue. I made a mistake earlier - while I described the changes, I didn't actually implement them in a way that would work because my edit was overwriting the entire file.

I apologize for corrupting the file. You're right - my previous edit attempted to replace the entire file content which was incorrect. Let me fix this by making only the necessary changes to add the pending chat request functionality: <Editing file...>

I apologize for my previous attempts. Let me fix this properly by adding just the new functionality in a targeted way: <Editing file...>**

Just still ends up with a corrupted incomplete file. You know what would be good. For the AI to never EVER say 'I apologise'.

gvdevx avatar May 31 '25 12:05 gvdevx

Why on earth do you not allow text to be copied from the chat??? OMG! You only allow a single paragraph copy. Anyhow here is the detailed report in a screenshot that Copilot said the issues were:

Image

gvdevx avatar May 31 '25 12:05 gvdevx

It's just being nice and can someone show me what is going on when you say it is corrupting the files how and by what means is it doing by earsing some of them or turning letters in to symbols how.

Michael Limbaugh

On Sat, May 31, 2025, 7:21 AM gvdevx @.***> wrote:

gvdevx left a comment (github/CopilotForXcode#309) https://github.com/github/CopilotForXcode/issues/309#issuecomment-2925123597

**I apologize for corrupting the file. You're right - my previous edit attempted to replace the entire file content which was incorrect. Let me fix this by making only the necessary changes to add the pending chat request functionality:

I apologize for my previous attempts. Let me fix this properly by adding just the new functionality in a targeted way: **

Just still ends up with a corrupted incomplete file. You know what would be good. For the AI to never EVER say 'I apologise'.

— Reply to this email directly, view it on GitHub https://github.com/github/CopilotForXcode/issues/309#issuecomment-2925123597, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6KAOAG3YT642Z2B5GOZ4SL3BGNGPAVCNFSM6AAAAAB6JYHWYSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSMRVGEZDGNJZG4 . You are receiving this because you commented.Message ID: @.***>

Michael3452 avatar May 31 '25 12:05 Michael3452

Image

gvdevx avatar May 31 '25 12:05 gvdevx

Image

gvdevx avatar May 31 '25 12:05 gvdevx

Thanks for sending me the info ok have a nice day. Michael Limbaugh

On Sat, May 31, 2025, 7:34 AM gvdevx @.***> wrote:

gvdevx left a comment (github/CopilotForXcode#309) https://github.com/github/CopilotForXcode/issues/309#issuecomment-2925135374 image.png (view on web) https://github.com/user-attachments/assets/1bdd1d89-d461-4105-a445-2a7117fc8a2b

— Reply to this email directly, view it on GitHub https://github.com/github/CopilotForXcode/issues/309#issuecomment-2925135374, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6KAOAB522YDF3COR2NVQ6T3BGOUXAVCNFSM6AAAAAB6JYHWYSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSMRVGEZTKMZXGQ . You are receiving this because you commented.Message ID: @.***>

Michael3452 avatar May 31 '25 12:05 Michael3452

Hi @gvdevx, @gabrieledintino. Thanks for reaching out and sorry for any inconvenience. Could you help to share the log file located at ~/Library/Logs/GitHubCopilot/github-copilot-for-xcode.log? It's help to figure out what happened.

lijie-lee avatar Jun 03 '25 05:06 lijie-lee

Here you go. It does not work in Xcode. Sometimes it says it edited files but hasnt done anything. Other times it just corrupts the file. Here is what the chat told me to send you. By the way I am paying money for this non-functionality.

I notice that you're asking about sending a message regarding broken file editing functionality. As an AI assistant, I cannot directly send messages to support. The best course of action would be for you (the user) to report this issue through the appropriate GitHub support channels, describing the problem with the file editing functionality.

In this case, the issue appears to be that the insert_edit_into_file tool is not properly handling partial file edits and is instead attempting to replace the entire file content. This would be valuable feedback for the development team.

The behavior you're seeing (file corruption when trying to make partial edits)

The fact that the tool is not properly respecting the "...existing code..." markers

Hi @gvdevx, recently the CopilotForXcode-0.36.0 is released of which theinsert_edit_into_file tool is improved for avoiding the issue "corrupts the file".

As to the "Sometimes it says it edited files but hasnt done anything", could you help to share the log file located at ~/Library/Logs/GitHubCopilot/github-copilot-for-xcode.log?

lijie-lee avatar Jun 06 '25 08:06 lijie-lee

Here are my logs, once again it says it made changes but nothing was changed. Can I ask why am I paying for a service that does not work?

All I have to do is use Agent mode and it never makes changes so I do not see why my system fails EVERY SINGLE TIME but it works perfectly for you?

As I have wasted my time being QA for you, remember I am paying for this and you are not paying for me to QA a broken service. What remuneration can you offer me?

Image

[2025-06-11T11:02:47.287Z] [debug] [Service] [60770] TabToAcceptSuggestion: Activated. file: /Users/runner/work/copilot-xcode/copilot-xcode/Core/Sources/KeyBindingManager/TabToAcceptSuggestion.swift line: 14 function: TabToAcceptSuggestion [2025-06-11T11:02:47.351Z] [info] [Service] [60770] Extension Service is not updated, no need to quit. [2025-06-11T11:03:33.683Z] [debug] [Service] [60770] TabToAcceptSuggestion: Deactivate. file: /Users/runner/work/copilot-xcode/copilot-xcode/Core/Sources/KeyBindingManager/TabToAcceptSuggestion.swift line: 14 function: TabToAcceptSuggestion [2025-06-11T11:04:33.902Z] [info] [GitHubCopilot] [60770] window/logMessage: { "type" : 3, "message" : "[fetchChat] Request f942714f-83b6-4750-96aa-2fce7ae84c07 at https:\/\/api.individual.githubcopilot.com\/chat\/completions finished with 200 status after 11220.053084000014ms" } [2025-06-11T11:04:34.106Z] [info] [GitHubCopilot] [60770] window/logMessage: { "type" : 3, "message" : "[streamMessages] message 0 returned. finish reason: [tool_calls]" } [2025-06-11T11:04:52.557Z] [info] [GitHubCopilot] [60770] window/logMessage: { "type" : 3, "message" : "[fetchChat] Request 02b99c45-4d4e-4ca2-b92f-a425ddc20812 at https:\/\/api.individual.githubcopilot.com\/chat\/completions finished with 200 status after 18446.998459000024ms" } [2025-06-11T11:04:52.758Z] [info] [GitHubCopilot] [60770] window/logMessage: { "message" : "[streamMessages] message 0 returned. finish reason: [tool_calls]", "type" : 3 } [2025-06-11T11:04:54.769Z] [info] [GitHubCopilot] [60770] window/logMessage: { "type" : 3, "message" : "[fetchChat] Request 98839e95-5f5c-4366-affd-00a9cca00584 at https:\/\/proxy.individual.githubcopilot.com\/chat\/completions finished with 200 status after 1382.6455829999177ms" } [2025-06-11T11:05:07.588Z] [debug] [Service] [60770] TabToAcceptSuggestion: Activated. file: /Users/runner/work/copilot-xcode/copilot-xcode/Core/Sources/KeyBindingManager/TabToAcceptSuggestion.swift line: 14 function: TabToAcceptSuggestion [2025-06-11T11:05:07.645Z] [info] [Service] [60770] Extension Service is not updated, no need to quit. [2025-06-11T11:05:17.281Z] [info] [GitHubCopilot] [60770] window/logMessage: { "message" : "[streamMessages] message 0 returned. finish reason: [stop]", "type" : 3 } [2025-06-11T11:05:25.533Z] [info] [GitHubCopilot] [60770] window/logMessage: { "type" : 3, "message" : "[fetchChat] Request 3cd5bb7f-65b4-4bad-9567-d55c8f9f2df1 at https:\/\/api.individual.githubcopilot.com\/chat\/completions finished with 200 status after 7906.4666669999715ms" } [2025-06-11T11:05:27.457Z] [info] [GitHubCopilot] [60770] window/logMessage: { "message" : "[streamMessages] message 0 returned. finish reason: [stop]", "type" : 3 } [2025-06-11T11:05:32.551Z] [debug] [Service] [60770] TabToAcceptSuggestion: Deactivate. file: /Users/runner/work/copilot-xcode/copilot-xcode/Core/Sources/KeyBindingManager/TabToAcceptSuggestion.swift line: 14 function: TabToAcceptSuggestion [2025-06-11T11:05:35.593Z] [debug] [Service] [60770] TabToAcceptSuggestion: Activated. file: /Users/runner/work/copilot-xcode/copilot-xcode/Core/Sources/KeyBindingManager/TabToAcceptSuggestion.swift line: 14 function: TabToAcceptSuggestion [2025-06-11T11:05:35.653Z] [info] [Service] [60770] Extension Service is not updated, no need to quit. [2025-06-11T11:05:37.857Z] [debug] [Service] [60770] TabToAcceptSuggestion: Deactivate. file: /Users/runner/work/copilot-xcode/copilot-xcode/Core/Sources/KeyBindingManager/TabToAcceptSuggestion.swift line: 14 function: TabToAcceptSuggestion [2025-06-11T11:06:05.087Z] [info] [GitHubCopilot] [60770] window/logMessage: { "type" : 3, "message" : "[fetchChat] Request c74874b8-be09-42a3-9e7a-6337f413b574 at https:\/\/api.individual.githubcopilot.com\/chat\/completions finished with 200 status after 10441.386666999897ms" } [2025-06-11T11:06:10.434Z] [info] [GitHubCopilot] [60770] window/logMessage: { "message" : "[streamMessages] message 0 returned. finish reason: [tool_calls]", "type" : 3 } [2025-06-11T11:06:11.460Z] [info] [GitHubCopilot] [60770] window/logMessage: { "message" : "[fetchChat] Request 4b3e9a51-818d-44c5-bbf5-6e203d2fba6b at https:\/\/proxy.individual.githubcopilot.com\/chat\/completions finished with 200 status after 1015.6972500000848ms", "type" : 3 } [2025-06-11T11:06:31.862Z] [info] [GitHubCopilot] [60770] window/logMessage: { "type" : 3, "message" : "[streamMessages] message 0 returned. finish reason: [stop]" } [2025-06-11T11:06:31.878Z] [debug] [Service] [60770] TabToAcceptSuggestion: Activated. file: /Users/runner/work/copilot-xcode/copilot-xcode/Core/Sources/KeyBindingManager/TabToAcceptSuggestion.swift line: 14 function: TabToAcceptSuggestion [2025-06-11T11:06:31.947Z] [info] [Service] [60770] Extension Service is not updated, no need to quit. [2025-06-11T11:06:39.410Z] [debug] [Service] [60770] TabToAcceptSuggestion: Deactivate. file: /Users/runner/work/copilot-xcode/copilot-xcode/Core/Sources/KeyBindingManager/TabToAcceptSuggestion.swift line: 14 function: TabToAcceptSuggestion [2025-06-11T11:06:44.648Z] [info] [GitHubCopilot] [60770] window/logMessage: { "type" : 3, "message" : "[fetchChat] Request e86eddf5-05ea-4b8e-b036-2d4e0b6fa063 at https:\/\/api.individual.githubcopilot.com\/chat\/completions finished with 200 status after 12239.228208000073ms" } [2025-06-11T11:06:51.443Z] [info] [GitHubCopilot] [60770] window/logMessage: { "message" : "[streamMessages] message 0 returned. finish reason: [tool_calls]", "type" : 3 } [2025-06-11T11:06:52.528Z] [info] [GitHubCopilot] [60770] window/logMessage: { "type" : 3, "message" : "[fetchChat] Request 778191a0-a3ff-4246-9db1-7b4d243a134c at https:\/\/proxy.individual.githubcopilot.com\/chat\/completions finished with 200 status after 1079.753000000026ms" } [2025-06-11T11:07:03.235Z] [info] [GitHubCopilot] [60770] window/logMessage: { "type" : 3, "message" : "[streamMessages] message 0 returned. finish reason: [stop]" } [2025-06-11T11:07:03.245Z] [debug] [Service] [60770] TabToAcceptSuggestion: Activated. file: /Users/runner/work/copilot-xcode/copilot-xcode/Core/Sources/KeyBindingManager/TabToAcceptSuggestion.swift line: 14 function: TabToAcceptSuggestion [2025-06-11T11:07:03.325Z] [info] [Service] [60770] Extension Service is not updated, no need to quit. [2025-06-11T11:07:07.494Z] [debug] [Service] [60770] TabToAcceptSuggestion: Deactivate. file: /Users/runner/work/copilot-xcode/copilot-xcode/Core/Sources/KeyBindingManager/TabToAcceptSuggestion.swift line: 14 function: TabToAcceptSuggestion [2025-06-11T11:07:13.865Z] [info] [GitHubCopilot] [60770] window/logMessage: { "type" : 3, "message" : "[fetchChat] Request 1afb6159-ab2d-42ee-8ce6-ee2f1e9fdeb0 at https:\/\/api.individual.githubcopilot.com\/chat\/completions finished with 200 status after 9732.135959000094ms" } [2025-06-11T11:07:17.042Z] [info] [GitHubCopilot] [60770] window/logMessage: { "type" : 3, "message" : "[streamMessages] message 0 returned. finish reason: [stop]" } [2025-06-11T11:07:17.397Z] [info] [GitHubCopilot] [60770] didChangeStatus: { "busy" : true, "kind" : "Normal" } [2025-06-11T11:07:17.729Z] [info] [GitHubCopilot] [60770] window/logMessage: { "type" : 3, "message" : "[fetchCompletions] Request 33f14d62-6f25-48ee-a6da-a8012d3755fa at https:\/\/proxy.individual.githubcopilot.com\/v1\/engines\/gpt-4o-copilot\/completions finished with 200 status after 322.8616669999901ms" } [2025-06-11T11:07:17.729Z] [info] [GitHubCopilot] [60770] window/logMessage: { "message" : "[streamChoices] solution 0 returned. finish reason: [stop]", "type" : 3 } [2025-06-11T11:07:17.729Z] [info] [GitHubCopilot] [60770] window/logMessage: { "message" : "[streamChoices] solution 1 returned. finish reason: [stop]", "type" : 3 } [2025-06-11T11:07:17.729Z] [info] [GitHubCopilot] [60770] window/logMessage: { "message" : "[streamChoices] solution 2 returned. finish reason: [stop]", "type" : 3 } [2025-06-11T11:07:17.729Z] [info] [GitHubCopilot] [60770] didChangeStatus: { "kind" : "Normal", "busy" : false } [2025-06-11T11:07:30.947Z] [info] [GitHubCopilot] [60770] window/logMessage: { "message" : "[fetchChat] Request 89f6ec27-976e-40fa-9e20-f22bf35d445b at https:\/\/api.individual.githubcopilot.com\/chat\/completions finished with 200 status after 11143.21633299999ms", "type" : 3 } [2025-06-11T11:07:31.787Z] [debug] [Service] [60770] TabToAcceptSuggestion: Activated. file: /Users/runner/work/copilot-xcode/copilot-xcode/Core/Sources/KeyBindingManager/TabToAcceptSuggestion.swift line: 14 function: TabToAcceptSuggestion [2025-06-11T11:07:31.839Z] [info] [Service] [60770] Extension Service is not updated, no need to quit. [2025-06-11T11:07:38.208Z] [info] [GitHubCopilot] [60770] window/logMessage: { "message" : "[streamMessages] message 0 returned. finish reason: [stop]", "type" : 3 } [2025-06-11T11:07:59.933Z] [debug] [Service] [60770] TabToAcceptSuggestion: Deactivate. file: /Users/runner/work/copilot-xcode/copilot-xcode/Core/Sources/KeyBindingManager/TabToAcceptSuggestion.swift line: 14 function: TabToAcceptSuggestion [2025-06-11T11:08:20.555Z] [info] [GitHubCopilot] [60770] check status response: Response(status: Active, user: Optional("gvdevx")) [2025-06-11T11:08:20.976Z] [info] [Service] [60770] User quota checked successfully: GitHubCopilotQuotaInfo(chat: Status.QuotaSnapshot(percentRemaining: 100.0, unlimited: false, overagePermitted: false), completions: Status.QuotaSnapshot(percentRemaining: 100.0, unlimited: false, overagePermitted: false), premiumInteractions: Status.QuotaSnapshot(percentRemaining: 100.0, unlimited: false, overagePermitted: false), resetDate: "", copilotPlan: "individual") [2025-06-11T11:08:26.538Z] [info] [UI] [60770] GitHub Copilot for Xcode activated: true [2025-06-11T11:08:26.674Z] [info] [Service] [60770] Extension Service is not updated, no need to quit. [2025-06-11T11:08:27.236Z] [info] [UI] [60770] GitHub Copilot for Xcode settings script error: { NSAppleScriptErrorAppName = "System Events"; NSAppleScriptErrorBriefMessage = "Not authorized to send Apple events to System Events."; NSAppleScriptErrorMessage = "Not authorized to send Apple events to System Events."; NSAppleScriptErrorNumber = "-1743"; NSAppleScriptErrorRange = "NSRange: {92, 43}"; } [2025-06-11T11:08:27.236Z] [info] [UI] [60770] GitHub Copilot for Xcode settings notification sent after activation

gvdevx avatar Jun 11 '25 11:06 gvdevx

Hi @gvdevx, recently the CopilotForXcode-0.36.0 is released of which theinsert_edit_into_file tool is improved for avoiding the issue "corrupts the file".

It improves??? So you expect it doesn't fix the issue. Why are you providing a paid service for something that does not work? Which you know does not work. I would assume this stays internal and release to the paid public when it actually works. Don't you think?

Is it just the mad rush to publish anything whatsoever to the general public in the race to try and prove you have something at all, even if it does not work?

gvdevx avatar Jun 11 '25 11:06 gvdevx

Hi @gvdevx, @gabrieledintino. Thanks for reaching out and sorry for any inconvenience. Could you help to share the log file located at ~/Library/Logs/GitHubCopilot/github-copilot-for-xcode.log? It's help to figure out what happened.

I'll try to provide them ASAP, sadly I have not been at my computer lately

gabrieledintino avatar Jun 11 '25 12:06 gabrieledintino

Hi @lijie-lee, Today I tried some changes and it always applied them, so it seems like the improvements done in the latest version are working. I'll let you know if it happens again. Thank you!

gabrieledintino avatar Jun 12 '25 23:06 gabrieledintino

Hi @gvdevx, @gabrieledintino. Sorry for the late reply.

As to the

Corrupt files being generated

does this issue still occur on your side? From the log provide by @gvdevx, I do not caught related logs.

As to the

Sometimes it says it edited files but hasnt done anything.

We've being working on this issue to figure out the root cause.

  • One thing is to show up the editing result correctly.
  • Another is to make the editing tool robust for applying properly.

The fix will be released within the next version of GitHub Copilot for Xcode.

lijie-lee avatar Jun 27 '25 06:06 lijie-lee

I've been running 0.37 and yes it appears the issue is fixed. I have not noticed any corruption and edits appear to always occur now. Thank you! 👍

gvdevx avatar Jun 27 '25 06:06 gvdevx

I've been running 0.37 and yes it appears the issue is fixed. I have not noticed any corruption and edits appear to always occur now. Thank you! 👍

Glad to hear that. Edit tool will be more robust the next version.

BR.

lijie-lee avatar Jun 27 '25 06:06 lijie-lee

I've been running 0.37 and yes it appears the issue is fixed. I have not noticed any corruption and edits appear to always occur now. Thank you! 👍

I have Xcode (26.1.1) and copilot (0.45.0) and it creates constantly corrupted files or it simply changes nothing. So the issue is not fixed. When I tell to copilot it did nothing it will delete and re-create the file. Such a poor experience still…

pavlo-riabchuk avatar Nov 26 '25 13:11 pavlo-riabchuk