mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 20:50:34 +00:00
fix: Clear previous thoughts when starting new prompts (#4966)
This commit is contained in:
parent
f1f0da6dc9
commit
4b3e407d49
2 changed files with 200 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue