Repository navigation
Closed
Labels
CLIIssues related to the Codex CLIapp-serverIssues involving app server protocol or interfacesbugSomething isn't workingconnectivityIssues involving networking or endpoint connectivity problems (disconnections)remote
Description
Bug report: codex remote-control reports "connection is errored" while the app-server remote-control WebSocket is actually Connected
Environment
- Codex CLI:
codex-cli 0.151.0(standalone install at~/.codex/packages/standalone/current/codex) - App-server:
0.151.0, daemon backendpid - macOS: 26.6.2 (Apple Silicon, arm64)
- Install method: official installer script (
curl -fsSL https://chatgpt.com/codex/install.sh | sh) - Auth: ChatGPT account (logged in, remote-control feature available on the account)
- Proxy: local HTTP proxy for outbound access (verified injected into daemon env;
codex doctorreports proxy env vars present)
Summary
After enabling remote control, the CLI status command always reports the connection as errored, even though:
codex doctorshows a successful WebSocket upgrade (HTTP 101 Switching Protocols),- the app-server foreground log shows the remote-control WebSocket transitioning to
next_status=Connected, - the persisted enrollment is reused and the server token refresh succeeds.
Steps to reproduce
# 1. Install standalone Codex (0.151.0) and log in
curl -fsSL https://chatgpt.com/codex/install.sh | sh
# 2. Start the daemon with remote control enabled
codex remote-control start
# => "Starting app-server daemon with remote control enabled..."
# => "This machine is available for remote control as <hostname>.local."
# 3. Query status
codex remote-control --jsonActual result
Error: Remote control is enabled on <hostname>.local but the connection is errored.
codex remote-control pair also frequently fails:
Error: timed out waiting for remoteControl/pairing/start response
Caused by:
deadline has elapsed
(It intermittently succeeds — a pairing code was generated once — which suggests the service itself works.)
Expected result
Status should report Connected (or at least a non-errored state) when the WebSocket is up, so pairing and remote control can be used reliably.
Evidence
1. codex remote-control --json while the app-server is running in the foreground with a confirmed Connected WebSocket
Error: Remote control is enabled on <hostname>.local but the connection is errored.
2. App-server foreground log (RUST_LOG trace) — same process, seconds earlier
INFO codex_app_server_transport::transport::remote_control::websocket: connecting to app-server remote control websocket websocket_url=wss://chatgpt.com/backend-api/wham/remote/control/server installation_id=<redacted> server_name=<hostname>.local reconnect_attempt=1 has_enrollment=false server_id=None environment_id=None subscribe_cursor_present=false app_server_client_name=None
INFO codex_app_server_transport::transport::remote_control::enroll: reusing persisted remote control enrollment: websocket_url=wss://chatgpt.com/backend-api/wham/remote/control/server, account_id=<redacted>, app_server_client_name=None, server_id=<redacted>, environment_id=<redacted>
INFO codex_app_server_transport::transport::remote_control::websocket: refreshing remote control server token: websocket_url=wss://chatgpt.com/backend-api/wham/remote/control/server, refresh_url=https://chatgpt.com/backend-api/wham/remote/control/server/refresh, account_id=<redacted>, server_id=<redacted>, environment_id=<redacted>
INFO codex_app_server_transport::transport::remote_control::websocket: remote control websocket status changed previous_status=Connecting next_status=Connected previous_environment_id=Some("<redacted>") next_environment_id=Some("<redacted>") installation_id=<redacted> server_name=<hostname>.local
The WebSocket reached Connected ~5 seconds after startup. The status query against the same control socket still returned "errored".
3. codex doctor excerpt
proxy env vars present HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, NO_PROXY, http_proxy, https_proxy, all_proxy, no_proxy
connect timeout 15000 ms
auth mode chatgpt
endpoint wss://chatgpt.com/backend-api/<redacted>
DNS 1 IPv4, 1 IPv6, first IPv6
handshake result HTTP 101 Switching Protocols
...
Background Server
✓ app-server running (persistent mode)
status running
app-server version 0.151.0
mode persistent
What I tried
codex app-server daemon start / restart / stopthencodex remote-control start(multiple times)codex app-server daemon enable-remote-control- Removing stale socket/pid files (
app-server-control.sock,app-server.pid) before restart - Running
codex app-server --remote-control --listen unix://in the foreground withRUST_LOG=debug— WebSocket connects toConnected, yetcodex remote-control --jsonstill reports errored - Running with and without proxy env vars (proxy confirmed active in both daemon and foreground processes via
ps eww) codex remote-control pair— intermittent: one successful pairing code, otherwise timeout
Notes
- The mismatch (WebSocket
Connectedin app-server logs vs.erroredin the CLI status query) suggests the status reported by the control socket does not reflect the actual remote-control WebSocket state. codex doctoroverall result:21 ok · 3 notes · 2 warn · 0 fail degraded(the warnings are optional desktop assets CDN reachability, unrelated).- Full app-server foreground log (with installation/account IDs redacted) is available on request.
Metadata
Metadata
Assignees
Labels
CLIIssues related to the Codex CLIapp-serverIssues involving app server protocol or interfacesbugSomething isn't workingconnectivityIssues involving networking or endpoint connectivity problems (disconnections)remote
Activity
kennetsytn commentedon Aug 30, 2026
✅ Resolved — Local environment issue
The remote-control functionality is now working correctly after local environment changes.
Root Cause Analysis
The issue was caused by a local proxy configuration conflict, not a codex CLI bug.
Timeline:
HTTP_PROXY/HTTPS_PROXYenvironment variables pointing to a local HTTP proxy (Clash Verge). The daemon inherited these proxy settings from the shell.codex remote-control --jsonconsistently reported"connection is errored", while:codex doctorshowed WebSocket HTTP 101 connectedapp-serverdebug logs showedcurrent_status=ConnectedHTTP_PROXY/HTTPS_PROXYenvironment variables from the daemon process.Why the proxy caused status reporting failures:
wss://chatgpt.com/backend-api/wham/remote/control/serverwas being routed through the HTTP proxyEnvironment Details
Evidence
previous_status=Connectingtonext_status=Connectedcodex remote-control --json: reports connectedRecommendation
If other users encounter similar
"connection is errored"status while the WebSocket is actually connected, check for HTTP proxy environment variables (HTTP_PROXY,HTTPS_PROXY) that may interfere with the daemon's internal state management. Consider using TUN/virtual NIC transparent proxy mode instead of HTTP proxy mode for the codex daemon.Thanks for the great tool! Closing as this was a local environment issue.
lagisela commentedon Sep 15, 2026
Remote control enrollment never completes on WSL2 (clean install, fresh hostname)
Codex CLI 0.154.0, standalone install, Ubuntu on WSL2, Windows 11 26200.
codex remote-control start succeeds and reports "This machine is available for remote control as paul-wsl", but codex remote-control pair always fails with remoteControl/pairing/start failed: remote control pairing is unavailable until enrollment completes, and codex remote-control --json reports "connection is errored".
Ruled out:
Auth: fresh codex login --device-auth, successful.
Host identity: set a unique WSL hostname via /etc/wsl.conf to avoid reusing a previously stuck enrollment record. New name is reported correctly; same failure.
Competing instances: Windows Codex desktop app and Windows app-server daemon fully stopped.
Install type: switched from npm @openai/codex to the standalone installer as instructed by the daemon error.
Waiting: ran start and pair as separate commands with 30s in between.
No daemon logs are produced at all — ~/.codex/log/ contains only codex-login.log. RUST_LOG=debug codex remote-control start prints nothing beyond the normal output, so there is no error detail to attach.
On the same machine, native Windows fails earlier with socket directory is not private to the current user (directory ACL verified: owner is the current user, single full-control ACE). WSL2 gets past that point and then fails at enrollment.