Skip to content

Commit eb5b8d3

Browse files
authored
Assistant: Fix adding experimental providers (#8279)
Follow-up to #8139, fixes a regression when adding the hidden experimental providers. ### QA Notes Enable an experimental provider with FIM completion support (e.g. Mistral, OpenAI), then sign in. The model should not hang when adding the completion provider.
1 parent cb41a6b commit eb5b8d3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/vs/workbench/contrib/positronAssistant/browser/languageModelModalDialog.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ interface LanguageModelConfigurationProps {
8484

8585
const LanguageModelConfiguration = (props: React.PropsWithChildren<LanguageModelConfigurationProps>) => {
8686
// Construct the list of providers from the sources, which are defined in the extension. See extensions/positron-assistant/src/models.ts
87+
const allProviders = props.sources;
8788
const providers = props.sources
8889
.filter(source => source.type === 'chat' || (source.type === 'completion' && source.provider.id === 'copilot'))
8990
.sort((a, b) => {
@@ -270,7 +271,7 @@ const LanguageModelConfiguration = (props: React.PropsWithChildren<LanguageModel
270271
if (providerConfig.completions) {
271272
setShowProgress(true);
272273
// Assume a completion source exists with the same provider ID and compatible auth details
273-
const completionSource = providerSources.find((source) => source.provider.id === providerConfig.provider && source.type === 'completion')!;
274+
const completionSource = allProviders.find((source) => source.provider.id === providerConfig.provider && source.type === 'completion')!;
274275
const completionConfig = {
275276
provider: providerConfig.provider,
276277
type: PositronLanguageModelType.Completion,

0 commit comments

Comments
 (0)