di-sukharev / opencommit

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

[BUG]: stuck on Generating the commit message #259

Open zhiyue opened 1 year ago

zhiyue commented 1 year ago

Opencommit Version

3.0.3

Node Version

v18.7.0

NPM Version

9.8.1

What OS are you seeing the problem on?

Other Linux Distro

What happened?

stuck on image

Expected Behavior

normal output

Current Behavior

stuck

Possible Solution

No response

Steps to Reproduce

No response

Relevant log output

No response

FrancoLab commented 1 year ago

Same here. Screenshot 2023-09-13 at 12 16 17

juanmav commented 1 year ago

Hi, just to confirm I'm having the same problem as @zhiyue and @FrancoLab

di-sukharev commented 1 year ago

will get to it soon, thanks for creating the ticket!

dtellez-wm commented 1 year ago

Same problem on windows 10 image

FrancoLab commented 11 months ago

has this been resolved?

martineziortz commented 11 months ago

Same issue here. Please let me know if this has been resolved.

gustawx commented 11 months ago

I have the same issue, reinstall didn'help. Strange thing is that it worked fine and started to hang without making any changes in the system or config. Node 20.9.0, Windows 10

di-sukharev commented 11 months ago

Not yet resolved guys, if anyone have time to look into it — much appreciated <3

gustawx commented 10 months ago

@di-sukharev I made some tests and this is what I came up with:

  1. the problem happens when it goes inside of if (res >= MAX_REQUEST_TOKENS) {..., in \node_modules\opencommit\out\cli.js line 22105
  2. it goes in to above if when OCO_OPENAI_MAX_TOKENS is too large. I think people (like me) think that it's being used to specify max number of allowed tokens in the request TO openai but this is max token for the response FROM openai. When I set OCO_OPENAI_MAX_TOKENS to e.g. 500 all works fine again.
  3. I also found one hardcoded value that could be problematic. In the same file cli.js DEFAULT_MODEL_TOKEN_LIMIT is set to 4096, currently I use gpt-4 which has max allowed of 8192 tokens so: a) the value is not correct and b) it may change over time anyway and I think it also depends on openai subscription so would be good to have it configurable.
  4. there is also one line that I don't understand=> const MAX_REQUEST_TOKENS = DEFAULT_MODEL_TOKEN_LIMIT - ADJUSTMENT_FACTOR - INIT_MESSAGES_PROMPT_LENGTH - config6?.OCO_OPENAI_MAX_TOKENS why to subsctract OCO_OPENAI_MAX_TOKENS? Basically here was the problem (at least in my case) because DEFAULT_MODEL_TOKEN_LIMIT is hardcoded to 4096 and I set it to 8192 (currently allowed limit for gpt-4) so the result is negative and it was going insied of this if from point 1. (there is still some issue in that if expression)

Unfortunatelly I don't have time to debug this deeper and implement fix but I think it would be good to have simply a check that OCO_OPENAI_MAX_TOKENS can't be larger than DEFAULT_MODEL_TOKEN_LIMIT

github-actions[bot] commented 9 months ago

Stale issue message

di-sukharev commented 7 months ago

reopening, will take a look at this

aldinokemal commented 2 months ago

I'm using Azure with gpt-4o model getting stuck on generating the commit message. However, when I switch to gpt-35-turbo it's working

image
RazeBerry commented 1 month ago

Same problem here using Claude 3.5 Sonnet! What is even more strange is that when I log on Anthropic console, it does not show OpenCommit has made a call at all! Also maybe the issue is I deleted bunch of useless files from my repo and the OCO is trying to feed it into the Claude?

Edit: I think yeah feeding CSV in there is a problem

  Results_Version3/Bangladesh_clean_extracted.csv
  Results_Version3/Bangladesh_processed.csv
  Results_Version3/Mexico_SectionA_results_with_synthesis.csv
  Results_Version3/Mexico_clean_extracted.csv
  Results_Version3/Mexico_processed.csv
  Results_Version3/Poland_SectionA_results_20240813_173116_with_synthesis.csv
  Results_Version3/Poland_clean_extracted.csv
  Results_Version3/Poland_processed.csv
  Results_Version3/Switzerland_SectionA_results_20240814_133840_with_synthesis.csv
  Results_Version3/Switzerland_clean_extracted.csv
  Results_Version3/Switzerland_processed.csv
  ui/__pycache__/streamlit_app.cpython-311.pyc
  ui/streamlit_app.py
│
â—‹  Generating the commit message
AndreasBBS commented 1 month ago

I've had this issue in the past then it somehow resolved and now all of a sudden I'm having it again. My main problem with it is getting left out in the blue without an error message or being able to enable some verbose flag that might give me some insight of what's going on. Just stuck.