Skip to content

Node helper fetch does not honor proxy settings #22623

@cola-runner

Description

@cola-runner

What happened

Codex Desktop's Node helper / node_repl can fail to reach network resources in environments that rely on a local proxy. The rest of the terminal environment is configured to use the proxy, but Node helper fetch() appears to connect directly unless a TUN mode is enabled.

In my case Chrome and normal terminal commands worked through 127.0.0.1:7890, but Codex browser/Chrome helper setup was blocked because Node fetch('https://chatgpt.com/') timed out without TUN.

Expected behavior

Codex Node helper should respect either:

  • macOS system proxy settings, or
  • standard proxy environment variables such as HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, http_proxy, https_proxy

so users do not need to enable TUN just for Codex helper processes.

Actual behavior

The shell environment had proxy variables and macOS proxy enabled, but Node helper fetch did not use them automatically.

Manual workaround in the helper process fixed it:

const { setGlobalDispatcher, ProxyAgent } = await import('undici');
setGlobalDispatcher(new ProxyAgent('http://127.0.0.1:7890'));

After that, fetch('https://chatgpt.com/') returned quickly instead of timing out.

Environment

  • Codex Desktop / Codex app
  • Codex version cache: 0.128.0
  • macOS: 26.4.1 (25E253)
  • Bundled Node used by helper: v24.14.0 at /Applications/Codex.app/Contents/Resources/node
  • System proxy: HTTP/HTTPS/SOCKS on 127.0.0.1:7890
  • Shell env also had http_proxy, https_proxy, and ALL_PROXY

Suggested fix

When starting the Node helper, install an Undici ProxyAgent automatically when proxy env vars or OS proxy settings are present, or expose a Codex config option for the Node helper proxy. This would make browser/chrome helper startup work in proxy-based network environments without requiring full-device TUN mode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingtool-callsIssues related to tool calling

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions