Repository navigation
Description
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,::1codex 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-199codex_appsURL resolves tohttps://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-106codex-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:
codex_apps/ RMCP Streamable HTTP should support SOCKS viaALL_PROXY=socks5h://...- or the optional
codex_appsbootstrap should fail quietly without a fatal startup error when only SOCKS proxying is configured - or the CLI should clearly document that this optional path currently requires an HTTP proxy (
HTTP_PROXY/HTTPS_PROXY) rather than SOCKS-onlyALL_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-checkResult:
- main request succeeds (
pong) - optional
wham/appsMCP bootstrap logs fatalTunnelUnexpectedEof
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-checkResult:
pong- no
wham/appsproxy error in the same environment
Activity
iqdoctor commentedon Mar 31, 2026
Additional data after checking the workspace and upstream crate features:
codex-rmcp-clientbuilds its Streamable HTTP transport on top ofreqwest::Client::builder():codex-rs/rmcp-client/src/rmcp_client.rs:103-106codex-rs/rmcp-client/src/rmcp_client.rs:986-989reqwestwithout thesocksfeature:codex-rs/rmcp-client/Cargo.toml:24-28reqwest0.12 exposes SOCKS support as an explicit optional feature (socks->tokio-socks):tungstenite:codex-rs/Cargo.toml:329tungstenite = { version = "0.27.0", features = ["deflate", "proxy"] }So the recommendation seems fairly concrete:
Minimal fix:
reqwest'ssocksfeature incodex-rmcp-clientConsistency follow-up:
reqwest-based Codex paths that are expected to honor env proxy settings, and explicitly enablesocksanywhereALL_PROXY=socks5h://...is meant to be supportedreqwestclient expected to honor SOCKSALL_PROXYmust opt intoreqwest/socksRegression coverage:
codex_appsMCP bootstrap path with only:ALL_PROXY=socks5h://...NO_PROXY=...HTTP_PROXY/HTTPS_PROXYhttps://chatgpt.com/backend-api/wham/appsThis would make the proxy story more uniform with the rest of the repo: websocket proxy support is already feature-gated explicitly, and
reqwestSOCKS support appears to need the same treatment.