mirror of
https://github.com/aljazceru/goose.git
synced 2026-02-23 07:24:24 +01:00
hotfix: don't always run prompt (#2773)
Co-authored-by: Lifei Zhou <lifei@squareup.com>
This commit is contained in:
@@ -82,7 +82,6 @@ export default function ChatView({
|
||||
}
|
||||
|
||||
function ChatContent({
|
||||
readyForAutoUserPrompt,
|
||||
chat,
|
||||
setChat,
|
||||
setView,
|
||||
@@ -103,7 +102,6 @@ function ChatContent({
|
||||
const [droppedFiles, setDroppedFiles] = useState<string[]>([]);
|
||||
|
||||
const scrollRef = useRef<ScrollAreaHandle>(null);
|
||||
const hasSentPromptRef = useRef(false);
|
||||
|
||||
const {
|
||||
summaryContent,
|
||||
@@ -291,13 +289,10 @@ function ChatContent({
|
||||
}
|
||||
}, [messages]);
|
||||
|
||||
useEffect(() => {
|
||||
const prompt = recipeConfig?.prompt;
|
||||
if (prompt && !hasSentPromptRef.current && readyForAutoUserPrompt) {
|
||||
append(prompt);
|
||||
hasSentPromptRef.current = true;
|
||||
}
|
||||
}, [recipeConfig?.prompt, append, readyForAutoUserPrompt]);
|
||||
// Pre-fill input with recipe prompt instead of auto-sending it
|
||||
const initialPrompt = useMemo(() => {
|
||||
return recipeConfig?.prompt || '';
|
||||
}, [recipeConfig?.prompt]);
|
||||
|
||||
// Handle submit
|
||||
const handleSubmit = (e: React.FormEvent) => {
|
||||
@@ -632,7 +627,7 @@ function ChatContent({
|
||||
isLoading={isLoading}
|
||||
onStop={onStopGoose}
|
||||
commandHistory={commandHistory}
|
||||
initialValue={_input}
|
||||
initialValue={_input || initialPrompt}
|
||||
setView={setView}
|
||||
hasMessages={hasMessages}
|
||||
numTokens={sessionTokenCount}
|
||||
|
||||
Reference in New Issue
Block a user