Closed mquhuy closed 1 year ago
This should be silenced already, could you provide the output from :messages
?
Sure. Here's some logs from my latest run. In the past I've also seen the error displayed even for "CODEIUM_STATE_SUCCESS"
completion request failed
completion request failed
[codeium] [ERROR 11:23:37] ...ocal/share/nvim/lazy/codeium.nvim/lua/codeium/notify.lua:14: completion request failed: {
[codeium] code = 0,
[codeium] out = '{"state":{"state":"CODEIUM_STATE_INACTIVE", "message":"Skipping completions because text after cursor is nontrivial"}}',
[codeium] response = {
[codeium] body = '{"state":{"state":"CODEIUM_STATE_INACTIVE", "message":"Skipping completions because text after cursor is nontrivial"}}'
,
[codeium] exit = 0,
[codeium] headers = { "", "HTTP/1.1 200 OK", "Accept-Encoding: gzip", "Content-Encoding: gzip", "Content-Type: application/json", "Vary:
Origin", "Date: Tue, 07 Feb 2023 09:23:36 GMT", "Content-Length: 130", "", "" },
[codeium] status = 100
[codeium] },
[codeium] status = 100
[codeium] }
1 change; before #8 2 seconds ago
completion request failed
completion request failed
[codeium] [ERROR 11:23:42] ...ocal/share/nvim/lazy/codeium.nvim/lua/codeium/notify.lua:14: completion request failed: {
[codeium] code = 0,
[codeium] out = '{"state":{"state":"CODEIUM_STATE_INACTIVE", "message":"Skipping completions because text after cursor is nontrivial"}}',
[codeium] response = {
[codeium] body = '{"state":{"state":"CODEIUM_STATE_INACTIVE", "message":"Skipping completions because text after cursor is nontrivial"}}'
,
[codeium] exit = 0,
[codeium] headers = { "", "HTTP/1.1 200 OK", "Accept-Encoding: gzip", "Content-Encoding: gzip", "Content-Type: application/json", "Vary:
Origin", "Date: Tue, 07 Feb 2023 09:23:41 GMT", "Content-Length: 130", "", "" },
[codeium] status = 100
[codeium] },
[codeium] status = 100
[codeium] }
completion request failed
completion request failed
[codeium] [ERROR 11:23:44] ...ocal/share/nvim/lazy/codeium.nvim/lua/codeium/notify.lua:14: completion request failed: {
[codeium] code = 0,
[codeium] out = '{"state":{"state":"CODEIUM_STATE_INACTIVE", "message":"Skipping completions because text after cursor is nontrivial"}}',
[codeium] response = {
[codeium] body = '{"state":{"state":"CODEIUM_STATE_INACTIVE", "message":"Skipping completions because text after cursor is nontrivial"}}'
,
[codeium] exit = 0,
[codeium] headers = { "", "HTTP/1.1 200 OK", "Accept-Encoding: gzip", "Content-Encoding: gzip", "Content-Type: application/json", "Vary:
Origin", "Date: Tue, 07 Feb 2023 09:23:44 GMT", "Content-Length: 130", "", "" },
[codeium] status = 100
[codeium] },
[codeium] status = 100
[codeium] }
completion request failed
completion request failed
[codeium] [ERROR 11:23:48] ...ocal/share/nvim/lazy/codeium.nvim/lua/codeium/notify.lua:14: completion request failed: {
[codeium] code = 0,
[codeium] out = '{"state":{"state":"CODEIUM_STATE_INACTIVE", "message":"Skipping completions because text after cursor is nontrivial"}}',
[codeium] response = {
[codeium] body = '{"state":{"state":"CODEIUM_STATE_INACTIVE", "message":"Skipping completions because text after cursor is nontrivial"}}'
,
[codeium] exit = 0,
[codeium] headers = { "", "HTTP/1.1 200 OK", "Accept-Encoding: gzip", "Content-Encoding: gzip", "Content-Type: application/json", "Vary:
Origin", "Date: Tue, 07 Feb 2023 09:23:48 GMT", "Content-Length: 130", "", "" },
[codeium] status = 100
[codeium] },
[codeium] status = 100
[codeium] }
completion request failed
completion request failed
[codeium] [ERROR 11:23:49] ...ocal/share/nvim/lazy/codeium.nvim/lua/codeium/notify.lua:14: completion request failed: {
[codeium] code = 0,
These errors should be silenced with the latest commit, please let me know if they aren't.
I get the same 'completion request failed' errors on my mac. Just tested it out with the newest commit. In an empty file it works as expected but if I have code in there already i get those errors every time I enter insert mode.
Hi @jcdickinson , thank you for the quick response, but for me it didn't seem to help :-?
Another issue I now noticed is that sometimes there're errors shown up even if the state says "CODEIUM_STATE_SUCCESS"
[codeium] status = 100
[codeium] }
completion request failed
completion request failed
[codeium] [ERROR 10:42:57] ...ocal/share/nvim/lazy/codeium.nvim/lua/codeium/notify.lua:14: completion request failed: {
[codeium] code = 0,
[codeium] out = '{"code":"canceled","message":"Post \\"https://server.codeium.com:443/exa.api_server_pb.ApiServerService/GetCompletions\\": context canceled"}',
[codeium] response = {
[codeium] body = '{"code":"canceled","message":"Post \\"https://server.codeium.com:443/exa.api_server_pb.ApiServerService/GetCompletions\\": context canceled"}',
[codeium] exit = 0,
[codeium] headers = { "", "HTTP/1.1 408 Request Timeout", "Accept-Encoding: gzip", "Content-Type: application/json", "Vary: Origin", "Date: Fri, 10 Feb 2023 08:42:57 GMT", "Content-Length: 139", "", "" },
[codeium] status = 100
[codeium] },
[codeium] status = 100
[codeium] }
completion request failed
completion request failed
[codeium] [ERROR 10:43:00] ...ocal/share/nvim/lazy/codeium.nvim/lua/codeium/notify.lua:14: completion request failed: {
[codeium] code = 0,
[codeium] out = '{"code":"unknown","message":"read message: context canceled"}',
[codeium] response = {
[codeium] body = '{"code":"unknown","message":"read message: context canceled"}',
[codeium] exit = 0,
[codeium] headers = { "", "HTTP/1.1 500 Internal Server Error", "Accept-Encoding: gzip", "Content-Type: application/json", "Vary: Origin", "Date: Fri, 10 Feb 2023 08:43:00 GMT", "Content-Length: 61", "", "" },
[codeium] status = 100
[codeium] },
[codeium] status = 100
[codeium] }
completion request failed
completion request failed
[codeium] [ERROR 10:43:03] ...ocal/share/nvim/lazy/codeium.nvim/lua/codeium/notify.lua:14: completion request failed: {
[codeium] code = 0,
[codeium] out = "{\"state\":{\"state\":\"CODEIUM_STATE_SUCCESS\", \"message\":\"Generated 4 completions\"}, \"completionItems\":[{\"completion\":{\"completionId\":\"812c7a93-c7ed-4c30-a2e2-76f6e31c98cf\", \"text\"
@mquhuy I just pushed more improvements for silencing errors. Please let me know if that helps.
Hi there - I'm using the latest code and I'm also getting the same error even with a status CODEIUM_STATE_SUCCESS
.
I've noticed the header says Code 200 OK
but status
on codium plugin is status = 100
It triggers, for example, when editing my nvim files
It looks like status code is considered an error by the http lib, but Codeium is signaling it's expect to 100 Continue
as everything is fine so far.
With the following change I stop getting errors but multiline completion seems to output partial code when editing this project. For example, when typing function
and letting the plugin suggest something:
It will output only 2 lines, which is not valid code:
diff --git a/lua/codeium/api.lua b/lua/codeium/api.lua
index 2cf7c75..729d21e 100644
--- a/lua/codeium/api.lua
+++ b/lua/codeium/api.lua
@@ -253,7 +253,7 @@ function Server:new()
}, function(body, err)
request_id = 0
- if err then
+ if err and err.status ~= 100 then
if err.status == 408 then
-- Timeout error
return callback(false, nil)
@@ -271,10 +271,6 @@ function Server:new()
log.debug("completion request cancelled at the server", json.message)
return callback(false, nil)
end
- if err.status == 100 and json.code then
- log.debug("completion request failed", json)
- return callback(false, nil)
- end
end
notify.error("completion request failed", err)
@bltavares the code to the right of the list is exactly what Codeium suggests. This an unofficial plugin and fixing suggestions isn't something that I can do.
Ah, thanks for letting me know. I'm trying the tool for the first time so I was not sure whether it worked as expected or not.
On Wed, Mar 1, 2023, 17:42 Jonathan Dickinson @.***> wrote:
Closed #19 https://github.com/jcdickinson/codeium.nvim/issues/19 as completed via 7d62e9d https://github.com/jcdickinson/codeium.nvim/commit/7d62e9d7c2c30780b3ea016f1a247b8e324dd900 .
— Reply to this email directly, view it on GitHub https://github.com/jcdickinson/codeium.nvim/issues/19#event-8642494116, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA2XIS7BVQJRUFCYMNXJGLWZ6YD3ANCNFSM6AAAAAAUSI76MM . You are receiving this because you were mentioned.Message ID: @.***>
Hi.
I've recently known about this plugin and it seems to match my setup much better than the official one. However, it seems to me the "completion request failed" happens way too often, and when it does, my nvim will be bombarded with all the logs, and I have no way but to press Esc several times to come back to my work.
I'm wondering if there's anyway to prevent this from happening? If the request fails for some reason, the plugin can either retry or just ignore, but not display any error on the UI?
Thank you a lot for a good plugin!