mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 04:30:48 +00:00
fix: fallback and auth issues when configuring a duplicate model id
This commit is contained in:
parent
afe6ba255e
commit
ded1ebcdff
4 changed files with 47 additions and 49 deletions
|
|
@ -66,12 +66,14 @@ function hasApiKeyForAuth(
|
|||
const defaultEnvKey = DEFAULT_ENV_KEYS[authType];
|
||||
if (defaultEnvKey) {
|
||||
const hasKey = !!process.env[defaultEnvKey];
|
||||
return { hasKey, checkedEnvKey: defaultEnvKey };
|
||||
if (hasKey) {
|
||||
return { hasKey, checkedEnvKey: defaultEnvKey };
|
||||
}
|
||||
}
|
||||
|
||||
// Also check settings.security.auth.apiKey as fallback
|
||||
if (settings.security?.auth?.apiKey) {
|
||||
return { hasKey: true, checkedEnvKey: undefined };
|
||||
return { hasKey: true, checkedEnvKey: defaultEnvKey || undefined };
|
||||
}
|
||||
|
||||
return { hasKey: false, checkedEnvKey: undefined };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue