fix: initial prompt not filled in after accepting new recipe (#3637)
This commit is contained in:
@@ -129,7 +129,9 @@ 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) return '';
|
||||
if (!recipeConfig?.prompt || !recipeAccepted) {
|
||||
return '';
|
||||
}
|
||||
|
||||
const hasRequiredParams = recipeConfig.parameters && recipeConfig.parameters.length > 0;
|
||||
|
||||
@@ -138,13 +140,9 @@ export const useRecipeManager = (messages: Message[], locationState?: LocationSt
|
||||
return substituteParameters(recipeConfig.prompt, recipeParameters);
|
||||
}
|
||||
|
||||
// If there are no parameters, return the original prompt.
|
||||
if (!hasRequiredParams) {
|
||||
return recipeConfig.prompt;
|
||||
}
|
||||
|
||||
// Otherwise, we are waiting for parameters, so the input should be empty.
|
||||
return '';
|
||||
// Always return the original prompt, whether it has parameters or not
|
||||
// The user should see the prompt with parameter placeholders before filling them in
|
||||
return recipeConfig.prompt;
|
||||
}, [recipeConfig, recipeParameters, recipeAccepted]);
|
||||
|
||||
// Handle parameter submission
|
||||
|
||||
Reference in New Issue
Block a user