summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/hooks/useGeminiStream.ts
diff options
context:
space:
mode:
authorNeha Prasad <[email protected]>2025-07-28 23:27:33 +0530
committerGitHub <[email protected]>2025-07-28 17:57:33 +0000
commita5ea113a8e485f42cc1136b6c57e337cbf369c57 (patch)
treee1015846c86929c57577ccd2b6060f2624e666b0 /packages/cli/src/ui/hooks/useGeminiStream.ts
parent379765da238ec113801648999be392cda5f690b8 (diff)
fix: Clear previous thoughts when starting new prompts (#4966)
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);