-
Notifications
You must be signed in to change notification settings - Fork 70
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
Failed when processing a large file (13MB) #174
Comments
Just to tie together a bunch of the potentially related issues: This seems to be the section of code for implementing better throttling/retry logic (at least for the openai plugin): Also:
And there is some hacky workaround implementation of throttling code in this comment: |
While I'm not 100% sure.. I can trigger the same error message in a contrived way with: const response = { choices: null }
response.choices[0].message
// VM2853:3 Uncaught TypeError: Cannot read properties of null (reading '0')
// at <anonymous>:3:17 Which suggests that the Based on the code, this seems to be using the OpenAI rename plugin, with this bit in particular hitting the error: humanify/src/plugins/openai/openai-rename.ts Lines 26 to 32 in f13e0c7
You would probably need to debug log/inspect the full value of A very quick/dirty hacky workaround would be something like this: const response = await client.chat.completions.create(
toRenamePrompt(name, surroundingCode, model)
);
- const result = response.choices[0].message?.content;
+ const result = response?.choices?.[0]?.message?.content;
if (!result) {
throw new Error("Failed to rename", { cause: response });
} @chivychao Does this happen consistently for you, or was it a once off? |
Currently, the error has only occurred once. The response corresponding to the error is as follows:
The response for other cases where there was no error is as follows:
|
lol brutal 😆 It works just fine! |
More just meant it looks like a quick workaround not like a fully polished / configurable integrated feature; didn't intend any disrespect by it. |
When processing a large source code file, an error occurred approximately 2 hours into the process.
The error message is as follows:
Is this purely a network transmission issue? Is there a way to retry from the breakpoint?
The text was updated successfully, but these errors were encountered: