Skip to content

openai-codex provider stops respecting https_proxy since v0.72.0+ with auto transport #4346

@iwinux

Description

@iwinux

What happened?

After upgrading Pi from v0.70.0 to v0.74.0, OpenAI Codex requests no longer go through my HTTP proxy. Then I downgraded to lower versions one by one and confirmed that the issue starts with v0.72.0 (v0.71.1 still works without issue).

NOTE: I install and run Pi with Bun.

Side issue: since v0.72.0, pi --model openai-codex/gpt-5.5 --print <prompt> hangs (normally it should exits) after the response is printed, even when run with Node.js v24.

It might be related to #4083 where the transport: "auto" starts to prefer WebSocket.

Steps to reproduce

  1. start an HTTP proxy with log viewer (mitmproxy works fine)
  2. export https_proxy=http://127.0.0.1:<proxy-port>
  3. pi --model openai-codex/gpt-5.5 --print HELLO -> issue happens
  4. set "transport": "sse" in settings.json -> issue resolves
  5. set "transport": "websocket" -> happens again

Expected behavior

Should see requests to https://chatgpt.com/backend-api/codex/responses in proxy log viewer.

When run with Node.js, it does go through the proxy as expected (I can see the WebSocket upgrade request). But pi --print hangs instead of exiting cleanly (I can create a separate issue for this if it makes sense).

Version

0.74.0 (also v0.72.0)

Metadata

Metadata

Assignees

No one assigned

    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