[macOS][Remote Control] Desktop/CLI ownership collision returns HTTP 409 and prevents iOS from opening CLI chats
What version of Codex CLI is running?
codex-cli 0.147.0
What subscription do you have?
ChatGPT Pro
Which model were you using?
gpt-5.6-sol
What platform is your computer?
Darwin 25.6.0 arm64 arm (macOS 26.6.1, Apple Silicon)
What terminal emulator and version are you using (if applicable)?
Ghostty 1.3.1
Codex doctor report
{
"schemaVersion": 1,
"generatedAt": "1786951474s since unix epoch",
"overallStatus": "ok",
"codexVersion": "0.147.0",
"checks": {
"app_server.status": {
"id": "app_server.status",
"category": "app-server",
"status": "ok",
"summary": "background server is running",
"details": {
"app-server version": "0.147.0",
"control socket": "<HOME>/.codex/app-server-control/app-server-control.sock",
"daemon state dir": "<HOME>/.codex/app-server-daemon",
"mode": "persistent",
"pid file": "<HOME>/.codex/app-server-daemon/app-server.pid (file)",
"settings": "<HOME>/.codex/app-server-daemon/settings.json (file)",
"status": "running",
"update-loop pid file": "<HOME>/.codex/app-server-daemon/app-server-updater.pid (file)"
},
"remediation": null,
"durationMs": 157
},
"auth.credentials": {
"id": "auth.credentials",
"category": "auth",
"status": "ok",
"summary": "auth is configured",
"details": {
"auth file": "<HOME>/.codex/auth.json",
"auth storage mode": "File",
"stored API key": "false",
"stored ChatGPT tokens": "true",
"stored agent identity": "false",
"stored auth mode": "chatgpt"
},
"remediation": null,
"durationMs": 0
},
"config.load": {
"id": "config.load",
"category": "config",
"status": "ok",
"summary": "config loaded",
"details": {
"CODEX_HOME": "<HOME>/.codex",
"config.toml": "<HOME>/.codex/config.toml",
"config.toml parse": "ok",
"cwd": "<HOME>/Projects",
"enabled feature flags": "shell_tool, view_image, unified_exec, shell_snapshot, code_mode_host, terminal_resize_reflow, sqlite, memories, hooks, enable_request_compression, multi_agent, apps, tool_search_always_defer_mcp_tools, tool_suggest, plugins, in_app_browser, in_app_updates, browser_use, browser_use_full_cdp_access, browser_use_external, computer_use, remote_plugin, plugin_sharing, image_generation, resize_all_images, item_ids, skill_mcp_dependency_install, skill_search, mentions_v2, steer, default_mode_request_user_input, guardian_approval, goals, collaboration_modes, tool_call_mcp_elicitation, auth_elicitation, personality, fast_mode, tui_app_server, remote_compaction_v2, workspace_dependencies",
"feature flag overrides": "memories=true, default_mode_request_user_input=true",
"feature flags enabled": "41",
"log dir": "<HOME>/.codex/log",
"mcp servers": "3",
"model": "gpt-5.6-sol",
"model provider": "openai",
"sqlite home": "<HOME>/.codex"
},
"remediation": null,
"durationMs": 0
},
"git.environment": {
"id": "git.environment",
"category": "git",
"status": "ok",
"summary": "git version 2.50.1 (Apple Git-155)",
"details": {
"PATH git #1": "/usr/bin/git",
"PATH git entries": "1",
"git build options": "git version 2.50.1 (Apple Git-155); cpu: arm64; no commit associated with this build; sizeof-long: 8; sizeof-size_t: 8; shell-path: /bin/sh; feature: fsmonitor--daemon; libcurl: 8.7.1; zlib: 1.2.12; SHA-1: SHA1_DC; SHA-256: SHA256_BLK",
"git exec path": "/Library/Developer/CommandLineTools/usr/libexec/git-core",
"git version": "git version 2.50.1 (Apple Git-155)",
"repo detected": "false",
"selected git": "/usr/bin/git"
},
"remediation": null,
"durationMs": 159
},
"installation": {
"id": "installation",
"category": "install",
"status": "ok",
"summary": "installation looks consistent",
"details": {
"PATH codex #1": "<HOME>/.local/bin/codex",
"PATH codex #2": "<HOME>/.local/bin/codex",
"PATH codex #3": "<HOME>/.local/bin/codex",
"PATH codex #4": "<HOME>/.local/bin/codex",
"PATH codex entries": "4",
"current executable": "<HOME>/.local/bin/codex",
"install context": "standalone (unix, package <HOME>/.codex/packages/standalone/releases/0.147.0-aarch64-apple-darwin, bin <HOME>/.codex/packages/standalone/releases/0.147.0-aarch64-apple-darwin/bin, resources <HOME>/.codex/packages/standalone/releases/0.147.0-aarch64-apple-darwin/codex-resources, path <HOME>/.codex/packages/standalone/releases/0.147.0-aarch64-apple-darwin/codex-path)",
"managed by bun": "false",
"managed by npm": "false",
"managed by pnpm": "false",
"managed package root": "not set"
},
"remediation": null,
"durationMs": 4
},
"mcp.config": {
"id": "mcp.config",
"category": "mcp",
"status": "ok",
"summary": "MCP configuration is locally consistent",
"details": {
"configured servers": "3",
"disabled servers": "1",
"stdio servers": "2",
"streamable_http servers": "1"
},
"remediation": null,
"durationMs": 357
},
"network.env": {
"id": "network.env",
"category": "network",
"status": "ok",
"summary": "network-related environment looks readable",
"details": {
"proxy env vars": "none"
},
"remediation": null,
"durationMs": 0
},
"network.provider_reachability": {
"id": "network.provider_reachability",
"category": "reachability",
"status": "ok",
"summary": "active provider endpoints are reachable over HTTP",
"details": {
"ChatGPT base URL": "https://chatgpt.com/backend-api/ reachable (HTTP 403)",
"reachability mode": "ChatGPT auth"
},
"remediation": null,
"durationMs": 338
},
"network.websocket_reachability": {
"id": "network.websocket_reachability",
"category": "websocket",
"status": "ok",
"summary": "Responses WebSocket handshake succeeded",
"details": {
"DNS": "2 IPv4, 2 IPv6, first IPv4",
"auth mode": "chatgpt",
"connect timeout": "15000 ms",
"endpoint": "wss://chatgpt.com/backend-api/<redacted>",
"handshake result": "HTTP 101 Switching Protocols",
"model provider": "openai",
"models etag present": "true",
"provider name": "OpenAI",
"proxy env vars": "none",
"reasoning header": "false",
"server model present": "false",
"supports websockets": "true",
"wire API": "responses"
},
"remediation": null,
"durationMs": 1133
},
"runtime.provenance": {
"id": "runtime.provenance",
"category": "runtime",
"status": "ok",
"summary": "running standalone on macos-aarch64",
"details": {
"commit": "unknown",
"current executable": "<HOME>/.local/bin/codex",
"install method": "standalone (unix, package <HOME>/.codex/packages/standalone/releases/0.147.0-aarch64-apple-darwin, bin <HOME>/.codex/packages/standalone/releases/0.147.0-aarch64-apple-darwin/bin, resources <HOME>/.codex/packages/standalone/releases/0.147.0-aarch64-apple-darwin/codex-resources, path <HOME>/.codex/packages/standalone/releases/0.147.0-aarch64-apple-darwin/codex-path)",
"platform": "macos-aarch64",
"version": "0.147.0"
},
"remediation": null,
"durationMs": 0
},
"runtime.search": {
"id": "runtime.search",
"category": "search",
"status": "ok",
"summary": "search is OK (bundled)",
"details": {
"search command": "<HOME>/.codex/packages/standalone/releases/0.147.0-aarch64-apple-darwin/codex-path/rg",
"search command readiness": "file exists",
"search provider": "bundled"
},
"remediation": null,
"durationMs": 0
},
"sandbox.helpers": {
"id": "sandbox.helpers",
"category": "sandbox",
"status": "ok",
"summary": "sandbox configuration is readable",
"details": {
"approval policy": "OnRequest",
"codex-linux-sandbox helper": "none",
"execve wrapper helper": "<CODEX_TEMP_PATH>",
"filesystem sandbox": "restricted",
"network sandbox": "restricted"
},
"remediation": null,
"durationMs": 0
},
"state.paths": {
"id": "state.paths",
"category": "state",
"status": "ok",
"summary": "state paths and databases are inspectable",
"details": {
"CODEX_HOME": "<HOME>/.codex (dir)",
"active rollout files": "603 files, 972154568 total bytes, 1612196 average bytes",
"archived rollout files": "462 files, 613420854 total bytes, 1327750 average bytes",
"goals DB": "<HOME>/.codex/goals_1.sqlite (file)",
"goals DB integrity": "ok",
"log DB": "<HOME>/.codex/logs_2.sqlite (file)",
"log DB integrity": "ok",
"log dir": "<HOME>/.codex/log (dir)",
"memories DB": "<HOME>/.codex/memories_1.sqlite (file)",
"memories DB integrity": "ok",
"queue DB": "<HOME>/.codex/queue_1.sqlite (file)",
"queue DB integrity": "ok",
"sqlite home": "<HOME>/.codex (dir)",
"standalone release cache": "8 entries in <HOME>/.codex/packages/standalone/releases",
"state DB": "<HOME>/.codex/state_5.sqlite (file)",
"state DB integrity": "ok",
"thread history DB": "<HOME>/.codex/thread_history_1.sqlite (file)",
"thread history DB integrity": "ok"
},
"remediation": null,
"durationMs": 1067
},
"state.rollout_db_parity": {
"id": "state.rollout_db_parity",
"category": "threads",
"status": "ok",
"summary": "rollout files and state DB thread inventory agree",
"details": {
"default model provider": "openai",
"rollout DB active files": "603",
"rollout DB active rows": "603",
"rollout DB archive mismatches": "0",
"rollout DB archived files": "462",
"rollout DB archived rows": "462",
"rollout DB duplicate DB paths": "0",
"rollout DB duplicate rollout thread ids": "0",
"rollout DB malformed file names": "0",
"rollout DB missing active rows": "0",
"rollout DB missing archived rows": "0",
"rollout DB model providers": "openai=1065",
"rollout DB rows": "1065",
"rollout DB scan cap reached": "false",
"rollout DB scan errors": "0",
"rollout DB sources": "subagent:thread_spawn=475, subagent:other=286, vscode=212, exec=52, cli=40",
"rollout DB stale rows": "0"
},
"remediation": null,
"durationMs": 738
},
"system.environment": {
"id": "system.environment",
"category": "system",
"status": "ok",
"summary": "OS language en-US",
"details": {
"EDITOR": "not set",
"GH_PAGER": "set",
"GIT_PAGER": "set",
"LANG": "en_US.UTF-8",
"LC_ALL": "C.UTF-8",
"LC_CTYPE": "C.UTF-8",
"PAGER": "set",
"VISUAL": "not set",
"os": "Mac OS 26.6.1 [64-bit]",
"os language": "en-US",
"os type": "Mac OS",
"os version": "26.6.1"
},
"remediation": null,
"durationMs": 4
},
"terminal.env": {
"id": "terminal.env",
"category": "terminal",
"status": "ok",
"summary": "terminal metadata was detected",
"details": {
"COLORTERM": "truecolor",
"NO_COLOR": "1",
"TERMINFO": "/Applications/Ghostty.app/Contents/Resources/terminfo (dir)",
"TERM_PROGRAM": "ghostty",
"color output": "disabled (NO_COLOR)",
"effective locale": "C.UTF-8",
"stderr is terminal": "false",
"stdin is terminal": "false",
"stdout is terminal": "false",
"terminal": "Ghostty",
"terminal size": "80x24",
"terminal version": "1.3.1"
},
"remediation": null,
"durationMs": 11
},
"terminal.title": {
"id": "terminal.title",
"category": "title",
"status": "ok",
"summary": "terminal title default",
"details": {
"terminal title activity": "true",
"terminal title items": "activity, project-name",
"terminal title project source": "cwd",
"terminal title project value": "Projects",
"terminal title source": "default"
},
"remediation": null,
"durationMs": 0
},
"updates.status": {
"id": "updates.status",
"category": "updates",
"status": "ok",
"summary": "update configuration is locally consistent",
"details": {
"cached latest version": "0.147.0",
"check for update on startup": "true",
"last checked at": "2026-08-17T05:54:20.490686Z",
"latest version": "0.147.0",
"latest version status": "current version is not older",
"update action": "standalone installer",
"version cache": "<HOME>/.codex/version.json"
},
"remediation": null,
"durationMs": 291
}
}
}
What issue are you seeing?
When ChatGPT Desktop Remote and Codex CLI Remote Control are active on the same Mac/account, CLI-originated chats are visible in both the desktop app and the iOS ChatGPT Remote chat list, but they cannot be opened from the phone.
The desktop app shows CLI-originated chats with a lock indicator. On iOS, tapping the same chat returns:
Error loading messages: Codex server returned an error.
Desktop-originated chats continue to open successfully on the same iPhone, so the phone connection, account, pairing, and desktop Remote host are working. Fresh CLI chats fail in the same way.
The CLI Remote Control transport repeatedly logs:
target: codex_app_server_transport::transport::remote_control::websocket
HTTP 409 Conflict
{"detail":"Remote app server already online"}
This occurs before mobile message loading and appears to be a relay ownership collision between the Desktop and CLI Remote app servers, rather than missing local transcript data.
A workaround was observed after quitting the desktop app and rebooting/restarting the CLI session: CLI Remote could take over and the iPhone could open the CLI-originated chat. That workaround prevents normal simultaneous use of Desktop and CLI Remote.
What steps can reproduce the bug?
- Sign into Codex CLI with ChatGPT on a Mac.
- Pair ChatGPT Remote on an iPhone and confirm that chats created by the ChatGPT desktop app open successfully on the phone.
- Leave the ChatGPT desktop app running with its working Remote connection.
- Start CLI Remote Control with codex remote-control start.
- Start a fresh chat from Codex CLI.
- Observe that the CLI chat appears in the desktop app with a lock indicator and also appears in the iOS Remote chat list.
- Tap the CLI-originated chat on the iPhone.
- Observe: Error loading messages: Codex server returned an error.
- Inspect the structured CLI log target codex_app_server_transport::transport::remote_control::websocket; it repeatedly reports HTTP 409 with {"detail":"Remote app server already online"}.
- Quit the desktop app and reboot/restart the CLI session. In the observed workaround, CLI Remote then takes ownership and the iPhone can open the CLI chat.
What is the expected behavior?
Desktop Remote and CLI Remote Control should either coexist for the same account and Mac, or perform an explicit, reliable ownership handoff. A CLI-originated chat that appears in the iOS Remote chat list should load its messages when opened. The relay should not retain or assign ownership in a way that makes the CLI app server receive Remote app server already online while the thread remains visible but unusable.
Additional information
The Desktop and CLI enrollments were distinct local records. The Desktop record had a named desktop client, while the CLI/headless enrollment used a blank client name. Removing only the stale CLI enrollment caused it to be recreated with the same identity, and the relay continued returning HTTP 409; the Desktop enrollment was not altered. This suggests that deleting the local row alone does not clear the relay-side owner/lease.
A clean local app-server start also showed matching CLI and app-server versions, so local version skew was ruled out.
Possibly related:
- https://github.com/openai/codex/issues/24024 — Remote Control stuck with HTTP 409 / Remote app server already online
- https://github.com/openai/codex/issues/22705 — iOS thread is visible but message hydration fails
Structured CLI logs contain hundreds of repeated Remote WebSocket connection attempts returning HTTP 409 over three days. These are reconnect attempts, not unique chats. The response body is {"detail":"Remote app server already online"}.
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
- #38963
Powered by Codex Action
Reproduced on macOS 26.2 (Apple Silicon) with Codex standalone CLI 0.151.0 and ChatGPT desktop 26.818.61809.
I paired the Mac and iPhone through desktop Remote. Desktop-originated Codex chats open normally on the phone. A fresh interactive Codex CLI session started inside tmux appears in Remote, but tapping it returns Error loading messages. Retry indefinitely.
The CLI remote-control daemon logs repeated HTTP 409 Conflict responses with {"detail":"Remote app server already online"}. This is the same Desktop/CLI ownership collision described here.
The use case is supervising long-running multi-agent development: the CLI session must remain visible in tmux while also being steerable from an iPhone. An explicit ownership handoff or safe coexistence is needed.
Possibly related: I’m seeing this on macOS with Codex CLI and the managed daemon both on 0.160.0, and ChatGPT desktop 26.930.31730 (12947), which also bundles 0.160.0. I’m connecting from the Codex section of the ChatGPT iPhone app.
I used to be able to access a running CLI session from my phone. Now I can reproduce the following with a disposable test session:
- Start a session in the CLI, then open it on the phone. The phone shows: “Another Codex session is using this task. Finish and close that session, then try again.”
- Exit the CLI and retry on the phone. The same error remains.
- Force-quit and reopen the phone app. It can then open the session, but resuming it in the terminal shows: “This conversation is open in another app.”
- Quit both desktop and phone apps. The terminal can take over again, but I can’t access the running session from the apps.
I also ran codex remote-control start and codex remote-control pair, then manually entered the pairing code through Add Connection on the phone. The behavior persisted. Updating the desktop app so its bundled CLI matched 0.160.0 didn’t resolve it either.
Read-only inspection showed the task’s lock moving between the desktop app’s app-server process and the separate managed CLI daemon as I switched interfaces. I haven’t verified the HTTP 409 mentioned in this issue, so I’m not assuming the root cause is identical.
The phone error also matches #49243.
Is there a supported way to have the phone and terminal attach to the same running server/session, or is this an ongoing Remote ownership issue?
Seeing the same problem. I can't even look at the messages from my phone for any cli started session.
Reproduced a closely matching macOS/iPhone failure on desktop 26.1021.31345 (build 21828), bundled app-server 0.164.0-alpha.11.1 and managed daemon 0.164.0. The configured desktop updater reports up to date.
Read-only inspection shows the desktop stdio app-server and managed daemon have enrollment rows with the same server/environment/account/relay identity. The daemon is connected; desktop repeatedly receives HTTP 409, “Remote app server already online.” Existing chats are split between the two writer processes. Opening a desktop-owned chat from the paired iPhone shows “Another Codex session is using this task. Finish and close that session, then try again.” Local desktop work continues.
The user reports phone access worked previously. A network/transport outage preceded renewed remote setup, but the exact causal change is not established. We have not deleted locks, edited state, reset identity, restarted owners or uploaded sessions.
What supported configuration routes remote operations to each existing desktop/daemon chat owner, or safely consolidates them into one runtime while preserving original chat IDs/history, desktop tools/MCP/permissions, scheduled targets and running work? Please specify supported drain/idle semantics, including managed review sessions. Disabling only daemon remote control would shift which chats are reachable rather than establish access to all of them. Is there a fixed build or supported repair procedure for this arrangement?
I encountered the same issue.
I tried closing multiple Codex sessions, revoking access, and pairing my iPhone again, but nothing worked. I kept receiving the "Another Codex session is using this task" error.
Eventually, I discovered that the ChatGPT desktop app was causing the conflict.
Here's what worked for me:
- Completely quit the ChatGPT desktop app on my Mac.
- Open the ChatGPT app on my iPhone and hit Retry on the Codex session.
- Once the iPhone successfully connected, reopen the ChatGPT desktop app.
- Resume the Codex session in Warp Terminal.
After doing this, everything worked. I could access and control the same Codex task from my iPhone while keeping my Codex CLI session running locally in Warp Terminal, with the ChatGPT desktop app open as well.
The key was closing the ChatGPT desktop app before establishing the iPhone connection. Once connected, reopening the desktop app didn't cause the conflict to return.
Hopefully this helps anyone running into the same issue!
Product feedback: mobile progress viewing must work while the desktop CLI keeps running
I'm adding a concrete user need to this issue: I want to open ChatGPT on my phone just to monitor the progress of a Codex task that is still running in Codex CLI on my computer. Currently, attempting to view the same active task can show:
Another Codex session is using this task. Finish and close that session, then try again.
Asking users to finish/close the desktop session defeats the purpose of remote monitoring. An SSH/tmux workaround is not an acceptable substitute for the first-party ChatGPT mobile Remote Control experience.
Requested baseline behavior:
- Read-only/follower mode by default: Opening an active Codex task from mobile should display its existing conversation, live status/progress, and recent tool/terminal output without competing for or transferring the desktop session's writer lock.
- No interruption of local execution: The desktop CLI remains the executor and can keep working normally while the phone observes.
- Explicit control only when needed: Sending instructions or approving an action can use a deliberate, safe handoff or coordinated command queue, but simply viewing must never require closing the original session.
- Useful status and reconnect behavior: Show whether the task is running, waiting for approval, blocked, or finished; recover from temporary disconnects without forcing the user to restart the task.
Acceptance criterion: While a long-running Codex CLI task is actively executing on the computer, the same task can be opened in the ChatGPT mobile app for live, read-only observation, with no "another session is using this task" error and no interruption to the computer's work.
Please treat this as a fundamental Remote Control usability requirement, not an edge-case workaround.
Additional confirmed A/B reproduction: ChatGPT Desktop launch/update interrupts live CLI-to-Android Remote Control (Codex 0.165.0)
Environment: macOS Apple Silicon; standalone Codex CLI and managed app-server both 0.165.0; Ghostty CLI attaches to shared daemon via codex --remote unix://; ChatGPT Desktop, VS Code Codex extension, and ChatGPT Android app.
What happened (October 29, 2026):
- Ghostty CLI + shared managed daemon + Android Remote had been working, with the same live terminal thread accessible on Android.
- After restarting/updating ChatGPT Desktop, Android Remote access stopped.
- With Desktop open, the correct daemon command,
codex remote-control start --json, reported"status":"connecting","timedOut":true, whiledaemon.statuswasalreadyRunning(managed daemon, CLI, and app-server versions all 0.165.0). - Read-only process inspection showed three independent app-servers: the shared managed daemon (
app-server --remote-control --listen unix:// --managed-daemon), a ChatGPT-bundledCodexCLI.app/.../codex ... app-server, and a VS Code extension.../openai.chatgpt.../codex ... app-server. - Fully quitting ChatGPT Desktop without restarting the daemon or Mac immediately restored
codex remote-control start --jsonto"status":"connected","timedOut":false,"daemon":{"status":"alreadyRunning",...}. The user independently confirmed the live CLI thread worked on Android again.
This is a controlled operational comparison supporting Desktop startup/update as a trigger in this setup. VS Code had its own app-server during failure, but was not independently proven to cause this failure. On an earlier occasion Desktop and VS Code coexisted with working Mobile Remote, so the problem appears state/startup-order dependent, not an unconditional failure whenever Desktop is open.
Separate Desktop session-ownership behavior: ChatGPT Desktop shows This is open in another app on a thread owned by the terminal. That is distinct from this Remote Control transport/connection failure; mobile could interact with the CLI session when the managed daemon was connected.
Important diagnostic pitfall, verified against Codex 0.165.0 source: codex remote-control --json (without start) is not a passive status query; it launches a separate foreground Remote Control server, which can generate its own HTTP 409 Conflict / Remote app server already online. The correct daemon check for these observations was codex remote-control start --json. Earlier 409s were observed, but cannot all be attributed to ChatGPT Desktop because the foreground diagnostic could itself generate them.
Read-only enrollment evidence: remote_control_enrollments contained one unnamed/default client record with remote_control_enabled=NULL and one Codex Desktop record with remote_control_enabled=1. This does not by itself prove two live remote owners.
Request: Coordinate Desktop Remote registration/connection on app startup and update with the existing shared daemon, or provide a reliable handoff that preserves a live CLI session's mobile access. Also document or clarify the non-passive behavior of the bare codex remote-control --json command. No identity reset, deletion of locks, database changes, Mac reboot, or daemon restart was required for the final recovery.
I hit the same CLI-to-mobile handoff error with Codex CLI 0.169.0, managed app-server 0.171.0, ChatGPT desktop 26.1111.71704, and macOS 15.7.7.
- Leave an existing Codex CLI conversation open on the Mac.
- Open ChatGPT desktop on the same Mac.
- In the ChatGPT mobile app, select the connected Mac and open that existing conversation.
The mobile app displays: “Another Codex session is using this task. Finish and close that session, then try again.”
Read-only inspection showed that the managed app-server had both the affected conversation's rollout file and its thread writer-lock file open. ChatGPT desktop was also running a separate bundled app-server. I haven't confirmed an HTTP 409 or whether exiting the CLI releases the lock in this case.
I'd expect the mobile app to show the conversation and its progress while the terminal remains open, and to let me send a follow-up through the server that already owns it or offer an explicit handoff. If a handoff is required, the error should identify the owning client and provide a way to switch.