summaryrefslogtreecommitdiff
path: root/packages/cli/src
diff options
context:
space:
mode:
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);