-
-
Notifications
You must be signed in to change notification settings - Fork 377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Language Server Installed and Running but does not work in a sandbox environment - Worked until 2 versions ago. #553
Comments
What do you mean by sandbox environment? If you mean the App Sandbox capability, the service app doesn't work with it enabled because it has to run other processes, for example Node, to perform its jobs. App Sandbox will prevent this. |
@intitni i've node and other necessary services. Rolling back to a couple of versions ago works, the newer versions don't. Thanks for looking into. |
@varyP But what do you mean by sandbox environment? |
This error throws only when the app can't find or access the language server js file. Please make sure it has the right permission to access the files in the folder inside Application Support, If you are using my releases, it should be "~/Library/Application Support/com.intii.CopilotForXcode/GitHub Copilot/executable/copilot/dist/language-server.js" |
@intitni - got a sandboxed environment running at a work Macbook. I don't see the language-server.js here. Any other logs I can check? |
The older versions of the language server uses agent.js. But what is a sandboxed environment? How to enable the sandboxed environment? |
If it works before 0.33.0, the app was launched by launch agent as a mach service, and macOS may accidentally grant extra permissions to the app. But this method causes severe performance issues to the app so we will not go back. |
But it's still weird, because you can access language server from the host app. |
What happens if you quit and open the CopilotForXcodeExtensionService.app manually? If Copilot for Xcode.app has the permissions, the cause may be the way we launch the service app. |
I can't test it for you since it's an internal tool. But I can offer something that you can experiment with: In the past the service app is launched by launch agent, now it's launched by the CoomunicationBridge target, which is launched by the launch agent. Could it be that the old method is launching the service app outside of the sandbox? If the service app is now launched inside the sandbox, two things may have changed:
FileManager.default.urls(
for: .applicationSupportDirectory,
in: .userDomainMask
)
|
Or you can simply try installing the language server again in the sandboxed host app. It's fine that it can't register the launch agent. |
This has been happening for Me If project has build errors. So seems like if your project has some file references but File doesn't exists. Extension throws the error. So resolve all the file references and it starts working fine. I my self would fix it. and will raise a PR. |
Before Reporting
What happened?
Node path & installation paths are correct - verified.
From Console-
Language server is not installed. Please install it in the host app.
Try getting suggestions again: Language server error: Server error: -32602 D
How to reproduce the bug.
It just happened!
Relevant log output
No response
macOS version
13.6.1
Xcode version
15.2
Copilot for Xcode version
0.33.4
The text was updated successfully, but these errors were encountered: