{"record":{"id":"eb8cf4fae78cfcf3","repo":"Hmbown/CodeWhale","slug":"lsp-initialized-notification-timed-out","errorCode":null,"errorMessage":"LSP initialized notification timed out","messagePattern":"LSP initialized notification timed out","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/lsp/client.rs","lineNumber":308,"sourceCode":"            ));\n        }\n        if result\n            .pointer(\"/capabilities/positionEncoding\")\n            .is_some_and(|encoding| encoding.as_str() != Some(\"utf-16\"))\n        {\n            return Err(anyhow!(\"LSP server must use UTF-16 positions\"));\n        }\n        timeout(\n            initialize_wait,\n            send_message(\n                &transport.tx_outbound,\n                &json!({\n                    \"jsonrpc\": \"2.0\", \"method\": \"initialized\", \"params\": {}\n                }),\n            ),\n        )\n        .await\n        .map_err(|_| anyhow!(\"LSP initialized notification timed out\"))??;\n        Ok(transport)\n    }\n}\n\nimpl Drop for StdioLspTransport {\n    fn drop(&mut self) {\n        for task in &self.tasks {\n            task.abort();\n        }\n        if let Ok(mut child) = self.child.try_lock()\n            && let Some(child) = child.as_mut()\n        {\n            let _ = child.start_kill();\n        }\n        // If shutdown/dispatcher currently owns the child, abort releases\n        // its local Child and kill_on_drop remains the final fallback.\n    }\n}","sourceCodeStart":290,"sourceCodeEnd":326,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/lsp/client.rs#L290-L326","documentation":"spawn_with_timeout sent the LSP 'initialized' notification after the initialize response but the handshake future did not complete within the initialize_wait budget; the server accepted initialize but never finished startup in time, so initialization aborts.","triggerScenarios":"The `initialized` notification write times out — the server's stdin pipe is full/blocked, the process died right after initialize, or the writer lock is contended.","commonSituations":"Server crashed immediately after initialize; extremely slow server startup under load; pipe backpressure because the server is not reading stdin.","solutions":["Check the server process is alive and reading stdin (e.g. ps, strace)","Increase the initialize_wait timeout","Look at server stderr for crash output right after initialize","Ensure no other code holds the transport writer lock"],"exampleFix":"// before\n.map_err(|_| anyhow!(\"LSP initialized notification timed out\"))??;\n// after\n.map_err(|_| anyhow!(\"LSP initialized notification timed out; server may have exited after initialize\"))\n    .with_context(|| format!(\"server cmd {:?}\", server_cmd)))?;","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"timeout(initialize_wait, send_message(&tx, &json!({\"jsonrpc\":\"2.0\",\"method\":\"initialized\",\"params\":{}})))\n    .await\n    .map_err(|_| anyhow!(\"initialized notification timed out; is the server still running?\"))??;","preventionTips":["Monitor the server process during startup and fail fast if it exits","Give initialize_wait headroom on cold starts","Capture server stderr from spawn so crash reasons are visible"],"tags":["lsp","timeout","notification"],"backgroundTag":"request-timeout","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-22T06:17:15.046Z"}