[macOS][0.164.0] Completed CLI thread stays locked in Desktop after exit; agents Stop offers no handoff
What version of the Codex App are you using?
- ChatGPT/Codex desktop app: 26.1021.31345, build 21828.
- npm-installed CLI: codex-cli 0.164.0.
- The owning managed daemon runs from the 0.164.0-aarch64-apple-darwin package.
What subscription do you have?
ChatGPT sign-in; exact subscription tier was not collected.
What platform is your computer?
macOS 27.0.1 (build 26A434), Apple Silicon / arm64. Observed on October 26, 2026. This incident concerns switching between the local CLI and local desktop app on the same Mac; no SSH disconnect or mobile-client failure was needed in the observed sequence.
What issue are you seeing?
I waited until the CLI displayed “Worked …” and there was no ongoing task, then exited the CLI. Opening that same existing conversation in the desktop app was blocked with:
已在另一个应用中打开 请先在那边关闭会话,才能在这里继续。
English translation: “Open in another application. Close the conversation there to continue here.” The only recovery choices shown were Retry and Fork chat.
The CLI exit message suggested:
Stop the current turn: run codex agents, select this task, and press x.
I selected the affected task and pressed x repeatedly, but the desktop banner persisted. The task was already Ready in codex agents, so this was not a request to cancel an unfinished model turn.
What steps can reproduce the bug?
Observed sequence, not yet an isolated clean-profile reproducer:
- Use Codex CLI 0.164.0 with its shared managed app-server daemon.
- Finish a turn and wait for the CLI's “Worked …” completion message.
- Exit the CLI and try to continue the same conversation in the local desktop app.
- Observe the “open in another application” banner.
- Run
codex agents, select the affected Ready task, and pressx(Stop). - Retry in the desktop app. The conversation remains unavailable.
Read-only evidence and a targeted recovery attempt
The following checks were performed against the affected original thread:
- Its most recent saved turn was
completed. Runtime inspection returned{"type":"idle"}. codex agentsshowed the same task as Ready. Pressingxwhile it was selected did not produce a handoff or make the desktop conversation usable.lsofidentified the exact managed-daemon PID holding the affected thread's writer-lock file. Sanitized excerpt:
COMMAND PID USER FD TYPE NAME
codex 2069 <user> 400u REG <HOME>/.codex/thread-writer-locks/<thread-id>.lock
- The owning process was the managed daemon, while the desktop app had a separate app-server process:
<HOME>/.codex/packages/app-server-daemon/releases/0.164.0-aarch64-apple-darwin/bin/codex app-server --listen unix:// --analytics-default-enabled --managed-daemon
- During diagnosis, a separate local Unix-WebSocket connection rejoined this existing idle thread with
thread/resume/excludeTurns:true, then explicitly calledthread/unsubscribe. No prompt or model turn was submitted. The results were:
Initial thread status: {"type":"idle"}
Existing thread resume: {"type":"idle"}
Explicit unsubscribe: {"status":"unsubscribed"}
Target still loaded: True
The thread was still listed by thread/loaded/list after approximately 40 seconds. This confirms that this attempt did not immediately unload it; it does not prove that every other subscription was absent or that the documented 30-minute idle-unload deadline had expired.
We did not delete lock files, modify conversation history, stop the shared daemon, or submit a new turn to the affected conversation. Other conversations were running under that daemon, so restarting it would interrupt unrelated work.
What is the expected behavior?
A completed conversation should have an actionable way to move from the CLI to the desktop app while preserving its identity and history.
- Identify the actual owner and distinguish an active turn from an idle, retained writer.
- Provide a conversation-scoped Close / Release / Switch here operation that safely hands off an idle writer without stopping the whole shared daemon.
- Make the scope of
x/ Stop clear: stopping a turn and releasing a conversation are different operations. A Ready task needs a release path, not repeated Stop attempts. - If the reconnect grace period intentionally retains ownership, show that state and a safe explicit handoff option instead of instructing the user to close an unspecified application.
- Preserve the single-writer safeguard and avoid interrupting active turns or unrelated conversations.
Additional information / related reports
The official unsubscribe documentation describes a 30-minute no-subscriber/no-activity grace period. The observation above is consistent with delayed unload; the report is about the missing usable handoff after ordinary completion and exit, not proof that the cleanup timer never runs.
Related: #37403 (macOS CLI/Remote-to-Desktop ownership), #54738 (idle daemon owns writer), #56797 (0.164.0 Windows SSH-to-local incident), and #56378 (experimental explicit-unsubscribe handoff proposal).
This report adds a macOS 0.164.0 local CLI-to-local Desktop incident after normal turn completion, exact OS-level attribution of the target writer to the managed daemon, and the observed ineffectiveness of Stop on an already Ready task. Please consolidate with the appropriate ownership/handoff issue if these have the same root cause.
Personal paths, exact conversation IDs, project names, conversation content, credentials, and raw diagnostic logs are omitted.
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
- #56797
- #56378
- #56357
- #56936
Powered by Codex Action
I reproduced the local CLI-to-Desktop handoff problem on newer builds. I also verified that a daemon restart alone did not recover the original conversation.
- macOS 15.7.9 (24G830), Apple Silicon (arm64)
- ChatGPT/Codex Desktop 26.1117.31558 (build 29513), bundled app-server 0.171.0-alpha.13
- Installed CLI 0.171.0, managed app-server daemon 0.169.0-alpha.11.1
After I exited the interactive CLI, Desktop showed “This is open in another app. Close it there to continue here.” Retry failed with thread/resume error -32600 and already has an active writer. The last saved turn was complete, the daemon reported the thread as idle, and it was the only thread loaded in the daemon. lsof identified the managed daemon as the lock holder, and a nonblocking OS lock probe confirmed the writer lock was held.
codex app-server daemon restartreleased the lock. When I reopened the same conversation in Desktop, its resume failed again. The new daemon PID was now holding the same thread’s writer lock.- After checking that the daemon still had only this idle thread, I temporarily stopped it and reopened the original conversation. Desktop logged a successful
thread/resume, and its bundled app-server took the writer lock. The managed daemon was running again afterward, while Desktop retained the lock.
A conversation-scoped Continue here action could let Desktop attach to the owner or safely take over an idle thread, preserving the single-writer safeguard. If ownership cannot be transferred, the banner could identify the managed daemon as the owner so the recovery instructions point to something the user can act on.