Skip to content

Remove chat response model onDidChange listener#289297

Merged
roblourens merged 1 commit intomainfrom
roblou/substantial-cephalopod
Jan 21, 2026
Merged

Remove chat response model onDidChange listener#289297
roblourens merged 1 commit intomainfrom
roblou/substantial-cephalopod

Conversation

@roblourens
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings January 21, 2026 03:08
@roblourens roblourens enabled auto-merge (squash) January 21, 2026 03:08
@roblourens roblourens self-assigned this Jan 21, 2026
@vs-code-engineering vs-code-engineering bot added this to the January 2026 milestone Jan 21, 2026
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 pull request refactors how chat response blocked states are managed during checkpoint operations. Instead of using an event-based approach where responses listen to IChatSetCheckpointEvent events, the PR introduces a direct setBlockedState method that is called explicitly when needed.

Changes:

  • Removed event-based notification system for checkpoint changes (IChatSetCheckpointEvent)
  • Added direct setBlockedState method to ChatResponseModel for explicit state management
  • Simplified the checkpoint event handling by removing the listener in the response model constructor

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/vs/workbench/contrib/chat/common/model/chatViewModel.ts Removed IChatSetCheckpointEvent from the view model change event union type and removed the interface definition
src/vs/workbench/contrib/chat/common/model/chatModel.ts Removed the event listener in ChatResponseModel constructor, added setBlockedState method, removed IChatSetCheckpointEvent from model change events, and updated setCheckpoint to directly call the new method
Comments suppressed due to low confidence (1)

src/vs/workbench/contrib/chat/common/model/chatModel.ts:2156

  • When handling requests before the checkpoint index, the response's blocked state should also be set to false. Currently, only the request's blocked state is being updated, which could leave responses in an incorrect blocked state.
			} else if (checkpoint && i < checkpointIndex) {
				request.setShouldBeBlocked(false);

Comment on lines 2148 to 2149
if (this._checkpoint && !checkpoint) {
request.setShouldBeBlocked(false);
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

When clearing the checkpoint or handling requests before the checkpoint index, the response's blocked state should also be reset to false. Currently, only the request's blocked state is being updated, which could leave responses in an incorrect blocked state.

This issue also appears in the following locations of the same file:

  • line 2155

Copilot uses AI. Check for mistakes.
@roblourens roblourens merged commit 995b626 into main Jan 21, 2026
27 of 28 checks passed
@roblourens roblourens deleted the roblou/substantial-cephalopod branch January 21, 2026 03:27
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Mar 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants