fix: improve vendor configuration handling in LanguageModelsService#307896
Draft
DonJayamanne wants to merge 2 commits intomainfrom
Draft
fix: improve vendor configuration handling in LanguageModelsService#307896DonJayamanne wants to merge 2 commits intomainfrom
DonJayamanne wants to merge 2 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
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
_vendorsmap (notgetVendors()), so config can be stored even if a vendor is currently hidden bywhen.
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-groupprovideLanguageModelChatInfo({ group: ... })calls for all vendors that don’t contribute a vendor-level configuration schema. That’s a behavior change vs the previousvendor.isDefault && !vendor.configurationguard, 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 whenoptions.groupis 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #307898