codex-multi-auth icon indicating copy to clipboard operation
codex-multi-auth copied to clipboard

[bug] OAuth, runtime and health requests ignore HTTP proxy environment variables on Node 22

Open maomaocun opened this issue 1 month ago • 0 comments

Summary

OAuth device-code login and the default mcodex runtime do not honor standard HTTP proxy environment variables on Node 22. Requests can take the host's direct egress path despite a configured and reachable HTTP proxy.

Reproduction

  1. Configure an HTTP proxy through HTTP_PROXY and HTTPS_PROXY in a headless Linux shell.
  2. Run codex-multi-auth login --device-auth.
  3. The device-code request can fail with HTTP 403 and unsupported_country_region_territory, while the same endpoint responds successfully through the configured proxy.
  4. With valid credentials already saved, run a short mcodex exec request or codex-multi-auth check accounts.
  5. Inference can return HTTP 503 account-pool exhaustion after transport failures; health checks can report signed in (live check failed: fetch failed) for otherwise valid credentials.

Expected Behavior

OAuth requests, default runtime HTTP requests, and health/quota probes should consistently honor HTTP_PROXY/HTTPS_PROXY and NO_PROXY.

Actual Behavior

These paths default to Node's built-in fetch without applying the project's existing proxy resolution helper. On the tested Node 22 installation, the configured proxy variables do not redirect those calls.

Attaching this package's Undici 8 dispatcher to Node 22's built-in fetch also fails due to incompatible dispatcher handler contracts. A proxy request must use a compatible fetch/dispatcher pair.

Environment

  • Codex CLI: 0.162.1
  • codex-multi-auth: 2.22.0
  • Node.js: 22.20.0
  • OS: Linux headless/remote shell
  • Proxy configured through standard HTTP(S) environment variables

Diagnostic Outputs

Real device codes, account identifiers, proxy endpoints, credentials, and host paths are omitted. A controlled installed-package test completed real model requests for four valid Plus credentials after using the proxy-aware transport. A revoked credential was distinguishable as token_revoked rather than a network failure.

Compliance Confirmation

  • [x] I am using this project for personal development workflows.
  • [x] This report does not request policy bypasses or prohibited usage.
  • [x] I removed any secrets/tokens from this report.

maomaocun avatar Oct 15 '26 17:10 maomaocun