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

Error: Request failed with status code 400 #8

Open
wudi opened this issue Mar 13, 2023 · 14 comments
Open

Error: Request failed with status code 400 #8

wudi opened this issue Mar 13, 2023 · 14 comments

Comments

@wudi
Copy link

wudi commented Mar 13, 2023

◓  Generating the commit message.
│
└  ✖ Error: Request failed with status code 400

It may be that the country I am in is not supported.
I can't find where to set it the proxy.

@di-sukharev
Copy link
Owner

hey @wudi

i dont think its the country, you would get smth like 401 or 403. there is an option: file is really big (more than 4096 token).

try commiting different smaller file, if it helps — let me know, i'll check on the that and make error messages more descriptive if possible <3

@homerokzam
Copy link

I have the same problem!

@di-sukharev
Copy link
Owner

I have the same problem!

does commiting smaller file work?

@aavram93
Copy link

Just tested with a small file like "readme" and it is working

@di-sukharev
Copy link
Owner

@homerokzam @wudi does smaller files work for you guys?

@di-sukharev
Copy link
Owner

ok, looks like sending large files in batches to openAI breaks somewhere. Anyone wants to investigate and make a PR? :)

@evanmarshall-dev
Copy link

I just received this error today with a minor change to one file. I was also able to commit no problem with several larger files earlier today with no error.

@Eriobis
Copy link

Eriobis commented Mar 28, 2023

I have the same error with changed in files which are ~2k
I also found out that even if the github page says npm 1.1.24 I am getting 1.1.23 no matter how I force it.
It may be a commit issue ?

@evanmarshall-dev
Copy link

evanmarshall-dev commented Mar 28, 2023

I received this error today with a minor change to one file. I was also able to commit no problem with several larger files earlier today with no problem.

Not a resolution, but it is definitely related to the number of commits. I restored different staged files and tried again and it worked. However, it is a shame that this limitation exists. Also, it seems to happen 100% of the time when you try to initiate a commit when you have deleted a file/directory from your repo.

@cod3cow
Copy link

cod3cow commented Mar 28, 2023

I can confirm that this Error: Request failed with status code 400 occurs for large changes. I formatted only one html file with 182 lines of code. oc --no-verify does not help. All good for small changes (few lines of code) in multiple files.

@sean-fairchild
Copy link

Getting the same error with a simple 1 line change to a README.

I used curl on the api to make sure my token worked and there wasn't any network issues. It would be nice if there was a -verbose or -debug flag to get more details on what the error is.

@adenekan41
Copy link

I'm encountering the same error and I can verify that it's due to a maximum token limit. In my opinion, the error message could be more informative in this scenario.

If you're facing this issue, a possible solution is to remove files with large differences or newly added large files.

@franyoadam
Copy link

ok, looks like sending large files in batches to openAI breaks somewhere. Anyone wants to investigate and make a PR? :)

What do you think about this?

The algorithm:

  • Shall we check if the maximum token reaches 4096?
  • If so, we can use Langchain's token splitter.
  • The texts could be uploaded in smaller chunks, or a summarizer could be created to generate a commit.

This could nicely overcome the problem.

@github-actions
Copy link

github-actions bot commented Jun 2, 2023

Stale issue message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants