Repository navigation
Description
What variant of Codex are you using?
CLI + ChatGPT iOS Remote Control (paired hosts)
What feature / fix would you like?
Support the normal workstation-primary workflow:
- Start and run the task in Codex CLI on the workstation
- Use the phone only to monitor progress, approve actions, and send short steering replies
- Return to the same live CLI session without quit/resume or forking
Today, Remote Control effectively allows the phone to open completed threads, but fails when the workstation CLI already owns a live / in-progress session.
Why this matters
Almost nobody’s main coding surface is the phone. The realistic loop is:
- keyboard + terminal on the workstation
- phone as a second screen for status + decisions while away from the desk
Claude Code Remote Control (/rc) matches this model: the local CLI session stays primary; mobile is another window into the same live session.
Codex Remote currently behaves more like: “pair a host → operate threads from mobile,” and does not reliably share an already-attached live CLI session with iOS.
What happens today (observed)
| Session state | iOS Remote result |
|---|---|
| Completed (no active CLI attach) | Opens and reads normally |
| Live / in-progress CLI session | Fails to load |
On the failing live session, iOS shows:
加载消息时出错:Codex 服务器返回了错误。
(“Error loading messages: Codex server returned an error.”)此任务无法重新连接
(“This task cannot reconnect”)
So the phone can act as a history viewer for finished threads, but cannot attach to the live session the CLI already owns.
Expected behavior
- Workstation CLI remains the primary client
- iOS can attach to that same live thread as a secondary client
- Monitoring, approvals, and short follow-ups work without forcing the user to start the task from mobile
- Returning to the workstation TUI does not require quitting and
resume, and does not create divergent continuations
Actual behavior
- Completed threads: OK from iOS
- Live CLI-attached threads: iOS cannot reconnect / server error
- Practical workaround pushed by the product shape: start work from Remote/App side instead of CLI — awkward for workstation-first developers
Suggested direction
Any of:
- Explicit multi-client live attach (CLI + mobile on the same thread)
- Or a clear “monitor/approve-only” secondary session mode for Remote
- Or document and enforce single-writer rules without hard-failing the phone on live threads (e.g. read-only view + queued approvals)
Related: #32445, #34632, #23011
Additional information
No response
Activity
github-actions commentedon Aug 11, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
already has an active writerafter latest update #37403Powered by Codex Action
[-]Remote Control cannot attach to a live CLI session on the workstation (phone is monitor-only; completed threads work, in-progress ones fail)[/-][+]Remote Control cannot attach to a live CLI session on the workstation (completed threads work, in-progress ones fail)[/+]seanpianka commentedon Aug 16, 2026
I can reproduce this exact iOS Remote error on macOS, with a more specific discriminator.
iOS displays:
Error loading messages: Codex server returned an error.
This suggests the boundary may be paginated-history handling in the mobile/cloud Remote path, rather than only whether the CLI thread has an active writer.
iOS ChatGPT version: 1.2026.209
I can provide a feedback/session ID and sanitized logs privately.
pps83 commentedon Aug 17, 2026
Crazy this thing isn't implemented; and its partial impl is so flawed: control commands (to view/compact context for example) do not work from mobile
jdcodes1 commentedon Aug 18, 2026
Your completed-vs-live table matches a specific mechanism in the thread store: cross-process writer locks. Every live thread holds an exclusive lock file under
$CODEX_HOME/thread-writer-locks/(https://github.com/openai/codex/blob/1f41cc5d92/codex-rs/thread-store/src/local/writer_lock.rs#L17-L34). The workstation TUI's process owns that lock for the in-progress session; when the Remote Control daemon — a different process — tries to open the same thread for iOS, the acquisition fails and surfaces as the generic "Codex server returned an error." Completed threads hold no writer lock, so they open fine. The same single-writer constraint is what blocks/fork-then-resume in another terminal (#38144, #38297) and produces the empty two-instance replay in #37987.So "phone as second screen on the live session" needs one of: (1) a read-only attach path that never takes the writer lock — enough for monitoring, and probably the quick win; (2) routing mobile steering/approvals through the process that owns the lock (the app-server multi-client machinery exists; the remote-control daemon would proxy into the owning session rather than opening the thread itself). Option 2 is the Claude-
/rc-style behavior you're describing; option 1 could ship first and already covers monitoring.rodjac-lab commentedon Aug 21, 2026
I can reproduce a closely related paginated-history failure on Android, with the important distinction that live steering still works: the phone can send a new message and receive the reply, but opening the thread is slow and the beginning of the conversation is not rendered.
Environment:
codex-cli 0.149.0codex app-server --remote-control --listen unix://, directly supervised by a user systemd service1.2026.230history_mode = paginatedThe history is intact and locally readable. I queried the running app-server over its Unix WebSocket:
thread/turns/list, ascending,itemsView: summarynextCursor: nullthread/turns/list, ascending,itemsView: fullnextCursor: nullthread/read,includeTurns: trueThe returned turn statuses are
interrupted,completed,completed,completed,inProgress. The first user messages and assistant replies are present in both the rollout andthread_history_1.sqlite; the projection byte offset is current. There is no host-side read error in the app-server journal.This produces two user-visible symptoms:
The large full response can explain some latency, but not why the beginning is absent. The 12 KB summary response contains enough information to enumerate every turn, so this looks consistent with a mobile/cloud Remote paginated-history handling problem rather than lost host data or a writer-lock failure.
This is still reproducible on Android app
1.2026.230, newer than the iOS build reported above. Happy to provide sanitized protocol output if useful.rodjac-lab commentedon Aug 21, 2026
Confirmed temporary workaround on Fedora:
A live test against the 0.149 server created a normal user thread with history_mode=legacy, while the server remained connected to Android. The server records cli_version=0.149.0 because it owns the thread, but the history contract is legacy.
This matches the tagged source: the 0.149 TUI explicitly sends ThreadHistoryMode::Paginated for non-ephemeral new threads, while 0.146 leaves history_mode unset and the app-server default remains legacy.
This does not convert existing paginated threads, but it provides a workable CLI-first path for newly created threads while retaining the current Remote server and its mobile connection.
jcorreia commentedon Aug 22, 2026
This happens also to me with android, macbook and cmux.
erhanuenlue commentedon Aug 22, 2026
Same issue, on my macbook iTerm session and iphone app.
Anlittledy commentedon Aug 26, 2026
I reproduced the same issue with VS Code + iPhone Remote Control: an active thread owned by VS Code cannot currently be opened on the iPhone, even for viewing. I added OS-level writer-lock evidence and a proposed read-only observer + “Take over here” handoff flow in #40157.
pstayets commentedon Aug 26, 2026
A workaround shaped differently. If you start the task as
shell codex, the live PTY is exactly what the phone gets, there is no separate attach step or writer lock to fight, the browser link and the workstation terminal are the same session. Disclosure, I work on Pilot Protocol, which develops shell.online. The limitation, it only helps for sessions launched through it, it cannot adopt an already-running bare codex.5 remaining items
danjurgens commentedon Sep 9, 2026
Reproduced on current builds, with deterministic host-side writer-lock evidence and an additional /fork variant.
Environment:
Reproduction and evidence:
Keep a standalone Codex CLI thread open and active on the Mac.
Enable Remote through ChatGPT Desktop. The phone reports connected and lists the CLI thread.
A different thread with no active CLI writer opens successfully on iOS, so enrollment, relay connectivity, and authentication are healthy.
Opening the active CLI thread on iOS fails to load the chat.
At that exact time, the Desktop remote app-server receives thread/resume and logs:
failed to initialize thread persistence: thread-store conflict: thread already has an active writer
Failed to create session: thread-store conflict: thread already has an active writer
Running codex remote-control from the shell while the Desktop Remote enrollment is live starts app-server and then reports:
Error: Remote control is enabled on but the connection is errored.
Forking the active CLI thread does not provide a workaround. After two forks, the same original CLI PID held the writer-lock descriptors for the parent and both fork thread IDs. iOS then attempted thread/resume for the parent and a fork; both failed with the same active-writer conflict. Neither fork could be opened remotely.
The /fork lock retention overlaps #38144. The additional Remote impact here is that every fork remains unopenable from iOS while the originating TUI remains alive, so forking cannot create a remotely attachable branch.
Expected behavior: Remote should attach to or route through the live CLI app-server so the phone can monitor and steer the same in-progress task. At minimum, opening should fall back to a read-only follower view instead of treating the expected single-writer conflict as fatal. This matches the documented workstation-primary use case of continuing existing chats and steering active work from a phone: https://learn.chatgpt.com/docs/remote-connections
Privacy: host name, thread IDs, account and enrollment identifiers, repository paths, prompt contents, and raw logs are omitted. The raw INFO logs contain request headers, so only the relevant sanitized error lines are included here.
benthorp commentedon Sep 18, 2026
Reproduced on current builds on macOS (Apple Silicon) on 2026-09-17/18 UTC:
0.154.0, launched from a terminal and kept running.26.915.31029, bundled Codex0.155.0-alpha.9; updated and restarted before retesting.codex_chatgpt_ios_remote 1.2026.244.The active CLI thread appears in Remote, but opening it on iOS fails to load the messages. A new thread started from iOS on the same host works. This reproduces with CLI threads in both a regular checkout and a separate worktree.
The desktop app's attempt to open the same CLI-owned thread gives a useful request sequence at
2026-09-18T00:25:56Z:The desktop UI then logs
Failed to resume conversationandFailed to load older thread historywith the writer conflict. iOS Remote attemptsthread/resumefor the active thread and receives the same conflict. The owning CLI process remains healthy and holds the expected writer lock. No lock file was changed.This narrows the failure: stored history is readable, but the client treats a failed writable resume as a failure to display that history. A read-only transcript fallback would help immediately; monitoring and steering the active session would require routing through its existing owner. The update to Desktop
26.915.31029did not resolve it.Private thread IDs, repository names, paths, prompts, and raw logs are omitted.
sun-binwen commentedon Sep 23, 2026
Additional Windows + WSL2 reproduction and a read-only Desktop use case (2026-09-23):
26.915.4065.0, with Codex CLI0.155.1running inside WSL2 through a configured SSH host. ChatGPT Remote on iPhone is paired to the Windows host.lsofshows the livecodex --yoloprocess holding that thread's<CODEX_HOME>/thread-writer-locks/<thread-id>.lock. The remote app-server log repeatedly reportsthread-store conflict: thread <redacted> already has an active writerwhen that thread is opened from Remote. I did not delete the lock or stop the running CLI task.Before recent updates, I could keep a WSL CLI conversation open and also open the same conversation in the Desktop app and on my phone. My normal workflow is CLI-primary: the CLI does the work, while the Desktop app is much more convenient for browsing earlier messages, copying and pasting content, or exporting the conversation to Markdown. I rarely need to write to the same thread from two clients at once.
Please allow the Desktop app and iOS Remote to open and display a CLI-owned conversation in a read-only follower mode when they cannot acquire its writer lock. Reading, copying, and exporting history should not require taking writer ownership. If a secondary client sends a new message or tries to steer, it could route through the existing owner or offer an explicit handoff, rather than making the whole transcript unavailable.
Thread IDs, local paths, account details, and conversation contents are omitted.
Follow-up: After the competing writer was no longer holding the WSL thread, the iPhone could open that same thread. The phone pairing and SSH connection did not need to be changed. This confirms that the observed failure is tied to concurrent ownership of this specific thread, not a general inability to access WSL. The request for read-only access while the CLI remains open still stands.
Taeu commentedon Sep 25, 2026
Additional macOS reproduction: active CLI thread spins indefinitely; a completed CLI thread opens
Observed on 2026-09-26 (UTC+09). Adding symptom-level corroboration here because the active-versus-completed contrast matches this report. A writer-lock failure has not been established in this case; large-history loading (#38653) remains another candidate.
User-observed behavior
The reported symptom is persistent loading, not a captured error toast. Mobile OS and exact ChatGPT mobile version have been requested but are not yet recorded.
Locally verified environment and storage snapshot
codex app-server daemon version: running managed app-server 0.154.0, local command 0.154.0. This is the managed daemon version, not a claim about the desktop-bundled runtime.These are local storage sizes, not measured mobile payload sizes. The opening control is also substantial and has a larger single stored turn, so this comparison does not establish a simple size threshold. It also does not isolate writer state: the two sessions have different histories. A same-session active/idle retest has not been performed.
Read-only checks found the original rollout and populated turn/item index for the affected session, with no orphan projected items.
codex migrate-rollouts --thread <redacted> --jsonreportsalready_paginated. This is not a full storage-integrity certification. No mobile-correlated RPC trace or confirmed root cause has been captured.Requested behavior: opening an active session should show recent messages and progress promptly. If writable resume is unavailable, please offer a readable follower view or an actionable error rather than an indefinite loading screen. Preserve complete history and use bounded initial paging.
No session database, writer lock, enrollment, or original rollout was edited. Task names/IDs, local paths, account/host identifiers, prompts, and raw logs are omitted.
Prepared and posted by Codex with the account owner's explicit authorization.
Taeu commentedon Sep 25, 2026
Follow-up to my earlier report: we now have host-side writer-conflict evidence for the currently affected CLI thread.
Environment: macOS / Apple Silicon, local Codex CLI 0.157.0, managed Remote app-server 0.154.0. The local launcher is a small wrapper around
codex --yolo --search; it does not connect the TUI to the Remote daemon.While the CLI-owned thread remains open, the managed app-server repeatedly logs:
These entries identify the same thread that is failing to open in Remote. A metadata-only read is not sufficient to prove that mobile can attach. This is stronger evidence than my earlier symptom-only report, although we have not captured a full mobile RPC trace or isolated the effect of the CLI/server version difference.
Initially this looked like a restriction on
--yolo, but the observed failure is a competing writer, not a documented rejection of full-access permissions. Please make this distinction visible in the UI rather than leaving the user waiting on a loading screen.The desired workflow is straightforward: start work in the terminal, then connect the phone to that same live session without interrupting it. In my experience Claude Code's
/rcprovides this with a single command. Please consider an equally simple in-session attach/adopt flow for Codex that routes Remote through the existing execution owner, preserves the user's explicitly chosen approval/sandbox settings, and clearly displays the effective permissions. If full control cannot attach, a read-only progress/history view would still be far better than a loading failure.We are preparing a stop/resume migration to a shared app-server (
codex --yolo --search --remote unix:// resume <thread>), with server-side permission verification. This is a workaround under test, not yet a claim that mobile reconnection is fixed. Users should not have to understand writer-lock ownership or manually migrate their session just to check their running work from a phone.Thread IDs, local paths, task details, and raw logs are omitted. Posted by Codex with the account owner's explicit authorization.
Taeu commentedon Sep 25, 2026
Additional follow-up from another CLI session on 2026-09-26 (UTC+09): the basic request was simply, “Connect this current session so I can see it in ChatGPT Remote.” It still turned into an extended diagnostic exercise without a verified connection to that session.
Observed in this attempt:
codexcommand resolved by the agent's shell are 0.154.0. This version/path difference is reported as context, not an established cause.codex app-server daemon versionreports a running daemon.codex app-server daemon enable-remote-controlreturnsstatus: "alreadyEnabled"andremoteControlEnabled: true.codex remote-control --jsonexits with status 1 and only:Error: Remote control is enabled on <redacted-host> but the connection is errored.Despite--json, this failure was plain text and supplied no actionable reason or recovery step.The user-facing problem is that “Remote enabled on a daemon” is not the same as “this current session is remotely reachable,” yet the workflow provides no simple way to bridge or clearly distinguish these states. Even asking Codex itself to perform the setup led to command discovery, version checks, logs, and protocol investigation instead of a connection. Some of that diagnostic overhead is agent behavior, but the product needs a straightforward supported path that avoids it.
My expectation, based on using Claude Code's
/rc, is one in-session action that makes the existing live terminal session available on my phone. Please provide an equivalent/rc-style flow (or clearly expose the supported equivalent) that:Users should not need to understand app-server ownership or troubleshoot their Codex installation just to check a running session from a phone. This remains a basic usability blocker for a terminal-first workflow.
Only manually reviewed, sanitized command results are included. Host/account/enrollment identifiers, session IDs, local paths, task contents, and raw logs are omitted. Posted by Codex with the account owner's explicit authorization.
hippoley commentedon Sep 26, 2026
The writer-lock evidence here suggests a useful distinction that may help narrow the product shape:
A live CLI can remain the single execution owner without requiring a phone to acquire a competing thread writer just to do two narrower things:
So a writer conflict could be an expected state rather than a fatal “cannot load” state: fall back to follower mode, and route resolver actions through the current execution owner using the same thread/request identity.
I’m testing this exact boundary shape in a small open-source prototype, mainly to see whether the abstraction survives real cases rather than to propose it as a Codex workaround. There’s a Codex-specific browser probe here:
https://hippoley.github.io/PAJ-Eval/human/?scenario=codex
The question I’d be especially interested in from people on this thread: would read-only + approval/clarification routing be enough as a first secondary-client mode, or is full steering of the live CLI session essential from day one? That split seems important for avoiding unnecessary multi-writer semantics.
hendryyeh commentedon Sep 29, 2026
The table in the opening post is the crux: the phone fails exactly when it has to become a second writer on a thread the CLI already owns. @hippoley's owner ≠ follower ≠ resolver split is the shape that avoids that — the phone never opens the thread, it only reads progress and hands input back to the process that owns it.
Until Remote works that way, there are a few workarounds: in this thread, @rodjac-lab's pinned app-server + TUI client and @pstayets'
shell codexroute. One more:Disclosure: I work on CodeVibe, which is built on exactly that model, so weigh this accordingly. You start Codex with
codevibe-codexinstead ofcodex(it runs the normal Codex CLI inside tmux). The phone app (iOS/Android) then shows that live session as it runs, and anything you send or approve from the phone is typed into the same terminal session. The CLI stays the only writer, so the writer-lock conflict never comes up, and the terminal carries on untouched when the phone disconnects. The desktop connects outbound, and session content is end-to-end encrypted between your machine and your phone.The limitation: it can't adopt a session you already started with plain
codex— you launch through the wrapper.https://quantiya.ai/codevibe
A first-party follower mode would be strictly better; this is only for anyone who needs the workflow today.
etraut-openai commentedon Oct 26, 2026
(response from codex)
Closing this as fixed for the default CLI workflow. Starting with Codex CLI 0.157.0, plain
codexstarts or reuses the shared local daemon. With Remote Control enabled and your phone paired to that daemon, you should be able to open and steer the same live thread from your phone while the workstation TUI stays open. Release notesThanks for capturing the host logs. They showed why completed threads opened but live ones failed. The CLI’s embedded app-server held the live thread’s writer lock, so the separate Remote app-server got
already has an active writerwhen the phone tried to resume it.If you still see this on the current release, please start a fresh thread with plain
codex, confirm/statusshows Local background server, and open that thread from the paired phone while a turn is running. If it fails, please comment with your CLI and mobile app versions so we can reopen and investigate.MarioMartReq commentedon Nov 6, 2026
I'm still encountering the reported symptom: while a session is open in the terminal, I can't access that same session from the phone app. The CLI currently installed on my host reports
codex-cli 0.167.0.I haven't yet verified the fresh-thread, Local background server, and phone-pairing checks from the closing comment, so I can't confirm that this is a regression in that workflow.
sonofsmog commentedon Nov 8, 2026
Please reopen this issue. The live CLI-to-mobile workflow is still broken for me on Windows + Android as of November 8, 2026, and has been failing for weeks.
Confirmed directly from the running CLI's /status screen:
My Windows desktop app and Android ChatGPT app are current according to my installed updates; exact desktop/mobile build numbers have not been collected. The CLI version above is the observed version, not a claim that it is the newest available release.
This blocks both monitoring an actively running task and answering when the CLI is waiting for input. Waiting for the turn to finish does not make the conversation accessible while the CLI session remains open. Closing the CLI defeats the purpose of remote monitoring and steering.
The closing comment says Local background server should support opening and steering the same live thread while the workstation TUI remains open. My status screen confirms that server mode, yet mobile still refuses access. Whether the desktop/mobile connection is routed to that exact same daemon has not been verified; if that is required, the product needs to make that clear and diagnose the mismatch instead of giving this generic dead end.
Please investigate and reopen rather than treating this workflow as resolved. Claude Code's equivalent remote workflow works for me. I can provide sanitized diagnostics; no private session contents or account identifiers are included here.
etraut-openai commentedon Nov 8, 2026
@sonofsmog, this issue was fixed as reported. If you are seeing a similar issue in the latest build, please open a new issue and provide all of the requested details in the bug report template.
Kregnach commentedon Nov 24, 2026
I would also like to emphasize the importance of this workflow. I regularly use both Claude Code and Codex under WSL2. Claude Code's
/remote-controlcommand allows me to seamlessly continue an existing terminal session from my phone.With Codex, I have encountered WebSocket connection errors and difficulties establishing the equivalent workflow.
It would be highly beneficial to have a simple
/remote-controlcommand directly within an active Codex CLI session, without requiring additional daemon configuration or session management.This is currently one of the main reasons I prefer Claude Code for long-running development tasks.
etraut-openai commentedon Nov 24, 2026
@Kregnach, a new
/rc(alias/remote) slash command will be included in the next release.