Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] : Bug in Custom prompt initalization mechanism #381

Open
samkerr4coding opened this issue Dec 12, 2024 · 4 comments
Open

[Bug] : Bug in Custom prompt initalization mechanism #381

samkerr4coding opened this issue Dec 12, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@samkerr4coding
Copy link
Contributor

samkerr4coding commented Dec 12, 2024

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
image
and we cannot see the newly added FIND command method.

@stephanj do you confirm?

@samkerr4coding samkerr4coding changed the title Bug in Custom prompt initalization mechanism [Bug] : Bug in Custom prompt initalization mechanism Dec 12, 2024
@stephanj
Copy link
Contributor

Indeed, however the /find should only be shown when RAG is activated.
Will you investigate further or should I?

@stephanj stephanj added the bug Something isn't working label Dec 12, 2024
@samkerr4coding
Copy link
Contributor Author

I'm currently looking into the issue i'll keep you in touch as soon as possible

@samkerr4coding
Copy link
Contributor Author

samkerr4coding commented Dec 13, 2024

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)

@stephanj
Copy link
Contributor

Sounds like a plan, thanks for the update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants