mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-20 19:11:23 -07:00
fix(core): Prepend user message to loop detection history if it starts with a function call (#11860)
This commit is contained in:
@@ -404,6 +404,12 @@ export class LoopDetectionService {
|
||||
...trimmedHistory,
|
||||
{ role: 'user', parts: [{ text: taskPrompt }] },
|
||||
];
|
||||
if (contents.length > 0 && isFunctionCall(contents[0])) {
|
||||
contents.unshift({
|
||||
role: 'user',
|
||||
parts: [{ text: 'Recent conversation history:' }],
|
||||
});
|
||||
}
|
||||
const schema: Record<string, unknown> = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
|
||||
Reference in New Issue
Block a user