Exafunction / codeium.vim

Free, ultrafast Copilot alternative for Vim and Neovim
https://codeium.com
MIT License
3.73k stars 127 forks source link

Title: Limiting the number of processes in codeium.vim #101

Open xuwei152 opened 1 year ago

xuwei152 commented 1 year ago

I'm using codeium.vim on a server where I don't have root access. The service only allows users to run up to 200 processes. However, codeium.vim creates too many processes as shown in the attached image. I was wondering if there's a way to limit the number of processes created by Codium.

image

Thanks in advanece

fortenforge commented 1 year ago

There should only be one codeium process per nvim process. The fact that you have so many suggests that maybe many processes are not being killed when nvim exits. I can look into this.

fortenforge commented 1 year ago

Curious if #102 fixes this issue for you. We now explicitly call jobstop upon VimLeave which should kill the language server process.

xuwei152 commented 1 year ago

Indeed, after exiting Neovim, all processes of Codeium are terminated. However, my typical usage scenario involves opening two panes in Tmux - one to open Neovim and one to run a program, as shown in the figure below. Since Codeium uses too many processes, I have to exit Neovim in order to run the program with multithread. Therefore, I hope to limit the number of processes so that I can run multi-threaded programs without closing Neovim.

image

fortenforge commented 1 year ago

Hmm, I'm not sure why we're launching so many processes then.

can you add the following line to function! s:ActuallyStart() abort inside codeium.vim/autoload/codeium/server.vim?

call codeium#log#Error('Starting language server.')

And then the following line to your init.nvim file:

let g:codeium_log_file = '/home/<user>/codeium.log`

Then tail the log file and let us know what actions cause Starting language server to get printed?

xuwei152 commented 1 year ago

Sorry for the late reply. I have attached the log file. codeium.log

ZSaberLv0 commented 1 year ago

image

got similar issue, codeium created many curl task during usage, but all of them would exit properly when vim exited

vamsikun commented 1 year ago

@ZSaberLv0, @xuwei152 have you solved this issue?

pqn commented 1 year ago

@ZSaberLv0 If curl is hanging, maybe you can try adding an argument like --max-time to the invocations of curl in the plugin. Is the service working otherwise? If we need to investigate further maybe you can make a new issue, seems like this is sufficiently different.

xuwei152 commented 1 year ago

No, the issue is still there. I have to close neovim when I use a multithreading program like fzf.

chrisgrieser commented 11 months ago

same for me, however, for me, it is always exactly two codeium processes running:

Pasted image 2023-08-08 at 19 21 32@2x
neovim 0.9.1 (homebrew)
neovide 0.11.0 (homebrew)
macOS 13.4.1 (M1)
fortenforge commented 11 months ago

@chrisgrieser there will always be exactly 2 processes actually; one is the child process of the other.

renjinxi commented 3 months ago

I encountered the same problem. I just installed codeium today. I am using neovim. What configuration should I do to limit the number of processes?