Skip to content

[Bug] Defer and coalesce customization discovery during Copilot startup #433

Description

@jdneo

Environment

  • OS: RHEL 9.6
  • Eclipse Version: 4.38 and 4.41 nightly
  • Plugin Version: 0.21.0

Describe the bug

During startup, ChatServiceManager schedules several language-server operations concurrently:

  • Model loading
  • Conversation-template loading
  • Custom skill discovery
  • Custom prompt discovery
  • Custom instruction discovery
  • Custom agent discovery

CustomizationFileService.refreshAllAsync() sends one request per customization type and passes every top-level Eclipse project as a workspace folder.

For large workspaces, CLS can spend minutes recursively discovering and watching customization files. Because other requests share the same CLS process, model loading and Chat remain unavailable until discovery completes.

Related issues:

To Reproduce

Steps to reproduce the behavior:

  1. Open an Eclipse workspace containing a very large project tree.
  2. Start Eclipse with Copilot 0.21.0.
  3. Open Copilot Chat or the Models preference page.
  4. Observe that Models remains in the loading state and Chat does not respond.
  5. Observe high CPU usage in the copilot-language-server process.
  6. Wait for customization discovery to complete; Models and Chat then become responsive.

Expected behavior

Copilot Chat and model selection should become usable without waiting for workspace-wide customization discovery.

Screenshots

Logs and recordings are available in #408.

Additional context

Suggested plugin-side mitigation:

  • Do not eagerly request every customization type during plugin activation.
  • Maintain at most one in-flight refresh per workspace.
  • Avoid duplicate refreshes caused by authentication, feature-flag, and customization events.
  • Load customization data lazily when the corresponding feature is used.
  • Scope discovery to relevant projects where possible.
  • Do not send concurrent workspace-wide discovery requests while critical startup requests are pending.

Serializing the existing unbounded scans is not sufficient by itself, because a single scan can still block CLS for several minutes.

Acceptance criteria:

  • Models and Chat are usable while customization discovery is pending.
  • Startup does not issue duplicate or concurrent workspace-wide discovery requests.
  • Customizations are eventually discovered and refreshed correctly.
  • Existing multi-project behavior is preserved.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions