sourcegraph / sourcegraph-public-snapshot

Code AI platform with Code Search & Cody
https://sourcegraph.com
Other
10.12k stars 1.29k forks source link

Authentication of Cody extension in VS Codium fails because of hard-coded vscode:// link. #55083

Open LightTemplar opened 1 year ago

LightTemplar commented 1 year ago

Steps to reproduce:

  1. Install Cody extension in VS Codium
  2. Initiate authentication flow
  3. After authenticating in browser, the redirect tries to open a vscode:// link in VS Codium

Expected behavior:

The authorization link should open within VS Codium to complete authorization.

Actual behavior:

The vscode:// link fails to open in VS Codium, leaving authentication incomplete.

Root cause:

The authentication flow seems to use hard-coded vscode:// links instead of vscodium:// links. VS Codium requires vscodium:// protocol to handle custom internal links.

Proposed solution:

Detect if editor is VS Codium and use vscodium:// links when needed.

thednp commented 10 months ago

Has anyone managed to get cody to work with VS Codium? I've tried running in a terminal

xdg-open vscodium://sourcegraph.cody-ai?code=sgp_code

and I got "Operation not supported". I suspect it has to do with the fact that VSCodium doesn't support telemetry.

wyrd-code commented 10 months ago

Yes, there is an issue with instructions that I found but can't find again so I'll retype here.

Create a json file on disk with your access token structured like this:

{
  "token": "YOUR_TOKEN_HERE"
}

And add this line to VSCodium json settings:

  "cody.experimental.localTokenPath": "TOKEN_FILE_PATH_HERE",

Then restart VSCodium and it should work.

thednp commented 10 months ago

@wyrd-code that worked like a charm, thank you!

AoAnima commented 9 months ago

Yes, there is an issue with instructions that I found but can't find again so I'll retype here.

Create a json file on disk with your access token structured like this:

{
  "token": "YOUR_TOKEN_HERE"
}

And add this line to VSCodium json settings:

  "cody.experimental.localTokenPath": "TOKEN_FILE_PATH_HERE",

Then restart VSCodium and it should work.

Not work in cody 1.2.1706540836