From c92d4edb8956e9040abf55060d90e52a1572f435 Mon Sep 17 00:00:00 2001 From: Taylor Mullen Date: Mon, 26 May 2025 14:33:35 -0700 Subject: [PATCH] Fix(chat): Ensure model responds when next speaker check indicates - Corrects an issue where the `nextSpeakerCheck` would determine the model should speak next, but the models response was not properly propagated due to a missing `yield*` in a recursive call within `sendMessageStream`. - This change ensures that when the model is designated as the next speaker, its generated content is correctly unwoven and returned, allowing the conversation to proceed as expected. Part of https://github.com/google-gemini/gemini-cli/issues/551 --- packages/server/src/core/client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/core/client.ts b/packages/server/src/core/client.ts index 3d5927e3..8823012e 100644 --- a/packages/server/src/core/client.ts +++ b/packages/server/src/core/client.ts @@ -170,7 +170,7 @@ export class GeminiClient { const nextSpeakerCheck = await checkNextSpeaker(chat, this); if (nextSpeakerCheck?.next_speaker === 'model') { const nextRequest = [{ text: 'Please continue.' }]; - return this.sendMessageStream(chat, nextRequest, signal, turns - 1); + yield* this.sendMessageStream(chat, nextRequest, signal, turns - 1); } } }