Skip to content

Add support for CLS to setConfigs mid-runtime#308723

Merged
chrmarti merged 3 commits intomainfrom
vscode-copilot-chat/migrate-5017
Apr 9, 2026
Merged

Add support for CLS to setConfigs mid-runtime#308723
chrmarti merged 3 commits intomainfrom
vscode-copilot-chat/migrate-5017

Conversation

@chrmarti
Copy link
Copy Markdown
Collaborator

@chrmarti chrmarti commented Apr 9, 2026

Migrated from microsoft/vscode-copilot-chat#5017
Original author: @andreamah


Adds setConfigs to INESProvider and IInlineCompletionsProvider to ensure that configs can be added. With this, editor reloads don't need to happen for config to refresh.

@chrmarti chrmarti self-assigned this Apr 9, 2026
Copilot AI review requested due to automatic review settings April 9, 2026 09:11
@chrmarti chrmarti enabled auto-merge (rebase) April 9, 2026 09:15
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

Adds a mid-runtime configuration override mechanism to the Copilot “chat lib” facades (NES + inline completions) so CLS can refresh settings without requiring an editor reload.

Changes:

  • Added setConfigs(overrides) to INESProvider and IInlineCompletionsProvider, and implemented it to apply overrides at runtime.
  • Enhanced OverridableConfigurationService to support dynamic setConfig updates and emit configuration-change events.
  • Updated DefaultsOnlyConfigurationService.setConfig signature to match IConfigurationService.
Show a summary per file
File Description
extensions/copilot/src/platform/configuration/common/defaultsOnlyConfigurationService.ts Aligns setConfig override signature with IConfigurationService.
extensions/copilot/src/lib/node/chatLibMain.ts Adds setConfigs APIs and runtime override propagation for NES + inline completions; updates config override plumbing/events.

Copilot's findings

Comments suppressed due to low confidence (1)

extensions/copilot/src/lib/node/chatLibMain.ts:805

  • setConfigs invokes this._configurationService.setConfig(...) without awaiting/handling the returned Thenable. To avoid potential unhandled rejections and ensure determinism for callers, please either handle the promise (e.g. void ...catch(...)) or make setConfigs return a Promise<void> and await the updates.
	setConfigs(overrides: Map<string, unknown>) {
		for (const [key, value] of overrides) {
			const config = globalConfigRegistry.configs.get(`${CopilotConfigPrefix}.${key}`);
			if (config) {
				this._configurationService.setConfig(config, value);
			}
		}
		if (this._completionsConfigProvider instanceof InMemoryConfigProvider) {
			this._completionsConfigProvider.setCopilotSettings(Object.fromEntries(overrides));
		}
  • Files reviewed: 2/2 changed files
  • Comments generated: 2

Comment thread extensions/copilot/src/lib/node/chatLibMain.ts Outdated
Comment thread extensions/copilot/src/lib/node/chatLibMain.ts
@chrmarti chrmarti disabled auto-merge April 9, 2026 09:38
@chrmarti chrmarti enabled auto-merge (squash) April 9, 2026 09:38
@chrmarti chrmarti merged commit a2188f2 into main Apr 9, 2026
23 of 24 checks passed
@chrmarti chrmarti deleted the vscode-copilot-chat/migrate-5017 branch April 9, 2026 10:04
@vs-code-engineering vs-code-engineering bot added this to the 1.116.0 milestone Apr 9, 2026
joshspicer pushed a commit that referenced this pull request Apr 9, 2026
Co-authored-by: Andrea Mah <andreamah@microsoft.com>
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