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

Copilot agent throwing errors with foreign characters

Open Ganitzsh opened this issue 3 years ago • 1 comments

Hello there,

I have noticed that suggestions containing foreign characters are causing the copilot node process to throw errors:

[ERROR][2022-06-21 10:47:21] .../vim/lsp/rpc.lua:420	"rpc"	"node"	"stderr"	"[ERROR] [streamChoices] [2022-06-21T08:47:21.693Z] Invalid streamingData\n"
[ERROR][2022-06-21 10:47:21] .../vim/lsp/rpc.lua:420	"rpc"	"node"	"stderr"	"[ERROR] [streamChoices] [2022-06-21T08:47:21.693Z] Invalid streamingData joinedText:[{\n   \"א'\", \"ב'\", \"ג'\", \"ד'\", \"ה'\", \"ו'\", \"ש'\",\n}\n] not a substring of joinedTokens:[ {\n   \"א'\", \"ב'\", \"bytes:\\xd7bytes:\\x92'\", \"bytes:\\xd7bytes:\\x93'\", \"ה'\", \"ו'\", \"ש'\",\n}\n]\n"

Where is the js code coming from?

Ganitzsh avatar Jun 21 '22 08:06 Ganitzsh

I have noticed this too, but I think it's an upstream issue. I'll see if I can trace down the cause and make an issue post in neovim.

zbirenbaum avatar Jun 21 '22 18:06 zbirenbaum

This is (was?) not a neovim specific issue. I found reports of it happening in other editors as well a while after seeing this issue. It might be possible to suppress these messages, but that might come at the risk of also suppressing legitimate errors...

For example, if you search for 'invalid streamingData' in the post about Visual Studio here: https://github.com/community/community/discussions/15606 you can see the same type of error occuring.

11:11:45.579 [ERROR] [streamChoices] [2022-04-21T09:11:45.544Z] Invalid streamingData
11:11:45.579 [ERROR] [streamChoices] [2022-04-21T09:11:45.544Z] Invalid streamingData,joinedText:[TODO: Add more methods to add more properties to the DemandVariant.

Since it's outside the scope of this plugin and possibly even neovim itself to address this, I'm going to close this issue for now.

zbirenbaum avatar Nov 21 '22 08:11 zbirenbaum