opencommit icon indicating copy to clipboard operation
opencommit copied to clipboard

[Bug]: cannot set OCO_OPENAI_API_KEY with length different from 51 characters

Open bureyburey opened this issue 1 year ago • 3 comments

Opencommit Version

3.0.4

Node Version

16.18.0

NPM Version

8.9.2

What OS are you seeing the problem on?

Mac

What happened?

A bug happened!

I am unable to set an OpenAI API key with length different than 51 characters due to the validation that checks it. I am using a key which is 65 characters long.

Expected Behavior

Allow setting OpenAI API key with length different from 51 characters.

Current Behavior

The validation prevents setting/using OpenAI API key with length different from 51 characters.

image

Possible Solution

I've tested it by manually changing the validation rule to accept key that is equal or longer than 51 characters and the OpenAI API did not reject it.

Steps to Reproduce

No response

Relevant log output

No response

bureyburey avatar Dec 27 '23 08:12 bureyburey

Stale issue message

github-actions[bot] avatar Feb 05 '24 21:02 github-actions[bot]

reopening, will take a look at this

di-sukharev avatar Feb 28 '24 06:02 di-sukharev

Experiencing the same issue here, not sure if my OpenAI api key is not valid for a specific reason, I have a free account at the moment:

$ oco config set OCO_OPENAI_API_KEY="sk-proj-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
┌  opencommit — config
│
└  ✖ Unsupported config key OCO_OPENAI_API_KEY: Must be 51 characters long

If there's a workaround for this, I'd be happy to apply it

alberhander avatar Apr 23 '24 09:04 alberhander