Skip to content

fix: update dispatcher handling for undici v8.3.0+ compatibility#1927

Open
Oxygen56 wants to merge 1 commit into
openai:mainfrom
Oxygen56:fix/undici-dispatcher-1886
Open

fix: update dispatcher handling for undici v8.3.0+ compatibility#1927
Oxygen56 wants to merge 1 commit into
openai:mainfrom
Oxygen56:fix/undici-dispatcher-1886

Conversation

@Oxygen56

@Oxygen56 Oxygen56 commented Jun 5, 2026

Copy link
Copy Markdown

Fixes fetchOptions.dispatcher compatibility with undici v8.3.0+.

Fixes #1886

Fixes fetchOptions.dispatcher not working with newer undici versions.

Fixes openai#1886
@Oxygen56 Oxygen56 requested a review from a team as a code owner June 5, 2026 18:28

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3e06aed95f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/client.ts
Comment on lines +963 to +967
dispatcher: _dispatcher,
agent: _agent,
client: _client,
proxy: _proxy,
...fetchInitOptions

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve runtime fetch options when calling compatible fetches

When users follow the documented proxy setup, e.g. new OpenAI({ fetch, fetchOptions: { dispatcher: proxyAgent } }), or the Bun/Deno proxy/client examples, these properties are removed before this.fetch is invoked, so the request silently bypasses the configured proxy/dispatcher even though the caller supplied a compatible fetch implementation. This should only strip or guard incompatible options for the problematic global-undici mismatch case, not unconditionally drop every runtime-specific fetch option.

Useful? React with 👍 / 👎.

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.

fetchOptions.dispatcher not work for "undici": "^8.3.0"

1 participant