Fix/moonshot cn web search domain (#338)

This commit is contained in:
Lingxuan Zuo
2026-03-08 00:00:47 +08:00
committed by GitHub
Unverified
parent b41a8eedd9
commit c03d92e9a2
10 changed files with 318 additions and 74 deletions

View File

@@ -10,6 +10,7 @@ import {
BUILTIN_PROVIDER_TYPES,
getProviderConfig,
getProviderEnvVar,
getProviderEnvVars,
} from '@electron/utils/provider-registry';
describe('provider metadata', () => {
@@ -40,6 +41,17 @@ describe('provider metadata', () => {
});
});
it('uses a single canonical env key for moonshot provider', () => {
expect(getProviderEnvVar('moonshot')).toBe('MOONSHOT_API_KEY');
expect(getProviderEnvVars('moonshot')).toEqual(['MOONSHOT_API_KEY']);
expect(getProviderConfig('moonshot')).toEqual(
expect.objectContaining({
baseUrl: 'https://api.moonshot.cn/v1',
apiKeyEnv: 'MOONSHOT_API_KEY',
})
);
});
it('keeps builtin provider sources in sync', () => {
expect(BUILTIN_PROVIDER_TYPES).toEqual(
expect.arrayContaining(['anthropic', 'openai', 'google', 'openrouter', 'ark', 'moonshot', 'siliconflow', 'minimax-portal', 'minimax-portal-cn', 'qwen-portal', 'ollama'])