ai-genie / chatgpt-vscode

Your best AI pair programmer in VS Code
https://marketplace.visualstudio.com/items?itemName=genieai.chatgpt-vscode
ISC License
1.19k stars 73 forks source link

secrets storage locked and password promt #12

Open drlwang opened 1 year ago

drlwang commented 1 year ago

Verify it's not a duplicate bug report

Describe the Bug

vs cde version: 1.74.2 OS: Red Hat Enterprise Linux 8.7 in VMware hyper enviroment GNOME Version 3.32.2 user do not have root premission

step to reproduce:

  1. after promoting the dialog "Please add your API key to use openAI official APIs..."
  2. insert the API Key in "Store openAI API key in VS code Secrets Storage", and enter
  3. dialog pops "Enter password to unlock" -> can not change the default keyring

Please tell us if you have customized any of the extension settings or whether you are using the defaults.

it is not relavent to the GPT model and I am using the empty settings.json

Additional context

Unbenannt

genieai-info commented 1 year ago

Searching online didn't give any useful results but it looks like VS Code requires permission to access secret storage for the extension to store the api keys. Which is required for extension to work. And I assume the secret storage is behind Default keyring in your OS, for which the user doesn't have permission to write.

drlwang commented 1 year ago

thanks a lot for the investigation, I totally agree with your comment and I think this is likely the reason of the problem. I was checking the Default keyring and also the location of the secret storage from the VS code website, but no exact place or folder was given. Since I was making a user installation of the VS code under my own home folder in Linux enviroment, it is a bit weird that there is no permission given. I do understand that this may have small link from your software. But I hope there will be some work around method. Thanks in advance!

buffalmacco commented 1 year ago

I found out it's configurable, it depends on VS Code ability to detect OS keyring. See: https://stackoverflow.com/questions/76044882/chatgpt-api-key-not-working-in-visual-studio-code/76731061#76731061

The explanation on how to configure VS Code is here:

https://code.visualstudio.com/docs/editor/settings-sync#_troubleshooting-keychain-issues