mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
fix: sync token among multiple qwen sessions (#443)
* fix: sync token among multiple qwen sessions * fix: adjust cleanup function
This commit is contained in:
@@ -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;
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user