Fix ACP connection and thread leak (#35670)

When you switched away from an ACP thread, the `AcpThreadView` entity
(and thus thread, and subprocess) was leaked. This happened because we
were using `cx.processor` for the `list` state callback, which uses a
strong reference.

This PR changes the callback so that it holds a weak reference, and adds
some tests and assertions at various levels to make sure we don't
reintroduce the leak in the future.

Release Notes:

- N/A
This commit is contained in:
Agus Zubiaga 2025-08-05 19:10:51 -03:00 committed by GitHub
parent f27dc7dec7
commit b7469f5bc3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 73 additions and 27 deletions

View file

@ -423,7 +423,7 @@ zlog_settings = { path = "crates/zlog_settings" }
#
agentic-coding-protocol = "0.0.10"
agent-client-protocol = "0.0.18"
agent-client-protocol = "0.0.20"
aho-corasick = "1.1"
alacritty_terminal = { git = "https://github.com/zed-industries/alacritty.git", branch = "add-hush-login-flag" }
any_vec = "0.14"