Skip to content

Conversation

@jeffreyhunter77
Copy link
Collaborator

The addition of the IVSCodeExtensionContext dependency in InlineEditsModelService causes NESProvider in chat-lib to break (and publishing to fail) because of the missing dependency that shows up in a failing test:

Screenshot 2025-12-08 at 11 14 44

Can we do this to get NESProvider working again (and with the option for library users to provide an implementation if they choose)?

Copilot AI review requested due to automatic review settings December 12, 2025 21:41
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 fixes a breaking change in the NESProvider used by chat-lib by refactoring the UndesiredModelsManager to support optional dependency injection. The issue occurred when IVSCodeExtensionContext was added as a direct dependency to InlineEditsModelService, causing library consumers without VS Code extension context to fail.

Key changes:

  • Extracted IUndesiredModelsManager interface to enable dependency injection and alternative implementations
  • Moved UndesiredModels.Manager from node implementation to common interface layer for reusability
  • Added NullUndesiredModelsManager as a no-op implementation for library consumers
  • Made undesiredModelsManager an optional parameter in INESProviderOptions for chat-lib users

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/platform/inlineEdits/node/inlineEditsModelService.ts Removed direct IVSCodeExtensionContext dependency and UndesiredModels namespace; replaced with injected IUndesiredModelsManager service
src/platform/inlineEdits/common/inlineEditsModelService.ts Added IUndesiredModelsManager interface, moved UndesiredModels.Manager implementation here, and added NullUndesiredModelsManager null implementation
src/lib/node/chatLibMain.ts Added optional undesiredModelsManager parameter to INESProviderOptions and registered service with fallback to null implementation
src/extension/extension/vscode/services.ts Registered UndesiredModels.Manager as the implementation of IUndesiredModelsManager for the VS Code extension

The refactoring successfully decouples the platform service from VS Code-specific APIs while maintaining functionality for extension consumers and enabling library consumers to provide their own implementations or use the default no-op behavior.

@lszomoru lszomoru assigned chrmarti and ulugbekna and unassigned lszomoru Dec 15, 2025
@jeffreyhunter77 jeffreyhunter77 force-pushed the jeffreyhunter77/broken-nes-provider branch from b257d47 to ae98bf1 Compare December 15, 2025 14:18
@ulugbekna ulugbekna removed their assignment Dec 15, 2025
@jeffreyhunter77 jeffreyhunter77 force-pushed the jeffreyhunter77/broken-nes-provider branch from ae98bf1 to 01741b5 Compare December 15, 2025 17:08
Copy link
Collaborator

@chrmarti chrmarti left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@chrmarti chrmarti added this pull request to the merge queue Dec 16, 2025
@vs-code-engineering vs-code-engineering bot added this to the December / January 2026 milestone Dec 16, 2025
Merged via the queue into main with commit 4571933 Dec 16, 2025
16 checks passed
@chrmarti chrmarti deleted the jeffreyhunter77/broken-nes-provider branch December 16, 2025 16:04
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.

6 participants