opencommit icon indicating copy to clipboard operation
opencommit copied to clipboard

Committed Multiple files, Received 400

Open imrantechwiz opened this issue 2 years ago • 28 comments
trafficstars

Error: Request failed with status code 400

Screenshot 2023-03-29 at 8 04 21 PM

imrantechwiz avatar Mar 29 '23 14:03 imrantechwiz

Error: Request failed with status code 400

Screenshot 2023-03-29 at 8 04 21 PM

Same problem here, I tested it here in some cases and got this error 400

Screenshot 2023-03-29 at 1 31 41 PM

rodrigooler avatar Mar 29 '23 16:03 rodrigooler

+1 running into the same issue

aliharis avatar Mar 29 '23 19:03 aliharis

+1 same error when oc multiple files

eudard avatar Mar 29 '23 22:03 eudard

+1 running into the same issue

ProfeJulianLasso avatar Mar 29 '23 23:03 ProfeJulianLasso

should be fixed with a coming PR, thanks <3

di-sukharev avatar Mar 30 '23 07:03 di-sukharev

Wow, you're doing a great job! @di-sukharev

rodrigooler avatar Mar 30 '23 18:03 rodrigooler

@di-sukharev

should be fixed with a coming PR, thanks <3

Which PR is it? I still have the same problem with the latest version.

Speaking of latest version, the current 1.1.36 on npm seems to be published incorrectly. When you install it with npm i [email protected] and then do oc --version, it shows as 1.1.35.

There's probably a mistake made during packaging. Maybe it's time to consider using GitHub Actions.

wywywywy avatar Mar 30 '23 19:03 wywywywy

Running into the same issues and as @wywywywy said, oc --version still shows as 1.1.35.

kenryu42 avatar Mar 31 '23 11:03 kenryu42

@wywywywy this is a known issue, idk how to config it.. but anyway the 35 version is same as 36. bug is not fixed, but we diagnosed the issue, gonna merge the PR soon.

di-sukharev avatar Apr 01 '23 05:04 di-sukharev

should be fixed now, pls update npm i -g opencommit

di-sukharev avatar Apr 05 '23 04:04 di-sukharev

Hmm. With apologies, I updated to 1.1.48 (opencommit --version) and am still getting:

└ ✖ Error: Request failed with status code 400

MartinPaulEve avatar Apr 05 '23 11:04 MartinPaulEve

same here after running npm i -g opencommit

Kevdome3000 avatar Apr 05 '23 22:04 Kevdome3000

same on 1.1.50

KenMercusLai avatar Apr 11 '23 05:04 KenMercusLai

yep, this error persists, could anybody investigate and make a PR?

di-sukharev avatar Apr 11 '23 09:04 di-sukharev

One of the possible reasons for this problem is that the token has exceeded the limit of 4096. In the code, result of git diff is split and submitted to the openai API by line breaks if over MAX_REQ_TOKENS. However, there is a possibility that even after splitting, one sentence still exceeds the limit, which will result in this error.

mathsgod avatar Apr 14 '23 03:04 mathsgod

You can try the following step to re-create the error:

  1. create an empty folder, run git init
  2. create a text file and write very long string without line breaks (token must be over 4096) , You can go here to check token size.
  3. run oc

mathsgod avatar Apr 14 '23 04:04 mathsgod

Same results with 1.1.50

jlopezlira avatar Apr 19 '23 01:04 jlopezlira

I also still have the same problem with version 1.1.50/2.0.0, but I can confirm it only happens with "many changes". It's not about file size. As soon as I touch many changes to multiple files, at some point it will result in err 400, most likely due to MAX_REQ_TOKENS with limit 4096 from openai API limits. If I do small simple commits, it never happens with errors.

For now, I work around this by doing commits earlier after changes instead of waiting until 1 "larger" commit. It's not ideal as multi commits = multiple builds that get triggered, causing more computation expenses etc... I would prefer to do only 1 commit where I really need it.

is there a way to work around that 4096 limit? Can openAI accept bigger? I'm ok with paying more for upgrading something at openai if that solves the problem. But I don't know if something like that is even available.

I'm happy to help where possible, testing, etc... I just don't where to start or how.

Thanks.

codeagencybe avatar Apr 26 '23 09:04 codeagencybe

Any update on this? It's pretty useless for me at the moment, tbh.

HarryAdney avatar May 11 '23 13:05 HarryAdney

we tried 3 PRs and nothing healed it, if anybody wants to be the HERO who solves this — please do the shot and save us here 🙏 🦺

di-sukharev avatar May 26 '23 06:05 di-sukharev

@di-sukharev I'm going to tackle this topic, I'll give it a try.

jlopezlira avatar Jun 06 '23 17:06 jlopezlira

@di-sukharev I'm going to tackle this topic, I'll give it a try.

@jlopezlira Did you find working solution?

codeagencybe avatar Jun 08 '23 08:06 codeagencybe

You sir, are a gentleman and a scholar.

HarryAdney avatar Jun 08 '23 09:06 HarryAdney

@di-sukharev

Does this update from openAI may be helpful to resolve this issue? They now seem to support up to 16k tokens at a slightly higher price.

image

codeagencybe avatar Jun 14 '23 09:06 codeagencybe

Stale issue message

github-actions[bot] avatar Jul 24 '23 21:07 github-actions[bot]

@di-sukharev why is issue closed as "completed"? Because this issue is still existing.

Is this project still ongoing?

codeagencybe avatar Aug 01 '23 21:08 codeagencybe

@di-sukharev why is issue closed as "completed"? Because this issue is still existing.

Is this project still ongoing?

No recent messages since your last one on Jun 14, so the github-actions bot closed it.

HarryAdney avatar Aug 03 '23 16:08 HarryAdney

sorry for closing, will add a bigger model context and validate myself

di-sukharev avatar Feb 28 '24 06:02 di-sukharev