Skip to content

Commit aef35a5

Browse files
committed
Add static blacklist for unsupported VS Code Language Model IDs
1 parent f48fe60 commit aef35a5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/api/providers/vscode-lm.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,10 +555,13 @@ export class VsCodeLmHandler extends BaseProvider implements SingleCompletionHan
555555
}
556556
}
557557

558+
// Static blacklist of VS Code Language Model IDs that should be excluded from the model list e.g. because they will never work
559+
const VSCODE_LM_STATIC_BLACKLIST: string[] = ["claude-3.7-sonnet", "claude-3.7-sonnet-thought"]
560+
558561
export async function getVsCodeLmModels() {
559562
try {
560-
const models = await vscode.lm.selectChatModels({})
561-
return models || []
563+
const models = (await vscode.lm.selectChatModels({})) || []
564+
return models.filter((model) => !VSCODE_LM_STATIC_BLACKLIST.includes(model.id))
562565
} catch (error) {
563566
console.error(
564567
`Error fetching VS Code LM models: ${JSON.stringify(error, Object.getOwnPropertyNames(error), 2)}`,

0 commit comments

Comments
 (0)