Skip to content

Move registerChatModelChangeListeners onto chat service#300288

Merged
mjbvz merged 2 commits intomicrosoft:mainfrom
mjbvz:dev/mjbvz/daily-dormouse
Mar 10, 2026
Merged

Move registerChatModelChangeListeners onto chat service#300288
mjbvz merged 2 commits intomicrosoft:mainfrom
mjbvz:dev/mjbvz/daily-dormouse

Conversation

@mjbvz
Copy link
Collaborator

@mjbvz mjbvz commented Mar 9, 2026

Not sure what this method was doing on the sessions service. Really should be deleted entirely but moving to a better home on the chat service as a first step

No sure what this method was doing on the sessions service. Really should be deleted entirely but moving to a better home on the chat service as a first step
Copilot AI review requested due to automatic review settings March 9, 2026 23:16
@mjbvz mjbvz self-assigned this Mar 9, 2026
@mjbvz mjbvz enabled auto-merge March 9, 2026 23:16
@vs-code-engineering vs-code-engineering bot added this to the 1.112.0 milestone Mar 9, 2026
Copy link
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 relocates registerChatModelChangeListeners from the chat sessions service to the chat service, aligning ownership of model-change observation with the service that manages chat models.

Changes:

  • Removed registerChatModelChangeListeners from IChatSessionsService and the ChatSessionsService implementation.
  • Added registerChatModelChangeListeners to IChatService and implemented it in ChatService.
  • Updated call sites and test mocks to use the new IChatService entry point.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/vs/workbench/contrib/chat/test/common/mockChatSessionsService.ts Drops the old sessions-service test hook for model-change listeners.
src/vs/workbench/contrib/chat/test/common/chatService/mockChatService.ts Adds a test hook to the chat-service mock for triggering model-change callbacks.
src/vs/workbench/contrib/chat/test/browser/agentSessions/localAgentSessionsController.test.ts Updates tests to trigger change callbacks via the chat-service mock instead of sessions service.
src/vs/workbench/contrib/chat/common/chatSessionsService.ts Removes the registerChatModelChangeListeners API from IChatSessionsService.
src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.ts Adds the moved registerChatModelChangeListeners implementation onto ChatService.
src/vs/workbench/contrib/chat/common/chatService/chatService.ts Adds the new (deprecated) IChatService.registerChatModelChangeListeners signature.
src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.ts Removes the ChatSessionsService.registerChatModelChangeListeners implementation and related imports.
src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsController.ts Switches listener registration to chatService.registerChatModelChangeListeners(...).
src/vs/workbench/api/browser/mainThreadChatSessions.ts Switches listener registration to chatService.registerChatModelChangeListeners(...).

joshspicer
joshspicer previously approved these changes Mar 9, 2026
@mjbvz mjbvz merged commit abe7e4b into microsoft:main Mar 10, 2026
18 checks passed
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.

4 participants