Fix Tool -> Text -> Confirmation bu that results in disordered history
- We weren't reseting the tool group inbetween content which meant we'd start a new group on the first tool call, and if regular textual content followed it'd effectively close that group; however, we weren't updating our state to really close that group. Meaning, any subsequent tool calls or confirmations would get grouped with the original grouping. - When we see textual content from Gemini we now reset the tool call group. Fixes https://b.corp.google.com/issues/412605330
This commit is contained in:
parent
5c5c470671
commit
3db2a796ec
|
@ -217,6 +217,11 @@ export const useGeminiStream = (
|
||||||
// For content events, accumulate the text and update an existing message or create a new one
|
// For content events, accumulate the text and update an existing message or create a new one
|
||||||
currentGeminiText += event.value;
|
currentGeminiText += event.value;
|
||||||
|
|
||||||
|
// Reset group because we're now adding a user message to the history. If we didn't reset the
|
||||||
|
// group here then any subsequent tool calls would get grouped before this message resulting in
|
||||||
|
// a misordering of history.
|
||||||
|
currentToolGroupId = null;
|
||||||
|
|
||||||
if (!hasInitialGeminiResponse) {
|
if (!hasInitialGeminiResponse) {
|
||||||
// Create a new Gemini message if this is the first content event
|
// Create a new Gemini message if this is the first content event
|
||||||
hasInitialGeminiResponse = true;
|
hasInitialGeminiResponse = true;
|
||||||
|
|
Loading…
Reference in New Issue