vscodium icon indicating copy to clipboard operation
vscodium copied to clipboard

[BUG] command 'github.copilot.generate' not found

Open rolimans opened this issue 4 years ago • 15 comments

Describe the bug After installing the extension and setting up my Github account in VSCodium I got a message saying the preview wasn't available for my account. Checking the Copilot website it said I was already in the preview.

I uninstalled and re-installed the extension and now when I try to execute any command from the extension I get that the command was not found.

Running on macOS BigSur on a Mac Pro 13 M1

E.g.

command 'github.copilot.generate' not found

Please confirm that this problem is VSCodium-specific

  • [X ] This bug doesn't happen if I use Microsoft's Visual Studio Code. It only happens in VSCodium.

Please confirm that the issue/resolution isn't already documented

  • [ X] I checked the Docs page and my issue is not mentioned there.

To Reproduce Steps to reproduce the behavior:

  1. Download the .vsix extension file for the Github Copilot extension
  2. Install the extension and login to github inside vscode
  3. In any document press ctrl+enter
  4. See error

Expected behavior Githhub copilot extension should do something

Desktop (please complete the following information):

  • OS: MacOS BigSur
  • Architecture: arm64
  • Version 1.61.2

rolimans avatar Oct 26 '21 20:10 rolimans

It seems to be a problem related on how VSCodium authenticates (using PAT's). When using the extension with version 1.1.1909 it works fine. I suspect it is something related with the copilot telemetry agreement that never shows up on VSCodium.

rolimans avatar Oct 26 '21 21:10 rolimans

When using version 1.1.1909 I get the following output

[INFO] [auth] [2021-10-26T21:22:42.982Z] Invalid copilot token: missing token
[ERROR] [ghostText] [2021-10-26T21:22:42.983Z] Error on ghost text request Error: User not authorized

rolimans avatar Oct 26 '21 21:10 rolimans

Unfortunately, for me, Copilot is only working with M$ VS Code, not VSCodium and I had to switch back :sob:

j2l avatar Dec 27 '21 13:12 j2l

Unfortunately, for me, Copilot is only working with M$ VS Code, not VSCodium and I had to switch back sob

Same. I am not able to use Copilot on Codium. It works well on VSCode. It is something to do with the URL Handler thing that is available for VSCode but not available for Codium

an4s911 avatar Jan 15 '22 11:01 an4s911

Any updates on this?

When using version 1.1.1909 I get the following output

[INFO] [auth] [2021-10-26T21:22:42.982Z] Invalid copilot token: missing token
[ERROR] [ghostText] [2021-10-26T21:22:42.983Z] Error on ghost text request Error: User not authorized

This is the exact same thing I'm getting.

dran1x avatar Mar 07 '22 23:03 dran1x

is github copilot available for vscodium?

pranavpk404 avatar Mar 15 '22 13:03 pranavpk404

is github copilot available for vscodium?

It is if you configure VSCodium to use the Visual Studio Marketplace.

TheLastZombie avatar Mar 15 '22 13:03 TheLastZombie

is github copilot available for vscodium?

It is if you configure VSCodium to use the Visual Studio Marketplace.

I've done exactly this and it still fails to connect to the auth server. I think it has to do with some Microsoft module that VSCodium removed.

dran1x avatar Mar 18 '22 15:03 dran1x

is github copilot available for vscodium?

It is if you configure VSCodium to use the Visual Studio Marketplace.

I've done exactly this and it still fails to connect to the auth server. I think it has to do with some Microsoft module that VSCodium removed.

Ah, I meant available as in "you can install it". Not much more though at the moment. It's probably a similar situation as with the remote extensions, where Microsoft adds some of the relevant code during the build process.

TheLastZombie avatar Mar 18 '22 19:03 TheLastZombie

Too bad, this is the only blocker that keeps me from switching to VSCodium.

rollingmoai avatar Mar 29 '22 13:03 rollingmoai

yeah, i had to switch back to ms vscode after finding this issue.

JoshMayBalGitHub avatar Apr 13 '22 00:04 JoshMayBalGitHub

OS: Ubuntu 20.04

install both VSCode and VSCodium

1. get the token

I installed Github Copilot in VSCodium and it said Invalid copilot token: missing token . Here is my solution.

GitHub token from https://github.com/settings/tokens and nvim Copilot token can't be used for VSCodium to log in. So I use VSCode Copilot token.

Open VSCode Copilot extension.js and find where the error raise.

On my computer, it's on ~/.vscode/extensions/github.copilot*/dist/extension.js

Please do not format the js file, or the extension may crash.

if (!n.ok || !c.token) return s.info(e, `Invalid copilot token: missing token: ${n.status} ${n.statusText}`), (0, i.telemetryError)(e, "auth.invalid_token", i.TelemetryData.createAndMarkAsIssued({
    status: n.status.toString(),
    status_text: n.statusText
}))

n is declared several lines before

console.log(t);
const n = await e.get(o.Fetcher).fetch("https://api.github.com/copilot_internal/v2/token", {
    headers: {
        Authorization: `token ${t}`
    }
});

I add console.log(t) before it.

Then start VSCode, open developer window, get the token, which may start with gho_ . Copy the token to VSCodium.

2. modify product.json

And then I meet another problem in VSCodium GitHub Copilot requires VS Code 1.57+.

It is noticed that in the developer window, a critical warning mentions product.json

CRITI Extension 'github.copilot' appears in product.json but enables LESS API proposals than the extension wants.
package.json (LOSES): inlineCompletionsNew, inlineCompletionsAdditions
product.json (WINS): inlineCompletions, textDocumentNotebook

Solution

Update /usr/share/codium/resources/app/product.json, add the lost attributes for GitHub.copilot

"GitHub.copilot": ["inlineCompletions", "inlineCompletionsNew", "inlineCompletionsAdditions", "textDocumentNotebook"],

GWDx avatar May 13 '22 01:05 GWDx

Hey @GWDx, thanks for your detailed instructions. Could you please elaborate on "Copy the token to VSCodium"? I managed to get my Copilot token (the one starting with gho_), but I'm not sure how to make the extension use it in VSCodium. Thanks!

Edit: sorry, I figured out what you meant - pasting it into the GitHub Personal Access Token prompt did the trick. Thanks again!

maxcutlyp avatar May 26 '22 07:05 maxcutlyp

I've tried to get a token using the code found in the NeoVim extension. The rough steps are:

Old steps
# 1. Start a device auth flow
$ http post https://github.com/login/device/code 'client_id=Iv1.b507a08c87ecfe98' scope='read:user'
device_code=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&expires_in=899&interval=5&user_code=XXXX-XXXX&verification_uri=https%3A%2F%2Fgithub.com%2Flogin%2Fdevice

# 2. Open up https://github.com/login/device, type in the user_code from above and authorize

# 3. Exchange the device code for an access token
$ http post 'https://github.com/login/oauth/access_token' 'client_id=Iv1.b507a08c87ecfe98' 'device_code=b944d90f8e630dac40102112e59dcdc24e8dfeb1' 'grant_type=urn:ietf:params:oauth:grant-type:device_code'
access_token=ghu_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&scope=&token_type=bearer

Codium doesn't seem to like this ghu_ token, however 🤔 Also, the empty scope looks a bit weird.

UPD: if you substitute client_id=01ab8ac9400c4e429b23 for the client id in the above, you get the gho_ token, which seems to work just fine with Codium!

The final instructions are:

# 1. Start a device auth flow
$ http post https://github.com/login/device/code 'client_id=01ab8ac9400c4e429b23' scope='read:user'
device_code=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&expires_in=899&interval=5&user_code=XXXX-XXXX&verification_uri=https%3A%2F%2Fgithub.com%2Flogin%2Fdevice

# 2. Open up https://github.com/login/device, type in the user_code from above and authorize

# 3. Exchange the device code for an access token
$ http post 'https://github.com/login/oauth/access_token' 'client_id=01ab8ac9400c4e429b23' 'device_code=b944d90f8e630dac40102112e59dcdc24e8dfeb1' 'grant_type=urn:ietf:params:oauth:grant-type:device_code'
access_token=gho_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&scope=&token_type=bearer

# 4. Fix up product.json as per @GWDx's instructions above

# 5. Restart Codium and copy the token over when it prompts for it

notpushkin avatar Jun 21 '22 20:06 notpushkin

In addition to the above instructions, if you use the nightly extension you may need to set "GitHub.copilot-nightly" in product.json to the same thing as "GitHub.copilot".

LewsTherinTelescope avatar Jun 22 '22 09:06 LewsTherinTelescope

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment, and we'll keep it open. If you have any new additional information, please include it with your comment!

github-actions[bot] avatar Dec 20 '22 01:12 github-actions[bot]

This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue, please open a new issue.

github-actions[bot] avatar Jan 19 '23 01:01 github-actions[bot]

Bump

@daiyam @GitMensch

rollingmoai avatar Jan 19 '23 02:01 rollingmoai