microsoft / microsoft/copilot-for-eclipse

[Bug] Remove synchronous conversation persistence waits from SWT UI paths

Open
#432 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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:

  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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.