**Environment** - OS: RHEL 9.6 - Eclipse Version: 4.38 and 4.41 nightly - Plugin Version: 0.21.0 **Describe the bug** Several UI and shutdown paths synchronously wait for the language server: ```text UserPreferenceService.setActiveChatMode -> ChatBaseService.persistUserPreference -> ChatBaseService.getPersistentFilePath -> lsConnection.persistence().get() ``` When CLS is slow or busy, this blocks the SWT UI thread. It has been observed while: - Switching between Agent and Ask modes - Initializing model preferences - Shutting down Eclipse A representative stack is: ```text java.util.concurrent.CompletableFuture.get com.microsoft.copilot.eclipse.ui.chat.services.ChatBaseService.getPersistentFilePath com.microsoft.copilot.eclipse.ui.chat.services.ChatBaseService.persistUserPreference com.microsoft.copilot.eclipse.ui.chat.services.UserPreferenceService.setActiveChatMode com.microsoft.copilot.eclipse.ui.chat.ActionBar... ``` Related issues: - #297 - #405 - #408 - microsoft/copilot-language-server-internal#1802 **To Reproduce** Steps to reproduce the behavior: 1. Delay or pause the Copilot language server, or open a workspace where CLS initialization takes several minutes. 2. Switch the Chat mode or close Eclipse. 3. Observe that the SWT UI thread waits indefinitely in `CompletableFuture.get()`. **Expected behavior** UI actions and bundle shutdown must never synchronously wait for an LSP response. **Screenshots** N/A. Thread dumps are available in #297, #405, and #408. **Additional context** Suggested direction: - Resolve and cache the persistence path asynchronously. - Initialize UI observables with safe local defaults. - Reconcile persisted preferences after the LSP future completes. - Replace blocking `.get()` calls with `thenCompose`/`thenAccept` chains. - Ensure service disposal does not wait indefinitely for CLS. - Surface persistence failures through existing logging instead of silently discarding them. Acceptance criteria: - No `conversation/persistence` wait occurs on the SWT UI thread. - Mode switching remains responsive if CLS never responds. - Eclipse shutdown is not blocked by the persistence request. - Preferences are persisted once the asynchronous path becomes available.
Activity