fix: test ci

This commit is contained in:
pomelo-nwu
2025-07-25 13:32:57 +08:00
parent eacb464a5b
commit 2b1e4c995e
4 changed files with 1345 additions and 1331 deletions

View File

@@ -394,7 +394,17 @@ export async function loadCliConfig(
? settings.enableOpenAILogging
: argv.openaiLogging) ?? false,
sampling_params: settings.sampling_params,
systemPromptMappings: settings.systemPromptMappings,
systemPromptMappings: settings.systemPromptMappings ?? [
{
baseUrls: [
'https://dashscope.aliyuncs.com/compatible-mode/v1/',
'https://dashscope-intl.aliyuncs.com/compatible-mode/v1/',
],
modelNames: ['qwen3-coder-plus'],
template:
'SYSTEM_TEMPLATE:{"name":"qwen3_coder","params":{"is_git_repository":{RUNTIME_VARS_IS_GIT_REPO},"sandbox":"{RUNTIME_VARS_SANDBOX}"}}',
},
],
});
}

File diff suppressed because it is too large Load Diff

View File

@@ -33,6 +33,9 @@ describe('OpenAIContentGenerator Timeout Handling', () => {
// Reset mocks
vi.clearAllMocks();
// Mock environment variables
vi.stubEnv('OPENAI_BASE_URL', '');
// Mock config
mockConfig = {
getContentGeneratorConfig: vi.fn().mockReturnValue({
@@ -55,7 +58,7 @@ describe('OpenAIContentGenerator Timeout Handling', () => {
vi.mocked(OpenAI).mockImplementation(() => mockOpenAIClient);
// Create generator instance
generator = new OpenAIContentGenerator('test-api-key', 'gpt-4', mockConfig);
generator = new OpenAIContentGenerator('test-key', 'gpt-4', mockConfig);
});
afterEach(() => {

View File

@@ -198,6 +198,7 @@ describe('Gemini Client (client.ts)', () => {
getQuotaErrorOccurred: vi.fn().mockReturnValue(false),
setQuotaErrorOccurred: vi.fn(),
getNoBrowser: vi.fn().mockReturnValue(false),
getSystemPromptMappings: vi.fn().mockReturnValue(undefined),
};
return mock as unknown as Config;
});