eclipse-che / che

Kubernetes based Cloud Development Environments for Enterprise Teams
http://eclipse.org/che
Eclipse Public License 2.0
6.99k stars 1.19k forks source link

Cannot authorize to github copilot #23234

Open huonguyenlt opened 2 weeks ago

huonguyenlt commented 2 weeks ago

Describe the bug

I got an issue when trying to use github copilot extension. It says that my user is not authorized but I actually has a subscription on github copilot business. It is working fine in my local laptop.

Che version

7.90

Steps to reproduce

  1. Create github personal access token with all permissions
  2. Add the personal access token to eclipse-che
  3. Install github copilot extension by installing from vsix, github copilot version 1.243.0 or 1.173.0
  4. Sign in to github successfully but the user is not authorized.

Expected behavior

github copilot extension should working properly

Runtime

OpenShift

Screenshots

image

Installation method

other (please specify in additional context)

Environment

Dev Sandbox (workspaces.openshift.com)

Eclipse Che Logs

Error log after sign in to github


2024-11-06 07:18:27.246 [info] [certificates] Removed 2 expired certificates
2024-11-06 07:18:27.512 [info] [auth] Invalid copilot token: missing token: 404 
2024-11-06 07:18:27.515 [error] [auth] auth: CopilotAuthError: User not authorized
    at authShowWarnings (/checode/remote/extensions/github.copilot-1.243.0/extension/src/auth.ts:144:15)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at tae.getCopilotToken (/checode/remote/extensions/github.copilot-1.243.0/extension/src/auth.ts:174:33)
    at attemptAuthentication (/checode/remote/extensions/github.copilot-1.243.0/extension/src/auth.ts:58:9) {
  cause: undefined
}
2024-11-06 07:18:27.515 [error] [auth] User not authorized
2024-11-06 07:20:15.324 [info] [auth] Invalid copilot token: missing token: 404 
2024-11-06 07:20:15.329 [info] [auth] Invalid copilot token: missing token: 404 
2024-11-06 07:20:15.331 [info] [auth] Invalid copilot token: missing token: 404 

Error log when trying to enable copilot

2024-11-06 07:20:58.401 [error] Error: command 'github.copilot.generate' not found
    at T8e.n (https://devspaces.apps.sandbox-m4.g2pi.p1.openshiftapps.com/nlthuong/che-docs-fwe5/3100/oss-dev/static/out/vs/code/browser/workbench/workbench.js:1296:1341)
    at T8e.executeCommand (https://devspaces.apps.sandbox-m4.g2pi.p1.openshiftapps.com/nlthuong/che-docs-fwe5/3100/oss-dev/static/out/vs/code/browser/workbench/workbench.js:1296:1273)
2024-11-06 07:30:48.428 [error] Error: command 'github.copilot.generate' not found
    at T8e.n (https://devspaces.apps.sandbox-m4.g2pi.p1.openshiftapps.com/nlthuong/che-docs-fwe5/3100/oss-dev/static/out/vs/code/browser/workbench/workbench.js:1296:1341)
    at T8e.executeCommand (https://devspaces.apps.sandbox-m4.g2pi.p1.openshiftapps.com/nlthuong/che-docs-fwe5/3100/oss-dev/static/out/vs/code/browser/workbench/workbench.js:1296:1273)


### Additional context

_No response_
tolusha commented 2 weeks ago

cc @vitaliy-guliy

huonguyenlt commented 2 weeks ago

When I use github copilot in my laptop, when asking for sign in github, it opens github page to login. However, in che, I have to use github personal access token. Not sure if that causes the issue. Is there any way to let eclispe che open github page to login instead of using personal access token?

ibuziuk commented 2 weeks ago

@huonguyenlt hello, copilot extension is not officially supported you can take a look at Continue instead which should work OOTB - https://open-vsx.org/extension/Continue/continue Related article - https://developers.redhat.com/learning/learn:openshift-ai:integrate-private-ai-coding-assistant-your-cde-using-ollama-continue-openshift-dev-spaces/resource/resources:access-openshift-dev-spaces-and-create-your-cde