Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Github Copilot Support? #4363

Answered by Sunkist18
TreeHD asked this question in Q&A
Oct 17, 2021 · 15 comments · 71 replies
Discussion options

Hello

I'm using code-server

as here pull#3544 shows that Copilot isn't support at this moment

Is there any possible to make it usable?

You must be logged in to vote

Hi guys, I'm curious if you're still experiencing the issue because I solved it.
If you still have the issue, please refer to the following article.
Since I'm Korean, it's posted in Korean, so I'll attach the translated page as well.

Original Page

Translated Page (Eng)

Replies: 15 comments 71 replies

Comment options

You can try SSHing into VSCode with this guide and then try to use Copilot.

Let me know if that works!

You must be logged in to vote
0 replies
Comment options

I'm having an issue using code-server with Copilot, in the output tab there is an error log:

[INFO] [auth] [2021年10月25日T05:47:58.412Z] Invalid copilot token: missing token
You must be logged in to vote
6 replies
Comment options

You will need to sign up for the beta of OpenAI.

Comment options

I've signed up before, and I'm able to use Copilot on my vscode of macOS

Comment options

Did this work?

Comment options

No, Copilot prompted me to login to Github and I did it, but it still complained missing token. While I'm able to use Copilot on macOS just fine.

Comment options

You will need to sign up for the beta of OpenAI.

You shouldn't need that for Copilot

Comment options

Guys, I have a slight doubt. Yesterday, I found a mail from GitHub, that they opted me into the Copilot Technical Preview. How can I get this on code-server? Should I get the VSIX file from the Visual Studio Marketplace, upload it onto my instance and install it via the CLI?

That kinda seems right on Gitpod, since I needed to do the same to install the Aura theme. So, does it apply the same to code-server?

You must be logged in to vote
2 replies
Comment options

I download the vsix first and use CLI to install it, see https://github.com/soulmachine/docker-images/blob/master/code-server/Dockerfile.base#L92

Comment options

Same pinch dude but can I log in to Copilot?

Comment options

I might try to see why this isn't working by editing/inspecting the code of Copilot and see if I can get it going

You must be logged in to vote
18 replies
Comment options

We do have it but as a result of a bug if you do not include the flag the proposed API will be enabled for all extensions by default.

Comment options

@Heath123 try:

 sed -i 's/"GitHub.remotehub",/"GitHub.remotehub",\n "GitHub.copilot",/g' /usr/lib/code-server/vendor/modules/code-oss-dev/product.json

And then use the token you extracted from regular VSCode by debugging the extension.

Comment options

@ZauberNerd How can I use the token from vscode in code-server?

Comment options

@ankarhem sorry, I can't give you detailed instructions. You'll have to debug that yourself. You could try the same as @Heath123 by editing the extension or you could probably use a MITM proxy or maybe try to extract it from some storage location or whatever.

Comment options

Yep, if you deminify the code you can find where it gets the token, I can help with that if you want. Sorry, I haven't really managed to try it properly yet

Comment options

Hi guys, I'm curious if you're still experiencing the issue because I solved it.
If you still have the issue, please refer to the following article.
Since I'm Korean, it's posted in Korean, so I'll attach the translated page as well.

Original Page

Translated Page (Eng)

You must be logged in to vote
6 replies
Comment options

I followed the steps, but it does not work. I enter the auth url and nothing happens.

Comment options

It worked for me, thanks for sharing!

Comment options

I followed the steps, but it does not work. I enter the auth url and nothing happens.

That's probably because you didn't agree to the Copilot terms and conditions.
Pop-up sometimes doesn't come up. If you refresh it, it might come up. In my case, that works.

Comment options

The extension itself won't show up at the search.
Have any of you guys been through this?

Comment options

The extension itself won't show up at the search. Have any of you guys been through this?

Because the copilot isn't available on third party extension market.

Answer selected by TreeHD
Comment options

https://vscode-auth.github.com/authorize/?callbackUri=vscode://vscode.github-authentication/did-authenticate&scope=repo&state={token}&responseType=code
You must be logged in to vote
0 replies
Comment options

@Prajwal-Koirala url worked for me;

  1. download latest copilot vsix
  2. in code server > Install from VSIX and install copilot
  3. when code server asks you to log in; follow that to your browser and pull out the state uuid token from the url
  4. use @Prajwal-Koirala url and put your state token in there https://vscode-auth.github.com/authorize/?callbackUri=vscode://vscode.github-authentication/did-authenticate&scope=repo&state={token}&responseType=code and paste that into your browser
  5. follow through to authenticate and you will eventually get to the page where it will display your URI eg. vscode:..... copy that
  6. in code server you'll see something like "Signing into github..." status message on the bottom leftish which you can click and you paste in the URI you just got
