Remove chat response model onDidChange listener#289297
Conversation
There was a problem hiding this comment.
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
setBlockedStatemethod toChatResponseModelfor 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);
| if (this._checkpoint && !checkpoint) { | ||
| request.setShouldBeBlocked(false); |
There was a problem hiding this comment.
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
No description provided.