opencommit icon indicating copy to clipboard operation
opencommit copied to clipboard

[Bug]: Unsupported config key `OCO_MODEL` error when using `oco` command

Open watagori opened this issue 11 months ago • 13 comments

Opencommit Version

v1.0.2 / latest

Node Version

18.17.0

NPM Version

10.5.0

What OS are you seeing the problem on?

Mac

What happened?

Unsupported config key OCO_MODEL error when using oco command

Description

When trying to use the oco command in my terminal, I encountered an error message stating that the config key OCO_MODEL is unsupported. The error persists even when I try to set the OCO_MODEL to one of the suggested values.

Steps to Reproduce

  1. Open the terminal

  2. Run oco --version

  3. Observe the following error message:

     oco --version
    │
    └ ✖ Unsupported config key OCO_MODEL: gpt-3.5-turbo-16k is not supported yet, use 'gpt-4', 'gpt-3.5-turbo' (default), 'gpt-3.5-turbo-0125', 'gpt-4-1106-preview', 'gpt-4-turbo-preview' or 'gpt-4-0125-preview'
    
  4. Attempt to set the OCO_MODEL using oco config set OCO_MODEL=gpt-4-turbo-preview

    oco config set OCO_MODEL=gpt-4-turbo-preview
    │
    └  ✖ Unsupported config key OCO_MODEL: gpt-3.5-turbo-16k is not supported yet, use 'gpt-4', 'gpt-3.5-turbo' (default), 'gpt-3.5-turbo-0125', 'gpt-4-1106-preview', 'gpt-4-turbo-preview' or 'gpt-4-0125-preview'
    

Environment

  • Operating System: macOS
  • Shell: zsh

Expected Behavior

I expected the oco command to work without any errors, and the OCO_MODEL configuration to be set successfully when using one of the suggested values.

Current Behavior

The oco command consistently throws an error message about the unsupported OCO_MODEL config key, even when attempting to set it to one of the suggested values.

Possible Solution

No response

Steps to Reproduce

No response

Relevant log output

No response

watagori avatar Mar 18 '24 13:03 watagori

Same bug here

br-programmer avatar Mar 18 '24 14:03 br-programmer

I was able to solve it by opening the .opencommit file that is usually created in your user root directory. I opened it with VS Code and manually changed the model. Then I saved it, and it worked perfectly for me. The model I used was gpt-3.5-turbo; previously, I had gpt-3.5-turbo-16k.

br-programmer avatar Mar 18 '24 14:03 br-programmer

@br-programmer Thanks! I opened the .opencommit and switched the OCO_MODEL manually and it worked.

watagori avatar Mar 18 '24 14:03 watagori

Share the environment when it works.

node -v
v18.17.0
npm -v
10.5.0
oco --version
3.0.12

watagori avatar Mar 18 '24 14:03 watagori

Not sure what caused this and if there is a solution other than manual editing.

watagori avatar Mar 20 '24 12:03 watagori

lets keep this opened please, this is not an expected behaviour @watagori you experienced this on version v1.0.2?

di-sukharev avatar Mar 20 '24 14:03 di-sukharev

Experienced the exact same issue. I was unable to execute any command, including getting the version, until the .opencommit file was manually edited.

oco --version
3.0.12
node -v
v20.11.1
npm -v
10.2.4

seanmccabe avatar Mar 20 '24 19:03 seanmccabe

i experienced the same issue once i updated the opencommit to the last version

oco --version
3.0.12
node -v
v20.11.0
npm -v
10.2.4

also tried this command but it doesnt work

oco config set OCO_MODEL=gpt-3.5-turbo
│
└  ✖ Unsupported config key OCO_MODEL: gpt-3.5-turbo-16k is not supported yet, use 'gpt-4', 'gpt-3.5-turbo' (default), 'gpt-3.5-turbo-0125', 'gpt-4-1106-preview', 'gpt-4-turbo-preview' or 'gpt-4-0125-preview'

Edited manually and it works

WMOH-DEV avatar Mar 25 '24 11:03 WMOH-DEV

@WMOH-DEV do you know what version you were running before?

di-sukharev avatar Mar 25 '24 12:03 di-sukharev

@seanmccabe do you know what version you were running before?

di-sukharev avatar Mar 25 '24 12:03 di-sukharev

@WMOH-DEV do you know what version you were running before?

I think 3.0.11

WMOH-DEV avatar Mar 25 '24 14:03 WMOH-DEV

Im getting the same error after updating to the latest version.

- oco config set OCO_MODEL=gpt-3.5-turbo
- Unsupported config key OCO_MODEL: gpt-3.5-turbo-16k is not supported yet, use 'gpt-4', 'gpt-3.5-turbo' (default), 'gpt-3.5-turbo-0125', 'gpt-4-1106-preview', 'gpt-4-turbo-preview' or 'gpt-4-0125-preview'

Champkinz avatar Mar 28 '24 11:03 Champkinz

I rolled back to v3.0.11 and it works fine.

Champkinz avatar Mar 28 '24 11:03 Champkinz

@Champkinz try 3.0.18 released today, it allows any string for OCO_MODEL — so we dont need to make a PR every time new model is released.

if it doesnt work — do this:

  1. run whereis opencommit (macos, idk for windows, sry)
  2. it should yield smth like /Users/you/.nvm/versions/node/v20.10.0/bin/opencommit
  3. this v20.10.0 has /node_modules
  4. opencommit should be installed there as a global package
  5. delete /opencommit
  6. install again npm run -g opencommit@latest

di-sukharev avatar Aug 18 '24 16:08 di-sukharev

Since updating to 3.0.18, I get the following error.

❯ oco --version                                                                                                                                                         
│
└ ✖ Unsupported model gpt-4o-mini. the model can be any string, but the current configuration is not supported.

As you suggest, I removed /opencommit and then installed the latest version.

npm install -g opencommit@latest

Does the following information help you fix it?

❯ cat .opencommit
OCO_OPENAI_API_KEY=***
OCO_ANTHROPIC_API_KEY=undefined
OCO_AZURE_API_KEY=undefined
OCO_GEMINI_API_KEY=undefined
OCO_TOKENS_MAX_INPUT=undefined
OCO_TOKENS_MAX_OUTPUT=undefined
OCO_OPENAI_BASE_PATH=undefined
OCO_GEMINI_BASE_PATH=undefined
OCO_DESCRIPTION=false
OCO_EMOJI=false
OCO_MODEL=gpt-4o-mini
OCO_LANGUAGE=en
OCO_MESSAGE_TEMPLATE_PLACEHOLDER=$msg
OCO_PROMPT_MODULE=conventional-commit
OCO_AI_PROVIDER=openai
OCO_GITPUSH=true
OCO_ONE_LINE_COMMIT=false
OCO_AZURE_ENDPOINT=undefined
OCO_TEST_MOCK_TYPE=commit-message
OCO_FLOWISE_ENDPOINT=:.
OCO_FLOWISE_API_KEY=undefined
OCO_OLLAMA_API_URL=undefined
❯ node -v                         
v20.16.0
❯ npm -v                          
10.8.1

I depend on this app so much that I would not be able to do my daily development without it! Please keep up the good work.

yasainet avatar Aug 18 '24 21:08 yasainet

my bad. please update to 3.0.19 i released now.

di-sukharev avatar Aug 19 '24 07:08 di-sukharev

Working as expected 🙌 Thank you for the release @di-sukharev 🚀

Champkinz avatar Aug 19 '24 11:08 Champkinz

I updated it and it works fine! Thank you 🙇‍♀️

yasainet avatar Aug 19 '24 20:08 yasainet