File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed
Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,12 @@ export async function loadServerConfig(
9393
9494 const sandboxConfig = await loadSandboxConfig ( settings , { } ) ;
9595
96+ // Prioritize GEMINI_TOOLS_DEFAULT_MODEL, then GEMINI_MODEL, then the hardcoded default.
97+ const model =
98+ process . env . GEMINI_TOOLS_DEFAULT_MODEL ||
99+ process . env . GEMINI_MODEL ||
100+ DEFAULT_GEMINI_MODEL ;
101+
96102 return new Config ( {
97103 sessionId,
98104 embeddingModel : DEFAULT_GEMINI_EMBEDDING_MODEL ,
@@ -136,7 +142,7 @@ export async function loadServerConfig(
136142 cwd : process . cwd ( ) ,
137143 fileDiscoveryService : fileService ,
138144 bugCommand : settings . bugCommand ,
139- model : process . env . GEMINI_MODEL || DEFAULT_GEMINI_MODEL ,
145+ model : model ,
140146 extensionContextFilePaths,
141147 } ) ;
142148}
Original file line number Diff line number Diff line change @@ -97,15 +97,8 @@ async function startMcpServer() {
9797 console . log ( `Using authentication method: ${ selectedAuthType } ` ) ;
9898 }
9999
100- // Check for the custom tools model environment variable
101- const toolsDefaultModel = process . env . GEMINI_TOOLS_DEFAULT_MODEL ;
102- if ( toolsDefaultModel && toolsDefaultModel . trim ( ) !== '' ) {
103- config . setModel ( toolsDefaultModel . trim ( ) ) ;
104- console . log ( `🚀 Using custom model for tools: ${ toolsDefaultModel . trim ( ) } ` ) ;
105- } else {
106- // Log the default model being used if the environment variable is not set
107- console . log ( `⚙️ Using default model for tools: ${ config . getModel ( ) } ` ) ;
108- }
100+ // Log the model being used for tools. This is now set in loadServerConfig.
101+ console . log ( `⚙️ Using model for tools: ${ config . getModel ( ) } ` ) ;
109102
110103 // 4. 初始化并启动 MCP 桥接服务 和 OpenAI 服务
111104 const mcpBridge = new GcliMcpBridge ( config , cliVersion , debugMode ) ;
You can’t perform that action at this time.
0 commit comments