Skip to content

Conversation

@carlos-algms
Copy link
Contributor

@carlos-algms carlos-algms commented Oct 25, 2025

ACP processes were not being closed, leaving behind orphan zombie processes.

In my machine, I had more than 30 zombie processes.

The previous transport_self.process:close() only closes the communication between Neovim and the spawned process, but it doesn't kill the process.

Now, it sends 15 to start a graceful exit flow, and if it gets stuck, it sends a force termination with 9.

Changes

  • Add proper process termination with SIGTERM (15), then SIGKILL (9)
  • Check if the process is closing before cleanup to prevent errors
  • Add type annotations for ACPTransportInstance
  • Use vim.uv with fallback to vim.loop for compatibility

How to test

Before, original behaviour:

  1. open neovim
  2. open avante
  3. write any prompt and submit
  4. exit with :qa
  5. run ps aux | grep <your acp provider name, mine is claude-code-acp>
  6. you should see at least 1 orphan process

Using these changes

After step 4, exit with :qa and then run step 5.
You should see 0 orphan processes.

- Add proper process termination with SIGTERM then SIGKILL
- Check if process is closing before cleanup to prevent errors
- Add type annotations for ACPTransportInstance
- Use vim.uv with fallback to vim.loop for compatibility
@yetone yetone merged commit 7e9f7b5 into yetone:main Oct 26, 2025
3 checks passed
@carlos-algms carlos-algms deleted the close-ACP-process-properly branch October 26, 2025 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants