Fix Default Model Configuration and Fallback Behavior (#142)

* rename the default model to 'qwen3-coder-plus'

* fix: use DEFAULT_GEMINI_MODEL fallback when OPENAI_MODEL is unset

* fix: npm run format
This commit is contained in:
tanzhenxin
2025-07-30 16:27:28 +08:00
committed by GitHub
parent bd0d3479c1
commit 8e3b413fdd
3 changed files with 5 additions and 3 deletions

View File

@@ -4,6 +4,6 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
export const DEFAULT_GEMINI_MODEL = 'qwen3-coder-max'; export const DEFAULT_GEMINI_MODEL = 'qwen3-coder-plus';
export const DEFAULT_GEMINI_FLASH_MODEL = 'gemini-2.5-flash'; export const DEFAULT_GEMINI_FLASH_MODEL = 'gemini-2.5-flash';
export const DEFAULT_GEMINI_EMBEDDING_MODEL = 'gemini-embedding-001'; export const DEFAULT_GEMINI_EMBEDDING_MODEL = 'gemini-embedding-001';

View File

@@ -116,7 +116,8 @@ export async function createContentGeneratorConfig(
if (authType === AuthType.USE_OPENAI && openaiApiKey) { if (authType === AuthType.USE_OPENAI && openaiApiKey) {
contentGeneratorConfig.apiKey = openaiApiKey; contentGeneratorConfig.apiKey = openaiApiKey;
contentGeneratorConfig.model = process.env.OPENAI_MODEL || ''; contentGeneratorConfig.model =
process.env.OPENAI_MODEL || DEFAULT_GEMINI_MODEL;
return contentGeneratorConfig; return contentGeneratorConfig;
} }

View File

@@ -17,6 +17,7 @@ import { WriteFileTool } from '../tools/write-file.js';
import process from 'node:process'; import process from 'node:process';
import { isGitRepository } from '../utils/gitUtils.js'; import { isGitRepository } from '../utils/gitUtils.js';
import { MemoryTool, GEMINI_CONFIG_DIR } from '../tools/memoryTool.js'; import { MemoryTool, GEMINI_CONFIG_DIR } from '../tools/memoryTool.js';
import { DEFAULT_GEMINI_MODEL } from '../config/models.js';
export interface ModelTemplateMapping { export interface ModelTemplateMapping {
baseUrls?: string[]; baseUrls?: string[];
@@ -65,7 +66,7 @@ export function getCoreSystemPrompt(
// Check for system prompt mappings from global config // Check for system prompt mappings from global config
if (config?.systemPromptMappings) { if (config?.systemPromptMappings) {
const currentModel = process.env.OPENAI_MODEL || ''; const currentModel = process.env.OPENAI_MODEL || DEFAULT_GEMINI_MODEL;
const currentBaseUrl = process.env.OPENAI_BASE_URL || ''; const currentBaseUrl = process.env.OPENAI_BASE_URL || '';
const matchedMapping = config.systemPromptMappings.find((mapping) => { const matchedMapping = config.systemPromptMappings.find((mapping) => {