summaryrefslogtreecommitdiff
path: root/packages/cli/src
diff options
context:
space:
mode:
authorTaylor Mullen <[email protected]>2025-04-22 09:07:19 -0400
committerN. Taylor Mullen <[email protected]>2025-04-22 10:33:36 -0400
commit3db2a796ec7c3aeba731da7b0f99e41c5c103d2b (patch)
tree799c74702538e3e774977ea8db5ac56dff5cfcb6 /packages/cli/src
parent5c5c4706712840c37123ce383d69036d96a43350 (diff)
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
Diffstat (limited to 'packages/cli/src')
-rw-r--r--packages/cli/src/ui/hooks/useGeminiStream.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/cli/src/ui/hooks/useGeminiStream.ts b/packages/cli/src/ui/hooks/useGeminiStream.ts
index 5baebe09..b8d13269 100644
--- a/packages/cli/src/ui/hooks/useGeminiStream.ts
+++ b/packages/cli/src/ui/hooks/useGeminiStream.ts
@@ -217,6 +217,11 @@ export const useGeminiStream = (
// For content events, accumulate the text and update an existing message or create a new one
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) {
// Create a new Gemini message if this is the first content event
hasInitialGeminiResponse = true;