fixed recipe schedule jobs (#3880)
This commit is contained in:
@@ -143,7 +143,7 @@ function BaseChatContent({
|
||||
chatState,
|
||||
error,
|
||||
setMessages,
|
||||
input: _input,
|
||||
input,
|
||||
setInput: _setInput,
|
||||
handleSubmit: engineHandleSubmit,
|
||||
onStopGoose,
|
||||
@@ -231,7 +231,9 @@ function BaseChatContent({
|
||||
useEffect(() => {
|
||||
const isProcessingResponse =
|
||||
chatState !== ChatState.Idle && chatState !== ChatState.WaitingForUserInput;
|
||||
handleAutoExecution(append, isProcessingResponse);
|
||||
handleAutoExecution(append, isProcessingResponse, () => {
|
||||
setHasStartedUsingRecipe(true);
|
||||
});
|
||||
}, [handleAutoExecution, append, chatState]);
|
||||
|
||||
// Use shared session continuation
|
||||
@@ -528,7 +530,7 @@ function BaseChatContent({
|
||||
chatState={chatState}
|
||||
onStop={onStopGoose}
|
||||
commandHistory={commandHistory}
|
||||
initialValue={_input || ''}
|
||||
initialValue={input || ''}
|
||||
setView={setView}
|
||||
numTokens={sessionTokenCount}
|
||||
inputTokens={sessionInputTokens || localInputTokens}
|
||||
|
||||
@@ -129,7 +129,7 @@ export const useRecipeManager = (messages: Message[], locationState?: LocationSt
|
||||
|
||||
// Get the recipe's initial prompt (always return the actual prompt, don't modify based on conversation state)
|
||||
const initialPrompt = useMemo(() => {
|
||||
if (!recipeConfig?.prompt || !recipeAccepted) {
|
||||
if (!recipeConfig?.prompt || !recipeAccepted || recipeConfig?.isScheduledExecution) {
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -184,7 +184,11 @@ export const useRecipeManager = (messages: Message[], locationState?: LocationSt
|
||||
};
|
||||
|
||||
// Auto-execution handler for scheduled recipes
|
||||
const handleAutoExecution = (append: (message: Message) => void, isLoading: boolean) => {
|
||||
const handleAutoExecution = (
|
||||
append: (message: Message) => void,
|
||||
isLoading: boolean,
|
||||
onAutoExecute?: () => void
|
||||
) => {
|
||||
const hasRequiredParams = recipeConfig?.parameters && recipeConfig.parameters.length > 0;
|
||||
|
||||
if (
|
||||
@@ -205,6 +209,7 @@ export const useRecipeManager = (messages: Message[], locationState?: LocationSt
|
||||
|
||||
const userMessage = createUserMessage(finalPrompt);
|
||||
append(userMessage);
|
||||
onAutoExecute?.();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user