Skip to content

Fix memory leaks in AgentFeedbackInputWidget#314766

Merged
benibenj merged 1 commit into
mainfrom
benibenj/favourite-aardvark
May 6, 2026
Merged

Fix memory leaks in AgentFeedbackInputWidget#314766
benibenj merged 1 commit into
mainfrom
benibenj/favourite-aardvark

Conversation

@benibenj
Copy link
Copy Markdown
Contributor

@benibenj benibenj commented May 6, 2026

Copilot Generated Description: Refactor the AgentFeedbackInputWidget to properly register disposables, preventing memory leaks.

fixes #314629

Copilot AI review requested due to automatic review settings May 6, 2026 15:44
@benibenj benibenj enabled auto-merge May 6, 2026 15:44
@benibenj benibenj self-assigned this May 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Screenshot Changes

Base: dc1de9b2 Current: eaff28fe

Changed (1)

chat/widget/chatWidget/PendingToolApproval/Light
Before After
before after

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a disposal-related memory leak in the Agents window’s agent feedback input overlay by making AgentFeedbackInputWidget a proper Disposable and registering all of its owned resources (emitters, actions, action bar, and the ModifierKeyEmitter subscription) with _register(). This directly addresses the reported runtime error where ActionBar.push() was invoked after the ActionBar had already been disposed (triggered via a lingering modifier-key listener).

Changes:

  • Convert AgentFeedbackInputWidget to extend Disposable and call super() in the constructor.
  • Register Emitters, Actions, ActionBar, and the ModifierKeyEmitter event subscription via _register() to ensure teardown happens reliably.
  • Remove the manual dispose() implementation in favor of Disposable’s tracked disposal.
Show a summary per file
File Description
src/vs/sessions/contrib/agentFeedback/browser/agentFeedbackEditorInputContribution.ts Ensures the overlay input widget correctly owns and disposes its emitters/actions/action bar and modifier-key listener to prevent post-dispose updates and leaks.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@benibenj benibenj merged commit e1e6afe into main May 6, 2026
30 checks passed
@benibenj benibenj deleted the benibenj/favourite-aardvark branch May 6, 2026 17:01
@vs-code-engineering vs-code-engineering Bot added this to the 1.120.0 milestone May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Trying to add a disposable to a DisposableMap that has already been disposed of.

3 participants