Managed network proxy injects unsupported YARN_NO_PROXY and breaks Yarn Berry

Open 💬 0 comments Opened Aug 26, 2026 by dobesv

What version of Codex CLI is running?

codex-cli 0.149.1 (npm-managed)

What platform is your computer?

Linux x86_64

What issue are you seeing?

When the managed network proxy is active, Codex injects YARN_NO_PROXY into every spawned command environment. Yarn Berry interprets every YARN_* variable as a Yarn configuration setting, maps this variable to noProxy, and rejects it because Yarn Berry has no such setting.

This prevents Yarn commands that load the full configuration from running.

$ yarn --version
4.17.1

$ env | grep "^YARN_.*_PROXY="
YARN_HTTPS_PROXY=http://127.0.0.1:<port>
YARN_HTTP_PROXY=http://127.0.0.1:<port>
YARN_NO_PROXY=localhost,127.0.0.1,::1,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16

$ yarn config get httpProxy
Usage Error: Unrecognized or legacy configuration settings found: noProxy - run "yarn config" to see the list of settings supported in Yarn (in <environment>)

$ echo $?
1

Removing only the unsupported variable fixes the failure while retaining the managed HTTP proxy:

$ env -u YARN_NO_PROXY yarn config get httpProxy
http://127.0.0.1:<port>

$ echo $?
0

What steps can reproduce the bug?

  1. Run Codex with the managed sandbox network proxy active. The spawned environment has CODEX_NETWORK_PROXY_ACTIVE=1.
  2. Open a repository using Yarn Berry. This reproduction uses Yarn 4.17.1.
  3. Run yarn config get httpProxy or yarn install --immutable inside the Codex sandbox.
  4. Observe that Yarn exits because the injected YARN_NO_PROXY becomes the unsupported noProxy configuration key.
  5. Run the same command through env -u YARN_NO_PROXY; it proceeds normally and continues to use YARN_HTTP_PROXY and YARN_HTTPS_PROXY.

What is the expected behavior?

Codex should not inject package-manager-specific environment variables that the package manager rejects. Yarn Berry commands should run normally while managed proxying remains enabled.

A likely fix is to remove YARN_NO_PROXY from NO_PROXY_ENV_KEYS. Alternatively, environment exclusions would need to run after managed proxy injection so users could exclude this one key without disabling the network proxy.

Additional information

The current network-proxy implementation explicitly includes YARN_NO_PROXY in NO_PROXY_ENV_KEYS and writes every key in that list into child environments:

The documented shell_environment_policy.filters feature looks relevant, but managed proxy values are applied later in the spawn path. Related report: #40896.

Current workaround for every Yarn invocation:

env -u YARN_NO_PROXY yarn ...

View original on GitHub ↗