CodeGPT icon indicating copy to clipboard operation
CodeGPT copied to clipboard

Custom prompts get erased after each PyCharm update

Open jp26jp opened this issue 1 year ago β€’ 10 comments

What happened?

When PyCharm is updated, the custom prompts saved in the plugin get erased.

Steps to reproduce

This happens whenever PyCharm is updated to a newer version. This most recently happened in the update from PyCharm2024.1 to PyCharm2024.2

CodeGPT version

2.9.0-241.1

Operating System

macOS

jp26jp avatar Jul 19 '24 17:07 jp26jp

Thank you for reporting! I will take a look at it during the next iteration.

carlrobertoh avatar Jul 19 '24 17:07 carlrobertoh

Unfortunately, I'm unable to reproduce this issue. So far, I've tried manual updates to the plugin, as well as updating the IDE (PyCharm). The only reason for this to happen is when the configuration state could not be found, or the path changes, but this hasn't been changed since February.

I might need some additional information, such as on which specific update did it occur, and the contents of your settings which can be found here. For me, it would be accessible from /Users/carlrobertoh/Library/Application Support/JetBrains/IntelliJIdea2024.1/options/CodeGPT_ConfigurationSettings_210.xml

carlrobertoh avatar Jul 27 '24 09:07 carlrobertoh

This has happened around 4 or 5 times YTD. After looking at the configuration settings, it does seem to be related to Pycharm updates. The custom prompts associated with each version update are very different.

I'll add some insights to see if it helps, but if not, you can close this, and I'll comment if it happens again.

I found that I had 2 versions of Pycharm installed 2023.3 and 2024.1

The config settings of 2023.3 don't have any custom prompts. Is it possible that each .1.1 update of the 2024 pycharm was looking for the settings of 2023.3, not finding any configs, and creating the default prompts?

jp26jp avatar Jul 28 '24 20:07 jp26jp

After deleting version 2023.3, I closed and reopened PyCharm and all my custom prompts disappeared again.

jp26jp avatar Jul 28 '24 20:07 jp26jp

It happened again when updating to PyCharm2024.2. I checked CodeGPT_ConfigurationSettings_210.xml from PyCharm2024.1 and the config settings still exist in that folder so it should have been able to pull from there. The only settings it seemed to retain are: autocompletionContextAwareEnabled, autocompletionPostProcessingEnabled, and maxTokens but I could just have those on the defaults.

jp26jp avatar Aug 19 '24 11:08 jp26jp

Was the configuration file CodeGPT_ConfigurationSettings_210.xml copied over to the new PyCharm version options folder (e.g., /Users/admin/Library/Application Support/JetBrains/PyCharm2024.2/options)?

carlrobertoh avatar Aug 19 '24 12:08 carlrobertoh

The file exists, but the contents were not copied.

jp26jp avatar Aug 19 '24 12:08 jp26jp

Ok, I was finally able to reproduce the issue by downloading an older version of PyCharm and immediately updating it to a newer one. Weirdly, on the first attempt to open the IDE, the previous settings were retained until I restarted the IDE. It looks like it was using some cached values until it got restarted. Altho for me, the configuration file was never copied over. I assume you probably modified some values, which created a new .xml file because the default state got changed.

Regardless, I'm still not sure what is actually happening and why this specific cfg file is never copied over πŸ™„

carlrobertoh avatar Aug 19 '24 13:08 carlrobertoh

Hi, I have a similar problem. Every plugin update in PhpStorm deletes my CodeGPT_ConfigurationSettings_210.xml file in ~/.config/JetBrains/PhpStorm2024.2/options The last 3-4 updates have been happening like this. Yes, I also modify the values ​​in this file.

petrovo-as avatar Aug 21 '24 07:08 petrovo-as

Update 2.10.2-241.1 and it already works. The file is not deleted. Great. Thanks a lot. Petr

petrovo-as avatar Aug 24 '24 08:08 petrovo-as