Skip to content

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

Merged
di-sukharev merged 2 commits into
di-sukharev:masterfrom
Herdanis:master
Jun 25, 2026
Merged

fix(bug): fixing premature connection when using open AI#565
di-sukharev merged 2 commits into
di-sukharev:masterfrom
Herdanis:master

Conversation

@Herdanis

Copy link
Copy Markdown
Contributor

Hi,

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

thanks

@Herdanis Herdanis mentioned this pull request Jun 22, 2026
@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.

@Herdanis

Copy link
Copy Markdown
Contributor Author

Hi @di-sukharev

  1. i use macOS 26.5.1
  2. i already tried with multiple versions of node and opencommit it shows the same error
  3. Both using vpn or not got the same error
  4. yes i tried re-setup and reinstalling it

@Herdanis

Copy link
Copy Markdown
Contributor Author

Hi, I just add the comment on my changes kindly to check it,

thanks

@di-sukharev di-sukharev merged commit 530794f into di-sukharev:master Jun 25, 2026
5 checks passed
@di-sukharev

Copy link
Copy Markdown
Owner

@Herdanis new version is available in npm, thank you for the contribution

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