Closed yuhuajun100 closed 4 months ago
Please try updating the app to the latest version.
If the issue persists, please let me know:
Codeium for Xcode 0.31.3 is currently the newest version available. Xcode app 15.4 is currently the newest version available. Watch the video below
https://github.com/intitni/CopilotForXcode/assets/15060885/fd067164-ac96-411d-a036-c8c1f9bbf259
Please simply use Copilot for Xcode. Codeium for Xcode is just a subset of the app.
Moving text cursor will not trigger realtime suggestion and will cancel all previous requests, please don't move the text cursor by clicking or arrow keys in the video.
I have the same problem only use Copilot for Xcode. version: 0.33.0. circular widget animates when I stop typing widgets aslo updates their position when the Xcode window moves.
@nenseso If you saw the animation that means the app was working. Maybe there was something wrong with the GitHub Copilot language server.
Please turn on verbose log. Open Console.app and click start streaming, set the filter to category:GitHubCopilot
. Try to trigger real-time suggestion and see what the logs are. If you don't see any log, restart the service app.
@nenseso If you saw the animation that means the app was working. Maybe there was something wrong with the GitHub Copilot language server.
Please turn on verbose log. Open Console.app and click start streaming, set the filter to
category:GitHubCopilot
. Try to trigger real-time suggestion and see what the logs are. If you don't see any log, restart the service app.
Thanks for your response! I wasn’t sure what happened, but today when I upgraded my version to 0.33.1 beta, everything started working fine. Here's what I did:
Copilot for Xcode.app
againI started experiencing the same issue just a few days ago. It used to work perfectly say for 2 ~ 3 weeks ago. In the Console.app, I found the following message when the suggestion stops working:
Try getting suggestions again: Language server error: Server error: -32603 non-abort error on ghost text request nil
Restarting Xcode and Copilot for Xcode together will bring back the suggestion prompts, but after a few minutes, the suggestions will stop again, i.e., no suggestion prompt during coding. I tried to re-install Copilot for Xcode, I even tried it with Xcode 15.4, 15.3, the issue persists.
@arigatou1985 This error happens when the the network request failed inside the language server. It's hard to tell what was going on.
Please try setting the console filter to
any:CopilotForXcodeExtensionService
category:ProtocolTransport
Hopefully we can get more information from it.
@arigatou1985 By the way, are you using self-signed certificates? I found that it can happen when I was using MITM on the GitHub Copilot domain names. It works at the beginning but stops working later.
@arigatou1985 This error happens when the the network request failed inside the language server. It's hard to tell what was going on.
Please try setting the console filter to
any:CopilotForXcodeExtensionService category:ProtocolTransport
Hopefully we can get more information from it.
I tried to filter console logs using the same exact two filters above, but didn't get anything at all when the suggestion prompt stops working. Only console message relevant are from single filter: process CopilotForXcodeExtensionService, regarding server error as mentioned above.
I'm sure my computer doesn't have self-signed certificates doing MITM related work when I experience the issue. GitHub copilot works perfectly fine continuously in my Visual Studio Code.
From what I experimented with so far, when I restart Xcode, and copilot for Xcode, after about 4 minutes, suggestions prompt will stop working.
@arigatou1985 Oh you have to turn on verbose log in the GitHub Copilot settings then restart the app.
@arigatou1985 Oh you have to turn on verbose log in the GitHub Copilot settings then restart the app.
Yes, it was "checked" in the Service -> GitHub Copilot -> Advanced -> Verbose Log.
@arigatou1985 It's weird. The only possible situation that I can think of is the language server has crashed. Please give this version a try: https://github.com/intitni/CopilotForXcode/releases/download/0.1.0/Copilot.for.Xcode.app.debug.20240530.1824.zip
This version fixes a few bugs about the life cycle of the language server processes.
If this version fixes it for you, could you please let me know if you were opening any files that seems suspicious to crash the language server? For example, large file, non-text file, file contains weird symbols?
@arigatou1985 It's weird. The only possible situation that I can think of is the language server has crashed. Please give this version a try: https://github.com/intitni/CopilotForXcode/releases/download/0.1.0/Copilot.for.Xcode.app.debug.20240530.1824.zip
This version fixes a few bugs about the life cycle of the language server processes.
If this version fixes it for you, could you please let me know if you were opening any files that seems suspicious to crash the language server? For example, large file, non-text file, file contains weird symbols?
I trie this build, it doesn't help with the issue unfortunately. I tried on a small iOS project with less than 50 source files, approximately 1000 lines of code in total. No big binary files, or strange symbols in any source code.
I extract a console log. Hope you can find something useful. no_suggestions_log.txt
@arigatou1985 sadly there is no useful information. It’s really weird that you can't see and logs from the ProtocolTransport category. Can you constantly get the errors you showed me after it stops working?
Would you mind trying the following:
I will submit a build later to always post the logs no matter what the state of the toggle is later.
@arigatou1985 sadly there is no useful information. It’s really weird that you can't see and logs from the ProtocolTransport category. Can you constantly get the errors you showed me after it stops working?
Would you mind trying the following:
- Turn the verbose log toggle off and back on.
- Kill the node processes created by CopilotForXcodeExtensionService in Activity Monitor and try to get suggestions again.
I get those logs every time when suggestions stop working. But nothing from ProtocolTransport category. I tried to turn verbose log off and on. Restarted the copilot for xcode a couple of times. Also tried to kill the node processes created by CopilotForXcodeExtensionService. Unfortunately none of them helped.
@arigatou1985 https://github.com/intitni/CopilotForXcode/releases/download/0.1.0/Copilot.for.Xcode.app.debug.20240530.2023.zip
If you still can't see the logs, I honestly don't know what else we can do. You can still try:
@arigatou1985 https://github.com/intitni/CopilotForXcode/releases/download/0.1.0/Copilot.for.Xcode.app.debug.20240530.2023.zip
If you still can't see the logs, I honestly don't know what else we can do. You can still try:
- Deleting the app completely including ~/Library/Application Support/com.intii.CopilotForXcode and reinstall.
- Change "run node with" to other values.
- MitM the requests to copilot-proxy.githubusercontent.com to see what is going on. You may need to turn on "Load certificates in keychain".
- Run the app in Xcode. You need to run both the ExtensionService target and the CommunicationBridge target. You can set a break point to /Tool/Sources/GitHubCopilotService/LanguageServer/GitHubCopilotService.swift:408. Hopefully you can see the logs in the debug area.
I tried to delete the directory for complete uninstallation. Didn't help. I used a web proxy app to observe the communication between my computer to github, didn't find anything related to copilot-proxy.githubusercontent.com, but only copilot-telemetry.githubusercontent.com. I will try to set up and run the project in xcode. It might take more time, I'll come back if I find anything interesting. BTW, on another intel iMac, with latest MacOS and Xcode, and copilot for xcode, all works perfectly without any issue. The problem only occurs on my M3 chip macbook pro.
@arigatou1985 Thank you! Let me know if you need any help.
Thanks to your previous hints. I've experimented more with Node settings, and discovered that running node with /usr/bin/env
always lead to no suggestions prompt issue few minutes after starting copilot and Xcode, while /bin/bash/ -i -l
works reliably. I switched between these options many times and tried very thoroughly and can confirm the problem roots from the node selection setting.
Im having the same problem as described by OP. None of the suggestions in this thread helps. Icon shows for a seconds and disappears without any suggestion of code snippet. Really annoying issue.
My console logs indicates that file URI cannot be accessed...
Try getting suggestions again: Language server error: Server error: -32602 Document for URI could not be found: file:///Users/username/filename.swift, URIs of the known document are: nil
@pawel-movelab please provide your settings in screenshots, logs, node version so that I can help you.
You can get the logs by turning on verbose log in the GitHub Copilot settings, restart the service app if, open Console.app, click start streaming, and set the filter to one of the following
any:CopilotForXcodeExtensionService
category:ProtocolTransport
Or
any:CopilotForXcodeExtensionService
category:GitHubCopilot
You mentioned that the widget appears and disappears, did it crash? Or you have turned on “Hide circular widget”?
You mentioned that the widget appears and disappears, did it crash? Or you have turned on “Hide circular widget”?
Yes, I had that option checked. I unchecked it but no help.
I tried to get these logs but not getting any.
➜ ~ node --version v22.2.0
Launching service app keeps on showing on the app screen:
Thanks to your previous hints. I've experimented more with Node settings, and discovered that running node with
/usr/bin/env
always lead to no suggestions prompt issue few minutes after starting copilot and Xcode, while/bin/bash/ -i -l
works reliably. I switched between these options many times and tried very thoroughly and can confirm the problem roots from the node selection setting.
Glad it worked. The key difference between these options is that different configuration files will be used.
I am not sure about /usr/bin/env
, it seems to be using the shell in the current environment, either bash or your default shell, but not in the login interactive mode.
/bin/bash/ -i -l
will use your bashrc and the last one will use the one for your default shell.
Maybe there are some settings generating conflicts to the node process or the language server.
@pawel-movelab If you don't see any log, I suspect that you are having a similar issue to that of arigatou1985. The language server is not launched properly.
Do you mind setting up the debug server of the app by running
defaults write ~/Library/Group\ Containers/5YKZ4Y3DAW.group.com.intii.CopilotForXcode/Library/Preferences/5YKZ4Y3DAW.group.com.intii.CopilotForXcode.plist TestUtilityBaseURL "https://copilotforxcode-testutility.intii.com"
Once you trigger a suggestion, I will be able to see the logs of it. I can read the prompt, too so please make sure don't do it on your real code.
You can unset it later with
defaults delete ~/Library/Group\ Containers/5YKZ4Y3DAW.group.com.intii.CopilotForXcode/Library/Preferences/5YKZ4Y3DAW.group.com.intii.CopilotForXcode.plist TestUtilityBaseURL
If I can't see the logs either, it's probably the issue I just mentioned. Please try different "Run node with" options, and take a look into your ~/bashrc
or ~/zshrc
or other similar files.
@pawel-movelab If you don't see any log, I suspect that you are having a similar issue to that of arigatou1985. The language server is not launched properly.
Do you mind setting up the debug server of the app by running
defaults write ~/Library/Group\ Containers/5YKZ4Y3DAW.group.com.intii.CopilotForXcode/Library/Preferences/5YKZ4Y3DAW.group.com.intii.CopilotForXcode.plist TestUtilityBaseURL "https://copilotforxcode-testutility.intii.com"
Once you trigger a suggestion, I will be able to see the logs of it. I can read the prompt, too so please make sure don't do it on your real code.
You can unset it later with
defaults delete ~/Library/Group\ Containers/5YKZ4Y3DAW.group.com.intii.CopilotForXcode/Library/Preferences/5YKZ4Y3DAW.group.com.intii.CopilotForXcode.plist TestUtilityBaseURL
If I can't see the logs either, it's probably the issue I just mentioned. Please try different "Run node with" options, and take a look into your
~/bashrc
or~/zshrc
or other similar files.
I just made few attempts to trigger it in empty repo I created. Can you see it?
@pawel-movelab I saw the error, it looks like the language server doesn't recognize the file.
Please turn on enable Xcode Inspector debug menu in the advanced settings and show me the content in the menu. Also let me know if it works in a git enabled project.
@pawel-movelab Sorry I have no idea. Everything looks correct to me. If the language server can't find the file, it's very likely that the open file notification sent to the language server is failed or not fired. If it failed, you should see the logs, with or without verbose log on.
I still don't understand why you can't see the logs. Do you mind trying the Console.app again but this time set the filter to only category:GitHubCopilot
, open a new tab in Xcode, make some changes and see if there is any open or change requests?
If you still can't see them, all I can suggest is to build and run the app in Xcode. You need to run both the ExtensionService target and the CommunicationBridge target. You may want to look at /Tool/Sources/GitHubCopilotService/GitHubCopilotExtension.swift:39
for the open file request and /Tool/Sources/GitHubCopilotService/LanguageServer/GitHubCopilotService.swift:362
for the get suggestion request.
I am getting hits in Console app with the filter you suggested:
Try getting suggestions again: Language server error: Server error: -32602 Document for URI could not be found: file:///user/file.swift, URIs of the known document are: nil
@pawel-movelab I can get the same error if I disable the files and folders permission, do you want to check that?
System settings > Privacy and Security > Files and Folders
@pawel-movelab I can get the same error if I disable the files and folders permission, do you want to check that?
System settings > Privacy and Security > Files and Folders
After enabling access to all locations and restarting both Xcode and Copilot for Xcode apps it started to work! Thank you! 🥳
Btw I just noticed that tab aceepting suggestions in playground won't work.
@pawel-movelab Only in playground?
Yes, only there. In Xcode works normally
@pawel-movelab Can you accept the suggestions in other ways, for example the buttons?
Yes, the button accepting works
@pawel-movelab That's super weird. Does it work if you create a swift file in the Sources folder in the playground and try them out? Can you upload the playground file and let me know which folder/path it is in?
@pawel-movelab Oh yeah, I forgot there are a lot of logs about tab to accept were added to the latest build. Please set the Console.app filter to category:Debug, let me know what you observed.
@intitni I tested again and after our yesterday fix it works as well in Playgrounds! Thanks a lot for your fast help and replies!
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
Before Reporting
What happened?
The software enables real-time Suggestion. As the code was being written, a feature was triggered, but no advice was given. If this feature is triggered manually, any recommendations are still given。
https://github.com/intitni/CopilotForXcode/assets/15060885/91e3ca3a-92a4-4498-bcc8-ac3eea3b28f9
How to reproduce the bug.
It just happened!
Relevant log output
No response
macOS version
14.5
Xcode version
xcode 15.4
Copilot for Xcode version
0.31.3