Skip to content

codex_apps MCP bootstrap fails on SOCKS-only ALL_PROXY and appears to require HTTP proxy vars #16360

Open

Description

@iqdoctor

Summary

codex_apps MCP bootstrap appears to fail when Codex is configured with ALL_PROXY=socks5h://... only, even though the main codex e ping flow succeeds.

The failure path is the optional Streamable HTTP MCP endpoint at https://chatgpt.com/backend-api/wham/apps.

Observed behavior

With only:

export ALL_PROXY=socks5h://127.0.0.1:10808
export NO_PROXY=127.0.0.1,localhost,::1

codex e ping --skip-git-repo-check still returns pong, but logs this error during startup:

ERROR rmcp::transport::worker: worker quit with fatal: Transport channel closed, when Client(Reqwest(reqwest::Error { kind: Request, url: "https://chatgpt.com/backend-api/wham/apps", source: hyper_util::client::legacy::Error(Connect, TunnelUnexpectedEof) }))

When HTTP_PROXY / HTTPS_PROXY / WS_PROXY / WSS_PROXY are also set to an HTTP proxy listener, the noise goes away.

Why this looks like a Codex bug

The optional apps/bootstrap path is built here:

  • codex-rs/core/src/mcp/mod.rs:165-199
  • codex_apps URL resolves to https://chatgpt.com/backend-api/wham/apps

That transport is created by codex-rmcp-client using a plain reqwest::Client:

  • codex-rs/rmcp-client/src/rmcp_client.rs:103-106
  • codex-rs/rmcp-client/src/rmcp_client.rs:986-989

But codex-rmcp-client depends on reqwest without the socks feature:

  • codex-rs/rmcp-client/Cargo.toml:24-28
reqwest = { version = "0.12", default-features = false, features = [
    "json",
    "stream",
    "rustls-tls",
] }

So this path appears unable to use a socks5h://...-style ALL_PROXY configuration, even though Codex docs and other runtime paths treat ALL_PROXY as part of the supported proxy setup.

Expected behavior

One of these should happen:

  1. codex_apps / RMCP Streamable HTTP should support SOCKS via ALL_PROXY=socks5h://...
  2. or the optional codex_apps bootstrap should fail quietly without a fatal startup error when only SOCKS proxying is configured
  3. or the CLI should clearly document that this optional path currently requires an HTTP proxy (HTTP_PROXY / HTTPS_PROXY) rather than SOCKS-only ALL_PROXY

Repro

export ALL_PROXY=socks5h://127.0.0.1:10808
export NO_PROXY=127.0.0.1,localhost,::1
unset HTTP_PROXY HTTPS_PROXY WS_PROXY WSS_PROXY
codex e ping --skip-git-repo-check

Result:

  • main request succeeds (pong)
  • optional wham/apps MCP bootstrap logs fatal TunnelUnexpectedEof

Then:

export HTTP_PROXY=http://127.0.0.1:10809
export HTTPS_PROXY=http://127.0.0.1:10809
export WS_PROXY=http://127.0.0.1:10809
export WSS_PROXY=http://127.0.0.1:10809
codex e ping --skip-git-repo-check

Result:

  • pong
  • no wham/apps proxy error in the same environment

Activity

  1. added
    bug
    CLI
    mcp
    on Mar 31, 2026
  2. iqdoctor commented on Mar 31, 2026

    @iqdoctor
    Author

    Additional data after checking the workspace and upstream crate features:

    • codex-rmcp-client builds its Streamable HTTP transport on top of reqwest::Client::builder():
      • codex-rs/rmcp-client/src/rmcp_client.rs:103-106
      • codex-rs/rmcp-client/src/rmcp_client.rs:986-989
    • That crate currently depends on reqwest without the socks feature:
      • codex-rs/rmcp-client/Cargo.toml:24-28
    • reqwest 0.12 exposes SOCKS support as an explicit optional feature (socks -> tokio-socks):
    • In the same workspace, websocket proxy capability is already enabled explicitly on tungstenite:
      • codex-rs/Cargo.toml:329
      • tungstenite = { version = "0.27.0", features = ["deflate", "proxy"] }

    So the recommendation seems fairly concrete:

    1. Minimal fix:

      • enable reqwest's socks feature in codex-rmcp-client
    2. Consistency follow-up:

      • audit other reqwest-based Codex paths that are expected to honor env proxy settings, and explicitly enable socks anywhere ALL_PROXY=socks5h://... is meant to be supported
      • alternatively, define a project rule that any reqwest client expected to honor SOCKS ALL_PROXY must opt into reqwest/socks
    3. Regression coverage:

      • add a test for the optional codex_apps MCP bootstrap path with only:
        • ALL_PROXY=socks5h://...
        • NO_PROXY=...
        • no HTTP_PROXY / HTTPS_PROXY
      • expected result: no fatal bootstrap error for https://chatgpt.com/backend-api/wham/apps

    This would make the proxy story more uniform with the rest of the repo: websocket proxy support is already feature-gated explicitly, and reqwest SOCKS support appears to need the same treatment.

  3. removed
    CLI
    on Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmcp

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions