copilot.lua icon indicating copy to clipboard operation
copilot.lua copied to clipboard

RPC error, code_name = unknown, Not authenticatd Not signedin

Open roccho-dev opened this issue 3 years ago • 7 comments

When trying openning panel, I've got error. When I'm investigating why I can't work copilot.lua and its completion, I've found this.

image image image image image

Hi, is there who has got same error message as mine?

Copilot Configuration, Click here
require('copilot').setup({
  panel = {
    enabled = true,
    auto_refresh = false,
    keymap = {
      jump_prev = "[[",
      jump_next = "]]",
      accept = "<CR>",
      refresh = "gr",
      open = "<M-CR>"
    },
  },
  suggestion = {
    enabled = true,
    auto_trigger = false,
    debounce = 75,
    keymap = {
      accept = "<M-CR>",
      accept_word = false,
      accept_line = false,
      next = "<M-]>",
      prev = "<M-[>",
      dismiss = "<C-]>",
    },
  },
  filetypes = {
    yaml = true,
    markdown = true,
    help = false,
    gitcommit = false,
    gitrebase = false,
    hgcommit = false,
    svn = false,
    cvs = false,
    ["."] = false, -- e.g. .dots, .env
    terraform = true,
    -- ["*"] = false, -- disable for all other filetypes and ignore default `filetypes`
  },
  -- copilot_node_command = 'node', -- Node.js version must be > 16.x
  server_opts_overrides = {
    trace = "verbose",
    settings = {
      advanced = {
        listCount = 10, -- #completions for panel
        inlineSuggestCount = 3, -- #completions for getCompletions
      }
    },
  }
})

I've install copilot just only copilot lua. No from node, no from copilot.vim. I recognize that copilot.lua require us to install only itself. If I'm wrong and error occurs why, please tell me anything.

Thanks.

P.S.1, what I've investigated same error on neovim, I've found this page only on google. does this page help us? https://github.com/neovim/nvim-lspconfig/issues/1815

roccho-dev avatar Jan 06 '23 09:01 roccho-dev

Can you try with Node.js 16 or 18?

MunifTanjim avatar Jan 06 '23 18:01 MunifTanjim

Node 16 is required. Run node --version and check the output

zbirenbaum avatar Jan 06 '23 18:01 zbirenbaum

Node 16 is required.

Recent copilot.vim says it supports 16+: https://github.com/github/copilot.vim/blob/324ec9eb69e20971b58340d0096c3caac7bc2089/autoload/copilot/agent.vim#LL364

I've never tried with 19 tho.


Also found this: https://github.com/community/community/discussions/35862

Looks like :Copilot auth signout then :Copilot auth signin might fix it.

MunifTanjim avatar Jan 06 '23 18:01 MunifTanjim

Node 16 is required.

Recent copilot.vim says it supports 16+: https://github.com/github/copilot.vim/blob/324ec9eb69e20971b58340d0096c3caac7bc2089/autoload/copilot/agent.vim#LL364

I've never tried with 19 tho.


Also found this: https://github.com/community/community/discussions/35862

Looks like :Copilot auth signout then :Copilot auth signin might fix it.

Really?! Glad they finally added support, should cut down on issues dramatically

zbirenbaum avatar Jan 06 '23 18:01 zbirenbaum

@MunifTanjim @zbirenbaum

Solved.

<Plug> Copilot auth signout
<Plug > Copilot auth signin

Thanks a lot.

By the way, is there the explanation of "Copilot auth [arguments]"? I've tried to un-plug and re-plug copilot.lua on plug manager, but I did not signout from github.

If existed, will you let me know where the explanation of that?Excuse me. If no, it's ok. This issue will maybe be useful in the future. Thanks.

roccho-dev avatar Jan 06 '23 22:01 roccho-dev

The auth information is usually stored in ~/.config/github-copilot/hosts.json file.

MunifTanjim avatar Jan 07 '23 07:01 MunifTanjim

通常、認証情報は~/.config/github-copilot/hosts.jsonファイルに保存されます。

Thanks. Checked.

roccho-dev avatar Jan 09 '23 11:01 roccho-dev