Skip to content

Commit bcf7963

Browse files
committed
GH-1744: fix broken test for chat default model that is not needed anymore and causes the feature to be always disabled
1 parent cf75d78 commit bcf7963

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

vscode-extensions/vscode-spring-boot/lib/Main.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,9 @@ function registerMiscCommands(context: ExtensionContext) {
234234
}
235235

236236
async function activateSpringBootParticipant(context: ExtensionContext) {
237-
const model = (await lm.selectChatModels(CopilotRequest.DEFAULT_MODEL_SELECTOR))?.[0];
238-
if (!model) {
239-
const models = await lm.selectChatModels();
240-
logger.error(`Not a suitable model. The available models are: [${models.map(m => m.name).join(', ')}]. Please make sure you have installed the latest "GitHub Copilot Chat" (v0.16.0 or later) and all \`lm\` API is enabled.`);
237+
const models = await lm.selectChatModels();
238+
if (!models || models.length === 0) {
239+
logger.error(`No suitable model available. Please make sure you have installed the latest "GitHub Copilot Chat" (v0.16.0 or later) and all \`lm\` API is enabled.`);
241240
return;
242241
}
243242
springBootAgent.activate(context);

vscode-extensions/vscode-spring-boot/lib/copilot/index.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,9 @@ async function updateConfigurationBasedOnCopilotAccess() {
7878
return;
7979
}
8080

81-
const model = (await lm.selectChatModels(DEFAULT_MODEL_SELECTOR))?.[0];
82-
if (!model) {
83-
const models = await lm.selectChatModels();
84-
logger.error(`No suitable model, available models: [${models.map(m => m.name).join(', ')}]. Please make sure you have installed the latest "GitHub Copilot Chat" (v0.16.0 or later) and all \`lm\` API is enabled.`);
81+
const models = await lm.selectChatModels();
82+
if (!models || models.length === 0) {
83+
logger.error(`No suitable model available. Please make sure you have installed the latest "GitHub Copilot Chat" (v0.16.0 or later) and all \`lm\` API is enabled.`);
8584
await updateConfiguration(false);
8685
} else {
8786
await updateConfiguration(true);

0 commit comments

Comments
 (0)