CopilotForXcode icon indicating copy to clipboard operation
CopilotForXcode copied to clipboard

Copilot didn't read the file correctly after it has already successfully written into.

Open owenzhao opened this issue 2 months ago • 2 comments

Describe the bug

When I ask copilot to revise a property list, it use terminal doing it. The file was revised successfully as I could see it in Xcode. But Copilot kept on thinking the written was failed and kept on to change many way to write again.

Versions

  • Copilot for Xcode: 0.44.147
  • Xcode: 26.0.1
  • macOS: 26.0.1

Steps to reproduce 1. 2.

Screenshots

Image Image Image

Logs

Additional context

owenzhao avatar Oct 23 '25 22:10 owenzhao

Environment

macOS 15.6.1 (24G90)

Xcode 26.0.1 (17A400)

Copilot for Xcode 0.44.147 (also reproduced on 0.44.0)

Description Copilot can read all .swift and .plist files but cannot edit any file originally created by Xcode. Newly created files (via Copilot or manually) are editable without issue. The same project works perfectly with Copilot in VS Code, even while Xcode is open.

Error

Failed to map code for uri file:///Users/shariq/Development/fractionalcal/fractionalcal/ContentView.swift with result type unknown

Repro steps

Create a new Swift project in Xcode 26.0.1.

Ask Copilot to modify ContentView.swift or Info.plist.

Copilot responds with the error above.

Delete the file, recreate it manually, and Copilot can edit again.

Additional notes

File permissions are normal (-rw-r--r--), no uchg flags.

Git “assume-unchanged” cleared, no effect.

System permissions for Copilot for Xcode (Accessibility, Automation, Full Disk Access) all enabled.

Verbose logs show FetchError: getaddrinfo ENOTFOUND copilot-telemetry.githubusercontent.com followed by the “failed to map code for uri” line.

Looks like a regression with Xcode 26 + Copilot 0.44.x file mapping.

shariqkhwaja avatar Oct 24 '25 00:10 shariqkhwaja

Thank you for your reply. But it is not true.

As I described above, Copilot has already successfully written the file every time, as I can see it in Xcode. But it kept on doing again and again because it didn't read back the written file correctly.

It was a long time issue that copilot tended to read from its cache instead of the file on the disk. Every time when copilot was opened, it read all files once, then it used its cache all the time.

owenzhao avatar Oct 24 '25 01:10 owenzhao