CopilotC-Nvim / CopilotChat.nvim

Chat with GitHub Copilot in Neovim
https://copilotc-nvim.github.io/CopilotChat.nvim/
GNU General Public License v3.0
1.44k stars 67 forks source link

Copilot Chat experiencing callback error Out of Box #325

Closed augustdolan closed 3 months ago

augustdolan commented 3 months ago

Hey all, I'm newer to creating issue in general and didn't see a guide, so please feel free to point me in the direction of any resources you have instructing me on a cleaner issue creation. In the meantime here's the problem:

I installed CopilotChat.nvim and Copilot.lua per suggestions, and am simply using the default suggested Lazy installation.

I did install Copilot.lua after CopilotChat, but I cleaned my Lazy installs in case that was the issue. These issues appear for the default Copilot.lua config, as well as one with minor changes of my own.

Originally, I was receiving an error stating there was a problem at character 1. Here is the current error from :CopilotChatDebugInfo:

....local/share/nvim/lazy/plenary.nvim/lua/plenary/curl.lua:41: E5560: vimL function must not be called in a lua loop callback
stack traceback:
    [C]: in function 'has'
    ....local/share/nvim/lazy/plenary.nvim/lua/plenary/curl.lua:41: in function 'headers'
    ....local/share/nvim/lazy/plenary.nvim/lua/plenary/curl.lua:241: in function 'request'
    ....local/share/nvim/lazy/plenary.nvim/lua/plenary/curl.lua:277: in function 'post'
    ...e/nvim/lazy/CopilotChat.nvim/lua/CopilotChat/copilot.lua:408: in function 'on_done'
    ...e/nvim/lazy/CopilotChat.nvim/lua/CopilotChat/copilot.lua:319: in function '_user_on_exit'
    .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/job.lua:241: in function '_shutdown'
    .../.local/share/nvim/lazy/plenary.nvim/lua/plenary/job.lua:48: in function <.../.local/share/nvim/lazy/plenary.nvim/lua/plenary/job.lua:39>

Any ideas on what is going on?

Thanks in advance!

DoseOfGose commented 3 months ago

I am also receiving this. I will note that this occurs the first time I try to use CopilotChat.nvim, but it seems to work so far on all calls after the first.

Edit: Was too hasty on that claim, I do regularly get that error even after the first time, but when using certain prompts through hotkeys it will work.

deathbeam commented 3 months ago

Looks like plenary.nvim regression, probs better to open issue there: https://github.com/nvim-lua/plenary.nvim. I assume it has to do with them checking for some neovim 0.10.0 apis

augustdolan commented 3 months ago

I am also receiving this. I will note that this occurs the first time I try to use CopilotChat.nvim, but it seems to work so far on all calls after the first.

Ah, interesting. In my case if I make a new :CopilotChat <input> call (or some other variant) that is in fact when I receive "Expected value but found invalid token at character 1".

I believe this error may occur when trying to call the plugin as opposed to within the plugin itself, as this error does not show up in the :CopilotChatDebugInfo logs

augustdolan commented 3 months ago

I will go ahead and attempt to open an issue with them regarding this. Out of curiosity what plenary commit are you using in your lazy-lock @deathbeam ? Just in case they take a while to get back to me, it may be helpful for me to be able to compare versions

augustdolan commented 3 months ago

Opened Plenary Issue: https://github.com/nvim-lua/plenary.nvim/issues/588#issue-2306201956

augustdolan commented 3 months ago

Hi all - the regression was resolved and merged into plenary main. This dependency error is now resolved, and this issue is considered closed.

Thanks for the guidance @deathbeam.

@DoseOfGose run an update on your plenary plugin and you should see this error resolved