mirror of
https://github.com/zed-industries/zed.git
synced 2026-10-21 05:31:11 +00:00
Give ACP v2 runtime/process resources an explicit, idempotent shutdown boundary independent of retained session models. - Shut down v2 connections when their shared `AgentConnectionStore` is released or the app quits. Weak ownership tracking includes replaced connections still retained by old views or pending receipts without pinning them. - Cancel pending connection startup when its owner ends and shut down a connection that succeeds after its owner has gone away. A weak resource-level v2 app-quit hook is installed before initialization completes, so process termination does not depend on foreground startup cancellation being polled during quit. - Keep startup resources alive through startup error arbitration. A protocol rejection must not be replaced by the SIGKILL caused by our own cleanup. Explicit owner/app shutdown can still take the resources immediately; the existing priority for natural process exit remains unchanged. - Close the shared foreground dispatcher after I/O/disconnect cleanup finishes, even when retained API handles still own senders. - Preserve receipt evidence and single-view release policy. No `session/close` RPC, automatic resend, or process termination merely because one view is released. ## Shutdown contract and scope - This is a **hard stop** using the existing owned-child mechanism, not a graceful agent shutdown or a new grace period. Agent-side work/persistence can be interrupted when the shared owner ends. - Quit callbacks synchronously initiate process termination and cooperative runtime cleanup, then return. They **do not wait for process reaping, final receipts or a full foreground/protocol drain before `App::shutdown()` returns**. Tests that await those outcomes afterward do not establish a before-return drain guarantee. - The explicit resource-shutdown hook is implemented for v2. Completed v1/native connections retain their existing default release behavior. - **Pending-connect cancellation applies to all agent types**, and dispatcher cleanup is shared with v1. These are intentional broader changes, not v2-only plumbing. Release Notes: - N/A |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| LICENSE-GPL | ||