Skip to content

Commit 1e3c131

Browse files
committed
save anthropic key if supplied
1 parent 94aed11 commit 1e3c131

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

extensions/positron-assistant/src/config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,10 @@ async function saveModel(userConfig: positron.ai.LanguageModelConfig, sources: p
272272
const id = randomUUID();
273273

274274
// Check if this provider uses autoconfiguration (should not be saved to persistent state)
275+
// Some models such as Anthropic can use either autoconfiguration or manual configuration;
276+
// if an apiKey is provided, treat it as manual configuration
275277
const providerSource = sources.find(source => source.provider.id === userConfig.provider);
276-
const isAutoconfigured = providerSource?.defaults.autoconfigure !== undefined;
278+
const isAutoconfigured = !apiKey && providerSource?.defaults.autoconfigure !== undefined;
277279

278280
// Filter out sources that use autoconfiguration for required field validation
279281
sources = sources.filter(source => source.defaults.autoconfigure === undefined);

0 commit comments

Comments
 (0)