summaryrefslogtreecommitdiff
path: root/packages/cli/src
diff options
context:
space:
mode:
authorTaylor Mullen <[email protected]>2025-05-10 00:24:33 -0700
committerN. Taylor Mullen <[email protected]>2025-05-10 00:26:18 -0700
commitc0eab31c023e16de55302d06013a2abfb7f7aca9 (patch)
treef769ce0c9b9195a1e76121d945dc8c7bff67589a /packages/cli/src
parent6b518dc9e4c601c0108768932dc1450c036075fd (diff)
Show model decline/cancellation states.
- Upon decline / cancellation we weren't showing the model the cancellation status or states. Therefore it didn't know why things would or wouldn't happen Fixes https://b.corp.google.com/issues/416797704
Diffstat (limited to 'packages/cli/src')
-rw-r--r--packages/cli/src/ui/hooks/useGeminiStream.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/cli/src/ui/hooks/useGeminiStream.ts b/packages/cli/src/ui/hooks/useGeminiStream.ts
index e86ae0b9..dbcb4e64 100644
--- a/packages/cli/src/ui/hooks/useGeminiStream.ts
+++ b/packages/cli/src/ui/hooks/useGeminiStream.ts
@@ -509,6 +509,15 @@ export const useGeminiStream = (
error: new Error(declineMessage),
};
+ // Update conversation history without re-issuing another request to indicate the decline.
+ const history = chatSessionRef.current?.getHistory();
+ if (history) {
+ history.push({
+ role: 'model',
+ parts: [functionResponse],
+ });
+ }
+
// Update UI to show cancellation/error
updateFunctionResponseUI(responseInfo, status);
setStreamingState(StreamingState.Idle);