You must be logged in to vote
7 replies
Comment options

We'd probably need to make sure we're not breaking any legal agreements. Something tells me that Copilot can only be used in Microsoft products. However, if that's not true, we could add it to the docs.

Comment options

they do have jetbrains/neovim plugins at the moment. All of their current plugins are "licensed" with;

This technical preview is a Beta Preview under the GitHub Terms of Service.

I would assume once live this would completely change as well.

Comment options

So, are you meaning we make a plugin for Copilot? I don't think that'd change anything, since we need to install Copilot, Copilot doesn't need to do anything. But that might seem like violating Microsoft's ToS, hence we are thinking.

Comment options

Ahh sorry no I don't mean we make a plugin. I'm just linking what they've already made themselves and the ToS they've got. I'm not familar with Microsoft/Github's ToS and how this project and plugins relate to it.

Comment options

We'd probably need to make sure we're not breaking any legal agreements. Something tells me that Copilot can only be used in Microsoft products. However, if that's not true, we could add it to the docs.

Well, it's probably against the Marketplace ToS at least

Comment options

I am sorry for reopening the discussion, but the solution no longer works.

before, we can extract the state, and put it into the @Prajwal-Koirala url. Now, it doesn't work. The auth url also changed into something like "https://github.com/login?client_id=ad768f28053cf9566b63&return_to=%2Flogin%2Foauth%2Fauthorize%3Fclient_id%3Dad768f28053cf9566b63%26response_type%3Dcode%26scope%3Dread%253Auser%26state%3D%257B%2522callback%2522%253A%2522https%253A%252F%252Fsomeurl.com%252Fcallback%253Fvscode-requestId%253D80f6c042-7bd2-4aa0-8702-55351a3b14c0%255Cu0026vscode-scheme%253Dcode-oss%255Cu0026vscode-authority%253Dvscode.github-authentication%255Cu0026vscode-path%253D%25252Fdid-authenticate%2522%252C%2522state%2522%253A%252283862aae-c0b7-4e92-9631-fcc8b80d8af0%2522%257D"

I tried to decode the url to get the state, but the code-server refuse to auth and throwing bad request.

When doing auth normaly, while it works on some extension like gitlens, it doesn't on github copilot. It says token not found [404] and it asked me to joint he waitlist.

You must be logged in to vote
4 replies
Comment options

Anything in the logs?

Comment options

if you mean the output

[INFO] [auth] [2022年03月13日T01:52:07.665Z] Invalid copilot token: missing token: 404 
[ERROR] [default] [2022年03月13日T01:52:07.668Z] GitHub Copilot could not connect to server. Extension activation failed: "User not authorized"

I am authorized, I can use it fine on desktop vs code, and could use it before using the web using @Prajwal-Koirala url. I also tried using personal token method (by using localhost) instead of url, it's the same problem.

Comment options

If I tried to extract the state from the url and put it @Prajwal-Koirala URL, the output shows :

[ERROR] [default] [2022年03月13日T01:58:42.075Z] GitHub Copilot could not connect to server. Extension activation failed: "Bad Request"
Comment options

I really don't know :(
I will try repros on a Raspberry Pi after exams tho...

Comment options

GitHub.copilot-1.7.5250.zip

Update 03/12/2022

It still works.

You must be logged in to vote
16 replies
Comment options

Does this URL work? While having your instance open ofc

https://vscode-auth.github.com/authorize/?callbackUri=vscode://vscode.github-authentication/did-authenticate&scope=repo&state=af75d661-fd20-46a9-843b-b081aaa26d84&responseType=code

Tried this before, this is what i refer to

I tried to decode the url to get the state, but the code-server refuse to auth and throwing bad request.

Wait, maybe all you have to do is add the authorize part on your URL! Try this, if it works, then solved!

How do you get the requestID ?, by the time I have the requestID, auth is already successful

Comment options

Hmm... Maybe if you slow your webpage loading time? I don't know, need to find more insight on this.

Comment options

The newest code-server 4.2.0 using a new method of auth and works fine now. The auth breaks on 4.1.0.. Version 4.0.2 and 4.2.0 works fine.

Comment options

Okay, great! Guess I'll just update my Pi and enjoy!

Comment options

Welp i tried it but i get this error from GitHub Copilot: ERROR] [default] [2023年04月25日T16:45:19.666Z] GitHub Copilot could not connect to server. Extension activation failed: "Cancelled"

