microsoft / microsoft/copilot-for-eclipse
[Bug] Remove synchronous conversation persistence waits from SWT UI paths
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 126
- Forks
- 60
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 5
Description
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:
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:
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:
- Delay or pause the Copilot language server, or open a workspace where CLS initialization takes several minutes.
- Switch the Chat mode or close Eclipse.
- 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 withthenCompose/thenAcceptchains. - Ensure service disposal does not wait indefinitely for CLS.
- Surface persistence failures through existing logging instead of silently discarding them.
Acceptance criteria:
- No
conversation/persistencewait 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with ChatBaseService.getPersistentFilePath, persistUserPreference, and UserPreferenceService.setActiveChatMode, then trace the ActionBar and shutdown paths shown in the issue. Replace the SWT-path waits with the suggested asynchronous chains and safe local defaults, and verify that mode switching and Eclipse shutdown remain responsive when CLS does not respond. Confirm persistence completes when the LSP future becomes available and failures are logged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100