{"record":{"id":"2bce2f45da025f23","repo":"zed-industries/zed","slug":"cannot-send-initialize-request-task-still-buildin","errorCode":null,"errorMessage":"Cannot send initialize request, task still building","messagePattern":"Cannot send initialize request, task still building","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/project/src/debugger/session.rs","lineNumber":1275,"sourceCode":"                .update(cx, |session, cx| {\n                    session.respond_to_client(\n                        seq,\n                        success,\n                        RunInTerminal::COMMAND.to_string(),\n                        body,\n                        cx,\n                    )\n                })?\n                .await\n        })\n    }\n\n    pub(super) fn request_initialize(&mut self, cx: &mut Context<Self>) -> Task<Result<()>> {\n        let adapter_id = self.adapter().to_string();\n        let request = Initialize { adapter_id };\n\n        let SessionState::Running(running) = &self.state else {\n            return Task::ready(Err(anyhow!(\n                \"Cannot send initialize request, task still building\"\n            )));\n        };\n        let mut response = running.request(request.clone());\n\n        cx.spawn(async move |this, cx| {\n            loop {\n                let capabilities = response.await;\n                match capabilities {\n                    Err(e) => {\n                        let Ok(Some(reconnect)) = this.update(cx, |this, cx| {\n                            this.as_running()\n                                .and_then(|running| running.reconnect_for_ssh(&mut cx.to_async()))\n                        }) else {\n                            return Err(e);\n                        };\n                        log::info!(\"Failed to connect to debug adapter: {}, retrying...\", e);\n                        reconnect.await?;","sourceCodeStart":1257,"sourceCodeEnd":1293,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/project/src/debugger/session.rs#L1257-L1293","documentation":"request_initialize was called while the session state is still Booting — the adapter process/binary has not finished starting, so the initialize request cannot be sent yet. The session pipeline should retry once booting completes.","triggerScenarios":"Thrown at crates/project/src/debugger/session.rs:1275 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Wait for the boot/build to finish and re-issue the initialize request (the session retries automatically in the normal flow)","If it never leaves Booting, check the build task and adapter download for failures"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}