Comment options

My advice: Keep your hands off GitHub Copilot.

https://drewdevault.com/2022/06/23/Copilot-GPL-washing.html

You must be logged in to vote
1 reply
Comment options

Should a human programmer take the same approach, studying free software and applying those lessons, but not the code itself, to original projects, I would agree that their applied knowledge is not creating derivative works. However, that is not how machine learning works. Machine learning is essentially a glorified pattern recognition and reproduction engine, and does not represent a genuine generalization of the learning process. It is perhaps capable of a limited amount of originality, but is also capable of degrading to the simple case of copy and paste.

I disagree with the statement that machine learning isn't really learning, I feel like people clinging onto that idea just want to think that humans are special and computers will never surpass them. Really, aren't humans just glorified pattern recognition and reproduction engines? I do think it would be better if they only used permissively licensed code just to be safe, but personally I'm not going to stop using it based on the license concerns

Comment options

I used all the methods above, but I can't log in to GitHub from the copilot

I installed copilot from VSIX

I'm using the latest version of code-server
code-server: v4.8.3
Code: 1.72.1

Does anyone know how to log in to GitHub to use copilot?

You must be logged in to vote
0 replies
Comment options

Code-Server v4.9.1
Copilot version 1.65.7705 visx from marketplace

Uploaded visx to code server files pane via drag and drop. Right click install visx extension. Click on popular from copilot to log in / authorise github, follow prompts for 2fa, all signed in successfully without any issues. No copying or pasting of tokens or URLs or anything.

You must be logged in to vote
2 replies
Comment options

I can confirm this method works.
Copilot does not appear in the marketplace but does install and the authentication process works as well.

Comment options

This should be the accepted answer! Easy, and the old way doesn't seem to work anymore.

Comment options

To anyone who still can't login copilot with github accounts,

You need to remove any extension which related with github,
Its better to delete the extensions folder and restart code server then install what extension you need again,

It will fix the issue

I had this issue and i could fix it with deleting all extensions

Looks like an old extension handles the github login thats why github keep saying update your vscode

after removing all my extensions its working fine

You must be logged in to vote
0 replies
Comment options

August 2023 update - no more tricks needed

Step-by-step process here: #5063 (comment)

(tl;dr: download the extension vsix file from here: https://marketplace.visualstudio.com/items?itemName=GitHub.copilot then drag and drop it into code-server filetree, then right click on it and install, then you'll get a notification to sign into github, follow the prompts and you're done)

You must be logged in to vote
9 replies
Comment options

I'm still on version v0.9.2023101002, that worked just fine

Comment options

Could you share your v0.9.2023101002 vsix?

Both https://marketplace.visualstudio.com/items?itemName=GitHub.copilot-chat and Google Search result do not show Copilot Chat v0.9.2023101002 vsix.

Thanks in advance.

Comment options

it works for me with latest code-server + copilot extensions as well

Comment options

v0.9.2023101002 was a buggy on my side and the fact that I don't have tha latest version makes me realy sad.

I did some research and I finnaly build my own code-server image with an official installation on ubuntu.
Here is my repo if you want : https://github.com/nerasse/my-code-server
gl guys

Comment options

code-server --install-extension GitHub.copilot

Comment options

Hi everyone,
I tried the above approach, when I try to sign in into the GitHub copilot. I get this pop up of You have not yet finished authorizing this extension to use GitHub. Would you like to try a different way? (personal access token) Source: GitHub Authentication when i click on yes. it asks to create a personal acess token when I get give the personal token, I am getting this below error in the output window.

auth: Error: No auth flow succeeded.
at a.GitHubServer login (/code-server-4.93.1-linux-amd64/lib/vscode/extensions/github-authentication/dist/extension js 1:228535)
at process TicksAndRejections (node internal/process/task_queues:95:5)
at a.GitHubAuthenticationProvider.createSession (/code-server-4.93.1-linux-amd64/lib/vscode/extensions/github- authentication/dist/extension.js:1:224358)
at c. $createSession (/code-server-4.93.1-linux-amd64/lib/vscode/out/vs/workbench/api/node/out-vscode-reh-
web/vs/workberich/api/node/file:/home/runner/work/code-server/code- server/lib/vscode/src/vs/workbench/api/common/extHostAuthentication.ts:89:11)

I am using the latest github copilot and vs-codeserver (v4.93.1) vs code (1.93.1)

is there any workaround for this issue?

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

AltStyle によって変換されたページ (->オリジナル) /