TerminalFi / LSP-copilot

GitHub Copilot support for Sublime Text LSP plugin provided through Copilot.vim.
623 stars 25 forks source link

Can't sign out #156

Closed tomerarnon closed 1 month ago

tomerarnon commented 1 month ago

My LSP-copilot is accidentally signed into a github account which does not have copilot access. Hence, it doesn't work. When I try to sign out to use the correct credentials, Copilot: Sign Out has no effect...

jfcherng commented 1 month ago

Interesting... I can reproduce this with a account which doesn't subscribe to copilot.

:: [10:52:02.047] --> LSP-copilot signOut (7): {}
:: [10:52:02.535] <-  LSP-copilot window/logMessage: {'type': 3, 'message': '[auth] Invalid copilot token: missing token: 403 '}
:: [10:52:02.535] <<< LSP-copilot (7) (duration: 488ms): {'status': 'NotAuthorized', 'user': 'XXXXXX'}

I've started a discussion in https://github.com/orgs/community/discussions/126315

jfcherng commented 1 month ago

As a workaround, you can delete its session by deleting the whole github-copilot folder.

On Windows, it's %localappdata%\github-copilot. On other platforms, it's ~/.config/github-copilot.

jfcherng commented 1 month ago

As a workaround, you can delete its session by deleting the whole github-copilot folder.

If eventually the GitHub officials don't really care Sublime Text, we probably have to delete that directory directly rather than calling Copilot.vim's signOut command. Or someone has to reverse engineer https://github.com/github/copilot.vim/blob/release/dist/agent.js again.


I am not sure whether Copilot.vim suffers from the same issue though... But it looks like it just calls the signOut command directly too. https://github.com/github/copilot.vim/blob/c79d711cbf7c6672c6c57d6df7c5ab7b6cac2b7a/autoload/copilot.vim#L630-L638

jfcherng commented 1 month ago

It looks like I can't sign out a subscribed account either now.

:: [14:44:16.071] --> LSP-copilot signOut (32): {}
:: [14:44:16.085] <<< LSP-copilot (32) (duration: 14ms): {'status': 'OK', 'user': 'jfcherng'}
jfcherng commented 1 month ago

A fixed (workaround) new release has been tagged and will be available on Package Control within hours.

jfcherng commented 3 weeks ago

This is claimed to be fixed in https://github.com/orgs/community/discussions/126315#discussioncomment-9691739 anyway.