diff --git a/packages/cli/src/config/settings.test.ts b/packages/cli/src/config/settings.test.ts
index ae655fe1..c1cce6bf 100644
--- a/packages/cli/src/config/settings.test.ts
+++ b/packages/cli/src/config/settings.test.ts
@@ -98,6 +98,7 @@ describe('Settings Loading and Merging', () => {
expect(settings.merged).toEqual({
customThemes: {},
mcpServers: {},
+ openaiConfig: {},
});
expect(settings.errors.length).toBe(0);
});
@@ -131,6 +132,7 @@ describe('Settings Loading and Merging', () => {
...systemSettingsContent,
customThemes: {},
mcpServers: {},
+ openaiConfig: {},
});
});
@@ -164,6 +166,7 @@ describe('Settings Loading and Merging', () => {
...userSettingsContent,
customThemes: {},
mcpServers: {},
+ openaiConfig: {},
});
});
@@ -195,6 +198,7 @@ describe('Settings Loading and Merging', () => {
...workspaceSettingsContent,
customThemes: {},
mcpServers: {},
+ openaiConfig: {},
});
});
@@ -232,6 +236,7 @@ describe('Settings Loading and Merging', () => {
contextFileName: 'WORKSPACE_CONTEXT.md',
customThemes: {},
mcpServers: {},
+ openaiConfig: {},
});
});
@@ -281,6 +286,7 @@ describe('Settings Loading and Merging', () => {
allowMCPServers: ['server1', 'server2'],
customThemes: {},
mcpServers: {},
+ openaiConfig: {},
});
});
@@ -560,6 +566,7 @@ describe('Settings Loading and Merging', () => {
expect(settings.merged).toEqual({
customThemes: {},
mcpServers: {},
+ openaiConfig: {},
});
// Check that error objects are populated in settings.errors
@@ -954,6 +961,7 @@ describe('Settings Loading and Merging', () => {
...systemSettingsContent,
customThemes: {},
mcpServers: {},
+ openaiConfig: {},
});
});
});
diff --git a/packages/cli/src/ui/components/AuthDialog.tsx b/packages/cli/src/ui/components/AuthDialog.tsx
index 74a6344f..e63aef99 100644
--- a/packages/cli/src/ui/components/AuthDialog.tsx
+++ b/packages/cli/src/ui/components/AuthDialog.tsx
@@ -92,7 +92,7 @@ export function AuthDialog({
setOpenAIApiKey(apiKey);
setOpenAIBaseUrl(baseUrl);
setOpenAIModel(model);
-
+
// Save OpenAI configuration to user settings as fallback
// Priority order: .env > workspace settings.json > ~/.qwen/settings.json
try {
@@ -100,14 +100,14 @@ export function AuthDialog({
if (apiKey.trim()) openAIConfig.OPENAI_API_KEY = apiKey.trim();
if (baseUrl.trim()) openAIConfig.OPENAI_BASE_URL = baseUrl.trim();
if (model.trim()) openAIConfig.OPENAI_MODEL = model.trim();
-
+
// Save to user settings as environment variables for next time
- settings.setValue(SettingScope.User, 'openaiConfig' as any, openAIConfig);
+ settings.setValue(SettingScope.User, 'openaiConfig', openAIConfig);
} catch (error) {
// Don't block authentication if saving fails
console.warn('Failed to save OpenAI config to settings:', error);
}
-
+
setShowOpenAIKeyPrompt(false);
onSelect(AuthType.USE_OPENAI, SettingScope.User);
};
@@ -142,9 +142,18 @@ export function AuthDialog({
if (showOpenAIKeyPrompt) {
// Load default values from settings
const defaultValues = {
- apiKey: process.env.OPENAI_API_KEY || settings.merged.openaiConfig?.OPENAI_API_KEY || '',
- baseUrl: process.env.OPENAI_BASE_URL || settings.merged.openaiConfig?.OPENAI_BASE_URL || '',
- model: process.env.OPENAI_MODEL || settings.merged.openaiConfig?.OPENAI_MODEL || '',
+ apiKey:
+ process.env.OPENAI_API_KEY ||
+ settings.merged.openaiConfig?.OPENAI_API_KEY ||
+ '',
+ baseUrl:
+ process.env.OPENAI_BASE_URL ||
+ settings.merged.openaiConfig?.OPENAI_BASE_URL ||
+ '',
+ model:
+ process.env.OPENAI_MODEL ||
+ settings.merged.openaiConfig?.OPENAI_MODEL ||
+ '',
};
return (
@@ -189,7 +198,7 @@ export function AuthDialog({
- {'https://github.com/QwenLM/Qwen3-Coder/blob/main/README.md'}
+ {'https://github.com/QwenLM/qwen-code/blob/main/README.md'}
diff --git a/packages/cli/src/ui/components/OpenAIKeyPrompt.test.tsx b/packages/cli/src/ui/components/OpenAIKeyPrompt.test.tsx
index 77353e9f..9770402d 100644
--- a/packages/cli/src/ui/components/OpenAIKeyPrompt.test.tsx
+++ b/packages/cli/src/ui/components/OpenAIKeyPrompt.test.tsx
@@ -17,8 +17,7 @@ describe('OpenAIKeyPrompt', () => {
,
);
- expect(lastFrame()).toContain('OpenAI Configuration Required');
- expect(lastFrame()).toContain('https://platform.openai.com/api-keys');
+ expect(lastFrame()).toContain('API Configuration Required');
expect(lastFrame()).toContain(
'Press Enter to continue, Tab/↑↓ to navigate, Esc to cancel',
);
@@ -33,7 +32,7 @@ describe('OpenAIKeyPrompt', () => {
);
const output = lastFrame();
- expect(output).toContain('OpenAI Configuration Required');
+ expect(output).toContain('API Configuration Required');
expect(output).toContain('API Key:');
expect(output).toContain('Base URL:');
expect(output).toContain('Model:');
diff --git a/packages/cli/src/ui/components/OpenAIKeyPrompt.tsx b/packages/cli/src/ui/components/OpenAIKeyPrompt.tsx
index 05ef4605..53007052 100644
--- a/packages/cli/src/ui/components/OpenAIKeyPrompt.tsx
+++ b/packages/cli/src/ui/components/OpenAIKeyPrompt.tsx
@@ -31,7 +31,6 @@ export function OpenAIKeyPrompt({
>('apiKey');
useInput((input, key) => {
-
// Ignore control sequences like [I or [O from focus switching
if (input && (input === '[I' || input === '[O')) {
return;
@@ -147,15 +146,10 @@ export function OpenAIKeyPrompt({
width="100%"
>
- OpenAI Configuration Required
+ API Configuration Required
-
- Please enter your OpenAI configuration. You can get an API key from{' '}
-
- https://platform.openai.com/api-keys
-
-
+ Please enter your API configuration.