Skip to content

fix: improve vendor configuration handling in LanguageModelsService#307896

Draft
DonJayamanne wants to merge 2 commits intomainfrom
don/unemployed-otter
Draft

fix: improve vendor configuration handling in LanguageModelsService#307896
DonJayamanne wants to merge 2 commits intomainfrom
don/unemployed-otter

Conversation

@DonJayamanne
Copy link
Copy Markdown
Contributor

@DonJayamanne DonJayamanne commented Apr 5, 2026

Fixes #307898

@DonJayamanne DonJayamanne self-assigned this Apr 5, 2026
Copilot AI review requested due to automatic review settings April 5, 2026 13:20
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 PR adjusts how LanguageModelsService handles vendor/group configuration resolution, aiming to avoid unnecessary model re-resolution for groups that only contribute per-model settings and to ensure per-model config can be persisted even when a vendor is hidden by its when clause.

Changes:

  • Changes group handling during model resolution so vendors without a vendor-level configuration schema don’t automatically trigger separate per-group model resolution.
  • Updates per-model config persistence to look up vendors from the full _vendors map (not getVendors()), so config can be stored even if a vendor is currently hidden by when.
Show a summary per file
File Description
src/vs/workbench/contrib/chat/common/languageModels.ts Tweaks model resolution flow for schema-less vendors and changes vendor lookup used when persisting per-model settings.

Copilot's findings

Comments suppressed due to low confidence (1)

src/vs/workbench/contrib/chat/common/languageModels.ts:895

  • The new if (!vendor.configuration) shortcut skips per-group provideLanguageModelChatInfo({ group: ... }) calls for all vendors that don’t contribute a vendor-level configuration schema. That’s a behavior change vs the previous vendor.isDefault && !vendor.configuration guard, and it breaks providers that only return models when a group is specified (e.g. the existing per-model configuration tests use a provider that returns [] for the ungrouped call and models only when options.group is set).

Consider narrowing this optimization so group-based resolution still happens when needed (for example, only skip group resolution when the initial ungrouped call already returned models, or keep this special-cased to the default vendor). Otherwise configured groups for schema-less vendors will never resolve any models.

				// For vendors without a configuration schema, groups only carry per-model
				// settings and should not trigger a separate model resolution call.
				// Instead, apply the per-model config to the already-resolved models.
				if (!vendor.configuration) {
					if (group.settings) {
						for (const model of allModels) {
							const modelConfig = group.settings[model.metadata.id];
							if (modelConfig) {
								// Store raw config (without resolving secrets) to avoid leaking secrets on persist
								perModelConfigurations.set(model.identifier, { ...modelConfig });
							}
						}
					}
					languageModelsGroups.push({ group, modelIdentifiers: [] });
					continue;
				}
  • Files reviewed: 1/1 changed files
  • Comments generated: 0

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.

Selecting a configuration value in Language Model is a noop for Copilot CLI

2 participants