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]: 'OCO_AI_PROVIDER' name is invalid #429

Closed
mauvehed opened this issue Nov 9, 2024 · 7 comments
Closed

[Bug]: 'OCO_AI_PROVIDER' name is invalid #429

mauvehed opened this issue Nov 9, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@mauvehed
Copy link

mauvehed commented Nov 9, 2024

Opencommit Version

3.2.2

Node Version

21.7.3

NPM Version

10.5.0

What OS are you seeing the problem on?

Other Linux Distro

What happened?

Running oco produces the following error:

'OCO_AI_PROVIDER' name is invalid, it should be either 'OCO_OCO_AI_PROVIDER' or it doesn't exist.

Expected Behavior

That oco would execute as normal.

Current Behavior

It's producing the following error:

'OCO_AI_PROVIDER' name is invalid, it should be either 'OCO_OCO_AI_PROVIDER' or it doesn't exist.

Possible Solution

No response

Steps to Reproduce

No response

Relevant log output

│
└  'OCO_AI_PROVIDER' name is invalid, it should be either 'OCO_OCO_AI_PROVIDER' or it doesn't exist.


└  Manually fix the '.env' file or global '~/.opencommit' config file.
@mauvehed mauvehed added the bug Something isn't working label Nov 9, 2024
@mauvehed
Copy link
Author

I am so baffled by this. I'd guess it's adding the extra OCO_ because it's not finding a specific variable, and so it just prefixes that missing variable with the OCO_.

@di-sukharev
Copy link
Owner

@mauvehed

did you set oco config set OCO_AI_PROVIDER=anthropic or oco config set OCO_AI_PROVIDER=openai and then oco config set OCO_API_KEY=<your_provider_key>?

@di-sukharev
Copy link
Owner

hope it helps, but the error is wrong, i will be fixing the error message later this week, no time now. you could prepare a PR if you find the bug and want to help fix it

@mauvehed
Copy link
Author

mauvehed commented Nov 11, 2024

@mauvehed

did you set oco config set OCO_AI_PROVIDER=anthropic or oco config set OCO_AI_PROVIDER=openai and then oco config set OCO_API_KEY=<your_provider_key>?

I manage my config manually. I don't ever run the "oco config set". I maintain all my dotfiles via central management so I just update directly. That shouldn't cause problems, right?

And because I'm an idiot and forgot to share it, here is my config

OCO_AI_PROVIDER=openai
OCO_API_KEY=<REDACTED>
OCO_OPENAI_MAX_TOKENS=3000
OCO_DESCRIPTION=true
OCO_EMOJI=undefined
OCO_MODEL=gpt-4o
OCO_LANGUAGE=en
OCO_MESSAGE_TEMPLATE_PLACEHOLDER=$msg
OCO_PROMPT_MODULE=conventional-commit
OCO_WHY=true
OCO_GITPUSH=false

@mauvehed
Copy link
Author

So, opencommit works. But oco is what fails.

@di-sukharev
Copy link
Owner

could you do node -v? i think you have opencommit installed globally, if so you have it in global node/v20/node_modules or node/v22/node_modules or your version. so make sure you have 3.2.2 version of opencommit in the node_modules of the node version you are currently using. lmk the output

@di-sukharev
Copy link
Owner

@mauvehed

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