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

aicommits uses first the envVar instead of the env in .aicommits file #244

Open
1 task
kud opened this issue Aug 29, 2023 · 1 comment
Open
1 task

aicommits uses first the envVar instead of the env in .aicommits file #244

kud opened this issue Aug 29, 2023 · 1 comment
Labels
bug Something isn't working pending triage

Comments

@kud
Copy link

kud commented Aug 29, 2023

Bug description

Imagine you've already defined an envVar called OPENAI_KEY, it will use it instead of the one defined in .aicommits. It's confusing. I would like to use the one in .aicommits.

aicommits version

1.11.0

Environment

OS: macOS 13.5
Shell: zsh 5.9 (arm-apple-darwin21.3.0)
node: v20.5.1

Can you contribute a fix?

  • I’m interested in opening a pull request for this issue.
@kud kud added bug Something isn't working pending triage labels Aug 29, 2023
@ajoliveau
Copy link

I can add some more information, I kept getting a reponse like this :

{
    "error": {
        "message": "Incorrect API key provided: sk-dEQi4***************************************uraT. You can find your API key at https://platform.openai.com/account/api-keys.",
        "type": "invalid_request_error",
        "param": null,
        "code": "invalid_api_key"
    }
}

But the key I had in ~/.aicommits wasn't starting with DEQi, it was an entirely different key.
After runnning printenv | grep OPEN I found that I had no env var named "OPENAI_KEY" but I had an OPENAI_API_KEY, and this was what was picked up by aicommits instead of the correct OPENAI_KEY

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

No branches or pull requests

2 participants