codex - 💡(How to fix) Fix Codex mobile pairing stuck on Waiting for desktop: remote-control stays connecting and backend environments returns empty

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fix / Workaround

Workarounds already tried

Code Example

HTTP proxy:  127.0.0.1:7890
HTTPS proxy: 127.0.0.1:7890
SOCKS proxy: 127.0.0.1:7890

---

websocket connected (HTTP 101 Switching Protocols)
ChatGPT base URL https://chatgpt.com/backend-api/ reachable
auth mode chatgpt

---

HTTP_PROXY=http://127.0.0.1:7890 \
HTTPS_PROXY=http://127.0.0.1:7890 \
ALL_PROXY=http://127.0.0.1:7890 \
http_proxy=http://127.0.0.1:7890 \
https_proxy=http://127.0.0.1:7890 \
all_proxy=http://127.0.0.1:7890 \
NO_PROXY=localhost,127.0.0.1,::1 \
no_proxy=localhost,127.0.0.1,::1 \
/Applications/Codex.app/Contents/Resources/codex remote-control --json

---

{
  "mode": "foreground",
  "status": "connecting",
  "serverName": "<hostname>.local",
  "environmentId": null,
  "timedOut": true
}

---

GET /backend-api/codex/remote/control/environments?limit=100
status=200
items=0

---

proxy(http://127.0.0.1:7890/) intercepts 'https://chatgpt.com/'
connected to 127.0.0.1:7890
connecting to app-server remote control websocket
websocket_url="wss://chatgpt.com/backend-api/wham/remote/control/server"
has_enrollment=false
environment_id="None"

---

mkdir -p ~/.codex/packages/standalone/current
ln -s /Applications/Codex.app/Contents/Resources/codex ~/.codex/packages/standalone/current/codex
RAW_BUFFERClick to expand / collapse

What version of the Codex App are you using?

Codex Desktop: 26.527.31326
Bundled CLI: codex-cli 0.135.0-alpha.1

Platform

macOS 26.4.1, Apple Silicon / arm64

What issue are you seeing?

Codex mobile pairing gets stuck after scanning the QR code from Codex Desktop.

Flow:

  1. Open Codex Desktop Settings -> Connections -> Control this Mac.
  2. "Allow discovery and control this device" is enabled.
  3. "Keep this Mac awake" is enabled.
  4. Click Add and generate a fresh QR code.
  5. Scan the QR code with iPhone camera.
  6. iPhone opens ChatGPT / Codex pairing flow.
  7. iPhone stays on "Waiting for desktop..." / "正在等待桌面版..."
  8. Codex Desktop remains on the QR / "Approve on your device" screen.

The expected "Authorize this phone" button never appears on mobile.

Account / workspace

Both Codex Desktop and ChatGPT mobile are signed into the same ChatGPT account. This is a personal account, not a team workspace.

Network context

The Mac uses a local proxy:

HTTP proxy:  127.0.0.1:7890
HTTPS proxy: 127.0.0.1:7890
SOCKS proxy: 127.0.0.1:7890

I also tested with iPhone on 5G plus the same proxy provider, and regenerated a fresh QR code each time.

Diagnostics

codex doctor reports normal ChatGPT WebSocket connectivity:

websocket connected (HTTP 101 Switching Protocols)
ChatGPT base URL https://chatgpt.com/backend-api/ reachable
auth mode chatgpt

But remote-control never registers an environment:

HTTP_PROXY=http://127.0.0.1:7890 \
HTTPS_PROXY=http://127.0.0.1:7890 \
ALL_PROXY=http://127.0.0.1:7890 \
http_proxy=http://127.0.0.1:7890 \
https_proxy=http://127.0.0.1:7890 \
all_proxy=http://127.0.0.1:7890 \
NO_PROXY=localhost,127.0.0.1,::1 \
no_proxy=localhost,127.0.0.1,::1 \
/Applications/Codex.app/Contents/Resources/codex remote-control --json

Result:

{
  "mode": "foreground",
  "status": "connecting",
  "serverName": "<hostname>.local",
  "environmentId": null,
  "timedOut": true
}

Authenticated backend query also returns no remote-control environments:

GET /backend-api/codex/remote/control/environments?limit=100
status=200
items=0

Debug logs show the remote-control process is using the local proxy and repeatedly attempting the remote-control WebSocket, but no environment is created:

proxy(http://127.0.0.1:7890/) intercepts 'https://chatgpt.com/'
connected to 127.0.0.1:7890
connecting to app-server remote control websocket
websocket_url="wss://chatgpt.com/backend-api/wham/remote/control/server"
has_enrollment=false
environment_id="None"

Workarounds already tried

  • Updated Codex Desktop and ChatGPT mobile to latest versions.
  • Restarted both apps multiple times.
  • Regenerated fresh QR codes.
  • Switched proxy nodes.
  • Tested iPhone on 5G with Wi-Fi disabled.
  • Verified both sides use the same ChatGPT account.
  • Created the expected managed standalone path:
mkdir -p ~/.codex/packages/standalone/current
ln -s /Applications/Codex.app/Contents/Resources/codex ~/.codex/packages/standalone/current/codex
  • Restarted remote-control with explicit proxy environment variables.
  • Cleared local remote/mobile pairing state and restarted remote-control.
  • Checked local SQLite: remote_control_enrollments remains empty.

Expected behavior

The Codex Desktop remote-control daemon should register the Mac as an online environment, so the mobile pairing flow can show the phone authorization screen.

Actual behavior

The desktop QR screen appears, but the backend environment list remains empty. Mobile stays on "Waiting for desktop" indefinitely.

Related issues

This looks similar to:

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The Codex Desktop remote-control daemon should register the Mac as an online environment, so the mobile pairing flow can show the phone authorization screen.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Codex mobile pairing stuck on Waiting for desktop: remote-control stays connecting and backend environments returns empty