[Bug] : Bug in Custom prompt initalization mechanism
It seems that the method :
private void initializeDefaultPrompts() {
if (customPrompts.isEmpty()) {
customPrompts.add(new CustomPrompt(TEST_COMMAND, TEST_PROMPT));
customPrompts.add(new CustomPrompt(EXPLAIN_COMMAND, EXPLAIN_PROMPT));
customPrompts.add(new CustomPrompt(REVIEW_COMMAND, REVIEW_PROMPT));
customPrompts.add(new CustomPrompt(FIND_COMMAND, FIND_PROMPT));
customPrompts.add(new CustomPrompt(TDG_COMMAND, TDG_PROMPT));
}
}
is called twice at the initlization of the ToolWindowcontent the first time with the Constructor
public DevoxxGenieStateService()
the second time by the loadstate method
public void loadState(@NotNull DevoxxGenieStateService state).
The second pass the customPrompt list is coming with only 4 values (dont know why at this point)
The bug can be observed directly in the welcome message where command prompt are dynamically added
and we cannot see the newly added FIND command method.
@stephanj do you confirm?
Indeed, however the /find should only be shown when RAG is activated. Will you investigate further or should I?
I'm currently looking into the issue i'll keep you in touch as soon as possible
Hello @stephanj some feedbacks on this topic it seems that the behavior i did observe was coming from my "deprecated" DevoxxGenieSettingsPlugin.xml file. Default prompt initlization from last version of code (with find command) was dumped by the xml state loaded from the persisted xml file.
I do not have solution at this point as i consider that this file can represent modification done by the user so i assume the user want to reload systematically his custom prompts even after an update of the plugin in IDEA.
However i'm working on a branch where with the following features :
- A new "Restore default prompt" button in the prompt settings Panel so user can restore an up to date list of default prompts
- A set of modifications related to issue-196 to avoid interpretation of words starting by / (for this point i will ask you to review my modifs as it is related to the SYSTEM_PROMPT string used to configure the llm)
Sounds like a plan, thanks for the update.