do not show copilot models if they are not user selectable (#288078)

This commit is contained in:
Sandeep Somavarapu
2026-01-15 16:02:43 +01:00
committed by GitHub
parent c36e2b89d9
commit 82352d9ab5
2 changed files with 18 additions and 23 deletions

View File

@@ -437,7 +437,7 @@ export class InlineChatController implements IEditorContribution {
const persistModelChoice = this._configurationService.getValue<boolean>(InlineChatConfigKeys.PersistModelChoice);
const model = this._zone.value.widget.chatWidget.input.selectedLanguageModel;
if (!persistModelChoice && InlineChatController._selectVendorDefaultLanguageModel && model && !model.metadata.isDefaultForLocation[session.chatModel.initialLocation]) {
const ids = await this._languageModelService.selectLanguageModels({ vendor: model.metadata.vendor }, false);
const ids = await this._languageModelService.selectLanguageModels({ vendor: model.metadata.vendor });
for (const identifier of ids) {
const candidate = this._languageModelService.lookupLanguageModel(identifier);
if (candidate?.isDefaultForLocation[session.chatModel.initialLocation]) {
@@ -484,7 +484,7 @@ export class InlineChatController implements IEditorContribution {
delete arg.attachments;
}
if (arg.modelSelector) {
const id = (await this._languageModelService.selectLanguageModels(arg.modelSelector, false)).sort().at(0);
const id = (await this._languageModelService.selectLanguageModels(arg.modelSelector)).sort().at(0);
if (!id) {
throw new Error(`No language models found matching selector: ${JSON.stringify(arg.modelSelector)}.`);
}