fix: add QWEN_OAUTH in interactive mode

This commit is contained in:
tanzhenxin
2025-10-24 11:12:09 +08:00
parent 10f7968bc6
commit 570b745f30

View File

@@ -24,6 +24,9 @@ function getAuthTypeFromEnv(): AuthType | undefined {
if (process.env['OPENAI_API_KEY']) { if (process.env['OPENAI_API_KEY']) {
return AuthType.USE_OPENAI; return AuthType.USE_OPENAI;
} }
if (process.env['QWEN_OAUTH']) {
return AuthType.QWEN_OAUTH;
}
return undefined; return undefined;
} }
@@ -47,7 +50,7 @@ export async function validateNonInteractiveAuth(
enforcedType || getAuthTypeFromEnv() || configuredAuthType; enforcedType || getAuthTypeFromEnv() || configuredAuthType;
if (!effectiveAuthType) { if (!effectiveAuthType) {
const message = `Please set an Auth method in your ${USER_SETTINGS_PATH} or specify one of the following environment variables before running: GEMINI_API_KEY, OPENAI_API_KEY, GOOGLE_GENAI_USE_VERTEXAI, GOOGLE_GENAI_USE_GCA`; const message = `Please set an Auth method in your ${USER_SETTINGS_PATH} or specify one of the following environment variables before running: QWEN_OAUTH, OPENAI_API_KEY`;
throw new Error(message); throw new Error(message);
} }