{"record":{"id":"128a57908ddcd605","repo":"zed-industries/zed","slug":"failed-to-wait-for-agent-server-exit-err","errorCode":null,"errorMessage":"failed to wait for agent server exit: {err}","messagePattern":"failed to wait for agent server exit: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/agent_servers/src/acp.rs","lineNumber":951,"sourceCode":"        let io_task = cx.background_spawn(async move {\n            if let Err(err) = connection_future.await {\n                log::error!(\"ACP connection error: {err}\");\n            }\n        });\n\n        let connection_rx = async move {\n            connection_rx\n                .await\n                .context(\"Failed to receive ACP connection handle\")\n        }\n        .boxed_local();\n        let status_fut = child\n            .status()\n            .map({\n                let debug_log = debug_log.clone();\n                move |status| match status {\n                    Ok(status) => Ok(exited_load_error_with_stderr(status, &debug_log)),\n                    Err(err) => Err(anyhow!(\"failed to wait for agent server exit: {err}\")),\n                }\n            })\n            .boxed_local();\n        let (connection, status_fut) = match futures::future::select(connection_rx, status_fut)\n            .await\n        {\n            futures::future::Either::Left((connection, status_fut)) => (connection?, status_fut),\n            futures::future::Either::Right((load_error, _connection_rx)) => {\n                return Err(load_error?.into());\n            }\n        };\n\n        // Set up the foreground dispatch loop to process work items from handlers.\n        let dispatch_context = ClientContext {\n            sessions: sessions.clone(),\n            session_list: client_session_list.clone(),\n            request_elicitations: request_elicitations.clone(),\n        };","sourceCodeStart":933,"sourceCodeEnd":969,"githubUrl":"https://github.com/zed-industries/zed/blob/916fc2b8cb3a815cbef4a3b40e13081be72036b6/crates/agent_servers/src/acp.rs#L933-L969","documentation":"Logged when the ACP connection supervisor fails to await the child agent-server process's status future while monitoring whether the spawned server exited. This is an infrastructure error in the connection lifecycle: the underlying error {err} comes from the async child process machinery (e.g. the I/O loop was dropped), not from the agent protocol itself.","triggerScenarios":"Thrown at crates/agent_servers/src/acp.rs:963 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check system process limits and ensure spawning child processes is permitted","Restart the agent server connection so a fresh child process is spawned","Inspect the agent server's debug log for why its process lifecycle ended abnormally"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"916fc2b8cb3a815cbef4a3b40e13081be72036b6","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}