mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
Eliminate createServerConfig() (#821)
This commit is contained in:
committed by
GitHub
parent
10b52ac4e8
commit
d6cf4d5b0b
@@ -34,7 +34,7 @@ vi.mock('@gemini-code/core', async () => {
|
||||
return {
|
||||
...actualServer,
|
||||
loadEnvironment: vi.fn(),
|
||||
createServerConfig: vi.fn((params) => ({
|
||||
Config: vi.fn((params) => ({
|
||||
// Mock the config object and its methods
|
||||
getApiKey: () => params.apiKey,
|
||||
getModel: () => params.model,
|
||||
|
||||
@@ -10,9 +10,7 @@ import process from 'node:process';
|
||||
import {
|
||||
Config,
|
||||
loadEnvironment,
|
||||
createServerConfig,
|
||||
loadServerHierarchicalMemory,
|
||||
ConfigParameters,
|
||||
setGeminiMdFilename as setServerGeminiMdFilename,
|
||||
getCurrentGeminiMdFilename,
|
||||
ApprovalMode,
|
||||
@@ -175,7 +173,7 @@ export async function loadCliConfig(
|
||||
modelToUse = await getEffectiveModel(apiKeyForServer, modelToUse);
|
||||
}
|
||||
|
||||
const configParams: ConfigParameters = {
|
||||
return new Config({
|
||||
apiKey: apiKeyForServer,
|
||||
model: modelToUse,
|
||||
embeddingModel: DEFAULT_GEMINI_EMBEDDING_MODEL,
|
||||
@@ -206,7 +204,5 @@ export async function loadCliConfig(
|
||||
fileFilteringRespectGitIgnore: settings.fileFiltering?.respectGitIgnore,
|
||||
fileFilteringAllowBuildArtifacts:
|
||||
settings.fileFiltering?.allowBuildArtifacts,
|
||||
};
|
||||
|
||||
return createServerConfig(configParams);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user