summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/hooks/useGeminiStream.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/cli/src/ui/hooks/useGeminiStream.ts')
-rw-r--r--packages/cli/src/ui/hooks/useGeminiStream.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/cli/src/ui/hooks/useGeminiStream.ts b/packages/cli/src/ui/hooks/useGeminiStream.ts
index 456c0fb7..c934a139 100644
--- a/packages/cli/src/ui/hooks/useGeminiStream.ts
+++ b/packages/cli/src/ui/hooks/useGeminiStream.ts
@@ -414,8 +414,9 @@ export const useGeminiStream = (
userMessageTimestamp,
);
setIsResponding(false);
+ setThought(null); // Reset thought when user cancels
},
- [addItem, pendingHistoryItemRef, setPendingHistoryItem],
+ [addItem, pendingHistoryItemRef, setPendingHistoryItem, setThought],
);
const handleErrorEvent = useCallback(
@@ -437,8 +438,9 @@ export const useGeminiStream = (
},
userMessageTimestamp,
);
+ setThought(null); // Reset thought when there's an error
},
- [addItem, pendingHistoryItemRef, setPendingHistoryItem, config],
+ [addItem, pendingHistoryItemRef, setPendingHistoryItem, config, setThought],
);
const handleFinishedEvent = useCallback(
@@ -637,6 +639,7 @@ export const useGeminiStream = (
if (!options?.isContinuation) {
startNewPrompt();
+ setThought(null); // Reset thought when starting a new prompt
}
setIsResponding(true);