microsoft / microsoft/copilot-for-eclipse

[Bug] Large Copilot Agent conversation exhausts SWT handles when restored from chat history

Open
#419 0 comments 2 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: Windows
  • Eclipse Version: 2026-06 (4.40.0)
  • Plugin Version: 0.21.0

Describe the bug
Opening a large persisted GitHub Copilot Agent conversation from the chat history can cause the Eclipse UI to become unresponsive.

The Eclipse error log repeatedly reports:

org.eclipse.swt.SWTError: No more handles

The exception occurs while GitHub Copilot is restoring/rendering chat turns, with the stack trace pointing into the Copilot chat UI, for example:

com.microsoft.copilot.eclipse.ui.chat.CopilotTurnWidget.createFooter(...)
com.microsoft.copilot.eclipse.ui.chat.CopilotTurnWidget...
com.microsoft.copilot.eclipse.ui.chat.ChatView...

The affected conversation is a long-running Agent conversation containing approximately:

  • 200+ chat turns
  • 700+ agent rounds
  • 1,000+ tool calls

The persisted conversation file is approximately 1 MB in size.

The issue appears to be related to the amount of UI state restored rather than simply the size of the persisted JSON file.

As a diagnostic test, the same conversation was split into smaller, structurally unchanged conversation histories.

The smaller subsets can be restored and displayed by the Copilot Chat view, whereas restoring the complete conversation causes severe UI problems and eventually results in SWTError: No more handles.

This suggests that restoring a sufficiently large Agent conversation may create or retain too many SWT resources/widgets.

To Reproduce
Steps to reproduce the behavior:

  1. Use GitHub Copilot Chat in Agent mode over an extended period.

  2. Accumulate a large conversation containing many Agent rounds and tool calls.

  3. Close or switch away from the conversation.

  4. Open the conversation again from the Copilot chat history.

  5. Wait while Copilot restores the persisted conversation.

  6. Observe that the Copilot Chat view becomes very slow or unresponsive.

  7. Check the Eclipse Error Log.

  8. Observe repeated errors similar to:

    org.eclipse.swt.SWTError: No more handles
    

    with stack frames inside the Copilot chat UI, including:

    com.microsoft.copilot.eclipse.ui.chat.CopilotTurnWidget.createFooter(...)
    

In the affected case, splitting the persisted conversation into smaller subsets allowed those subsets to be displayed successfully.

Expected behavior
Copilot should be able to restore large persisted Agent conversations without exhausting SWT resources or freezing the Eclipse UI.

The Chat view should ideally avoid creating an unbounded number of SWT controls while restoring conversation history.

Possible approaches could include lazy rendering, virtualization of older turns, disposing controls that are no longer visible, or limiting the number of expanded Agent/tool-call UI elements restored at once.

At minimum, an unusually large conversation should not cause:

SWTError: No more handles

or make the Eclipse UI unresponsive.

Screenshots
Not applicable.

The Eclipse Error Log and a sanitized persisted conversation can be provided if required.

Additional context
This was investigated by splitting the affected persisted conversation into smaller subsets while keeping the individual retained turn structures unchanged.

The smaller subsets could be restored successfully.

The complete conversation contains significantly more Agent/tool-call state than a normal chat conversation, including hundreds of Agent rounds and more than one thousand tool calls.

This may be relevant because Agent turns can contain considerably more UI state than the number of top-level chat turns suggests.

There are existing fixes related to performance and UI freezes with long conversations, but this case specifically results in SWT handle exhaustion while restoring/rendering persisted chat history.

A sanitized conversation history and the complete Eclipse stack trace can be provided for reproduction if needed.

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 by reproducing the restoration failure with the affected large conversation or a sanitized history, then inspect CopilotTurnWidget.createFooter(...) and the surrounding ChatView restoration path named in the stack trace. Compare restoring smaller subsets with the complete history. Done means large Agent histories no longer exhaust SWT handles or leave the Eclipse UI unresponsive.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
desktop, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.