di-sukharev / opencommit

Generate conventional git commit messages with AI in 1 second 🤯🔫
https://www.npmjs.com/package/opencommit
MIT License
6.15k stars 328 forks source link

[Bug]: 400 Invalid type for 'max_tokens': expected an integer, but got a string instead. #407

Closed rogerconsul-cw closed 2 months ago

rogerconsul-cw commented 2 months ago

Opencommit Version

3.1.2

Node Version

22.5.1

NPM Version

10.8.2

What OS are you seeing the problem on?

Mac

What happened?

Default undefined value for OCO_TOKENS_MAX_OUTPUT is throwing error.

Expected Behavior

some default value for it.

Current Behavior

expected an integer, but got a string instead.

Possible Solution

Adjusting the default value to an integer

Steps to Reproduce

I just tried to use after updating.

Relevant log output

oco -y            
(node:13357) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
┌  open-commit
│
◇  1 staged files:
  *****
│
◇  📝 Commit message generated
│
└  ✖ 400 Invalid type for 'max_tokens': expected an integer, but got a string instead.
jacobleft commented 2 months ago

I get the same error after updating to 3.1.0. Reverting to 3.0.20 works fine.

di-sukharev commented 2 months ago

there is a bug that will be fixed with the next release, which most likely happens today.

for now run: oco config set OCO_TOKENS_MAX_INPUT=10000 OCO_TOKENS_MAX_OUTPUT=10000, should heal it

di-sukharev commented 2 months ago

gonna be fixed when this is merged https://github.com/di-sukharev/opencommit/pull/408

rogerconsul-cw commented 2 months ago

Same error. I tried to hard-code a token number before. Reverting to previous version. No worries 👍

psjjonathan commented 2 months ago

Same error here. Waiting for the merge.

di-sukharev commented 2 months ago

latest version just merged https://github.com/di-sukharev/opencommit/pull/412

run npm i -g opencommit@latest