mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-16 13:00:39 -07:00
fix(core): resolve 500 errors with gemini-3-flash-preview model
- Refactor default model configs to prevent Flash models from inheriting thinkingConfig - Add synthetic model turn to initial chat history to enforce alternating user/model roles required by gemini-3-flash-preview - Fix trailing newline assertion error in file-system integration test
This commit is contained in:
@@ -21,16 +21,23 @@ export const DEFAULT_MODEL_CONFIGS: ModelConfigServiceConfig = {
|
||||
},
|
||||
},
|
||||
},
|
||||
'chat-base': {
|
||||
'chat-base-no-thinking': {
|
||||
extends: 'base',
|
||||
modelConfig: {
|
||||
generateContentConfig: {
|
||||
temperature: 1,
|
||||
topP: 0.95,
|
||||
topK: 64,
|
||||
},
|
||||
},
|
||||
},
|
||||
'chat-base': {
|
||||
extends: 'chat-base-no-thinking',
|
||||
modelConfig: {
|
||||
generateContentConfig: {
|
||||
thinkingConfig: {
|
||||
includeThoughts: true,
|
||||
},
|
||||
temperature: 1,
|
||||
topP: 0.95,
|
||||
topK: 64,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -66,7 +73,7 @@ export const DEFAULT_MODEL_CONFIGS: ModelConfigServiceConfig = {
|
||||
},
|
||||
},
|
||||
'gemini-3-flash-preview': {
|
||||
extends: 'chat-base-3',
|
||||
extends: 'chat-base-no-thinking',
|
||||
modelConfig: {
|
||||
model: 'gemini-3-flash-preview',
|
||||
},
|
||||
@@ -78,13 +85,13 @@ export const DEFAULT_MODEL_CONFIGS: ModelConfigServiceConfig = {
|
||||
},
|
||||
},
|
||||
'gemini-2.5-flash': {
|
||||
extends: 'chat-base-2.5',
|
||||
extends: 'chat-base-no-thinking',
|
||||
modelConfig: {
|
||||
model: 'gemini-2.5-flash',
|
||||
},
|
||||
},
|
||||
'gemini-2.5-flash-lite': {
|
||||
extends: 'chat-base-2.5',
|
||||
extends: 'chat-base-no-thinking',
|
||||
modelConfig: {
|
||||
model: 'gemini-2.5-flash-lite',
|
||||
},
|
||||
|
||||
@@ -96,6 +96,10 @@ export async function getInitialChatHistory(
|
||||
role: 'user',
|
||||
parts: [{ text: envContextString }],
|
||||
},
|
||||
{
|
||||
role: 'model',
|
||||
parts: [{ text: 'Understood. I am ready.' }],
|
||||
},
|
||||
...(extraHistory ?? []),
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user