Skip to content

fix(bug): fixing premature connection when using open AI#565

Open
Herdanis wants to merge 1 commit into
di-sukharev:masterfrom
Herdanis:master
Open

fix(bug): fixing premature connection when using open AI#565
Herdanis wants to merge 1 commit into
di-sukharev:masterfrom
Herdanis:master

Conversation

@Herdanis

Copy link
Copy Markdown

Hi,

i just fix my issue regarding premature close on OpenAI #564. Kindly review my commit,

thanks

@di-sukharev

Copy link
Copy Markdown
Owner

@Herdanis

thanks for the pr.

from what i can see, this works by forcing the openai sdk to use node’s native globalThis.fetch instead of its default node-fetch transport. that makes sense as a workaround for the Invalid response body ... Premature close error you reported in #564, especially on node 24.

before i merge this, could you please add a bit more context?

  1. what os are you using?
  2. does the error happen consistently on node 24.17.0, or only sometimes?
  3. are you using a proxy, vpn, corporate network, or custom OCO_API_URL?
  4. did you verify that the same command works after this change?

also, please add a short code comment or test explaining why we override the openai sdk fetch implementation here. the current change looks reasonable, but without that context it will be hard to maintain later.

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

Successfully merging this pull request may close these issues.

2 participants