fix: sync token among multiple qwen sessions (#443)

* fix: sync token among multiple qwen sessions

* fix: adjust cleanup function
This commit is contained in:
Mingholy
2025-08-27 13:17:28 +08:00
committed by GitHub
parent de279b56f3
commit 009e083b73
11 changed files with 3579 additions and 449 deletions

View File

@@ -69,10 +69,6 @@ export function AuthDialog({
return item.value === AuthType.USE_GEMINI;
}
if (process.env.QWEN_OAUTH_TOKEN) {
return item.value === AuthType.QWEN_OAUTH;
}
return item.value === AuthType.LOGIN_WITH_GOOGLE;
}),
);

View File

@@ -140,7 +140,7 @@ describe('getInstallationInfo', () => {
const info = getInstallationInfo(projectRoot, false);
expect(mockedExecSync).toHaveBeenCalledWith(
'brew list -1 | grep -q "^gemini-cli$"',
'brew list -1 | grep -q "^qwen-code$"',
{ stdio: 'ignore' },
);
expect(info.packageManager).toBe(PackageManager.HOMEBREW);
@@ -162,7 +162,7 @@ describe('getInstallationInfo', () => {
const info = getInstallationInfo(projectRoot, false);
expect(mockedExecSync).toHaveBeenCalledWith(
'brew list -1 | grep -q "^gemini-cli$"',
'brew list -1 | grep -q "^qwen-code$"',
{ stdio: 'ignore' },
);
// Should fall back to default global npm

View File

@@ -77,8 +77,8 @@ export function getInstallationInfo(
// Check for Homebrew
if (process.platform === 'darwin') {
try {
// The package name in homebrew is gemini-cli
childProcess.execSync('brew list -1 | grep -q "^gemini-cli$"', {
// We do not support homebrew for now, keep forward compatibility for future use
childProcess.execSync('brew list -1 | grep -q "^qwen-code$"', {
stdio: 'ignore',
});
return {
@@ -88,8 +88,7 @@ export function getInstallationInfo(
'Installed via Homebrew. Please update with "brew upgrade".',
};
} catch (_error) {
// Brew is not installed or gemini-cli is not installed via brew.
// Continue to the next check.
// continue to the next check
}
}

View File

@@ -21,9 +21,6 @@ function getAuthTypeFromEnv(): AuthType | undefined {
if (process.env.OPENAI_API_KEY) {
return AuthType.USE_OPENAI;
}
if (process.env.QWEN_OAUTH_TOKEN) {
return AuthType.QWEN_OAUTH;
}
return undefined;
}