fix: initial prompt not filled in after accepting new recipe (#3637)

This commit is contained in:
Zane
2025-07-31 10:49:28 -07:00
committed by GitHub
parent f1907abacb
commit b5e73c4c89
5 changed files with 40 additions and 27 deletions
+6 -8
View File
@@ -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