You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
app-server: let local tools post to a thread the desktop app has open (and tell MCP servers their thread id) #54683
appIssues related to the Codex desktop appapp-serverIssues involving app server protocol or interfacesenhancementNew feature or requestmcpIssues related to the use of model context protocol (MCP) servers
We build Coordigent, which coordinates several coding agents (Claude Code, Cursor, Codex) working in one repo: it warns them about overlapping edits and relays messages between them.
For Codex we can only deliver a message when the person next types a prompt (UserPromptSubmit), because an idle chat runs no hooks. We tried to reach an open chat through app-server (codex-cli 0.154.0-alpha.6.2 and 0.162.1, macOS):
The desktop app runs its app-server over a private stdio socketpair, so no other local client can connect to it.
A separate app-server, or codex exec resume <id>, fails on a thread the app has open with thread … already has an active writer, and that holds even after thread/unsubscribe.
Within one app-server, turn/start from a second client in the same thread works and is shown live to the first client, which is exactly the behaviour we'd want.
Request 1: either
(a) let the desktop app run through the managed codex app-server daemon (opt-in is fine), so a local client can join it via the control socket, or
(b) a supported way for a local process to post a user message to thread <id> that appears live in the open chat (optionally asking the person before the turn runs).
Either would let tools wake an idle Codex agent visibly, with the person watching, instead of running unattended exec turns.
Request 2: tell MCP servers which thread they serve. The desktop app hosts every thread in one process, and MCP servers receive no thread id: CODEX_THREAD_ID isn't in their environment (an env_vars allowlist only copies Codex's own env), and initialize carries only clientInfo. So a server can't tell two threads in the same folder apart. A thread or session id in the MCP initialize params, or in each tools/call_meta, would fix it.
I’ve been working on the same problem in Pallium: delivering messages between existing coding-agent sessions. Our testing is on Windows Desktop, so this isn’t a reproduction of your macOS results, but there are a few useful distinctions.
We’ve had successful loaded-session wake through codex queue --thread. For unloaded Desktop tasks, we’ve also recorded payload delivery and acknowledgment through a genuine Desktop-launched MCP child using the inherited app-tools connection. However, that depends on a live authenticated child and a private interface. It doesn’t establish a supported external attachment contract or general restart reliability.
The important gap is safe admission. Reading the target’s state before sending cannot prevent it becoming busy before the request arrives. We need to preserve the existing Desktop owner, workspace and permissions, while ensuring a message waits for a separate turn rather than joining active work.
A supported API would ideally provide:
Exact-thread submission through the existing Desktop owner, including unloaded threads.
An atomic “queue without steering active work” operation.
A caller-supplied idempotency key and queryable admission result, so a lost response doesn’t leave us choosing between duplicate turns and indefinitely pending messages.
On request 2, our integration does receive per-request thread identity in some Desktop paths. Documenting and guaranteeing that metadata across supported clients would help.
Our integration notes describe the successful paths and remaining limits.
Same need from Dibs, a local coordination service for agent fleets. It reaches idle agents in Codex, Claude Code and other harnesses. Measured on macOS with ChatGPT 26.1013.40934 and the bundled CLI 0.163.0-alpha.10.2:
The app starts its own codex app-server with the default --listen stdio://. ~/.codex/app-server-control/app-server-control.sock exists but nothing listens (codex app-server daemon version: connection refused). So no documented endpoint reaches a thread the app owns.
Codex receives MCP server notifications but only logs them (rmcp-client/src/logging_client_handler.rs: on_resource_updated writes an info! line). An MCP server that already knows something changed for an idle thread has no in-protocol way to say so.
Either of the requests above would remove our use of private interfaces:
Exact-thread submission through the desktop owner, including unloaded threads, with an idempotency key and a queryable admission result.
Acting on server notifications for the thread that owns the connection, for example via MCP 2026-07-28 subscriptions/listen or a channel-style notification like Claude Code's notifications/claude/channel.
Request 2 in the original post, the thread id in initialize or _meta, would also let an MCP server tell two threads in one folder apart. We hit that too.
An update from the matching Claude Code request (anthropics/claude-code#102868), where the discussion made the requirements sharper. The same four apply here:
Two separable parts. (A) A local tool posts a message into a thread the app has open. It shows with a provenance label and needs no approval, because it does not start a turn by itself. (B) Optionally, a message to an idle thread starts a turn, if a setting allows it and the person approves. A can ship without B.
Delivery contract. Idle thread: queued, delivered as the next user turn. Busy thread: delivered at the next tool-call boundary, never inside a running tool call, in send order. The sender gets back whether the message was delivered or queued.
Stable target. The thread id stays the same across resume, and MCP servers can learn it, as this issue already asks.
One interception point. A delivered message goes through the same path as a typed user message, marked with its source, so existing integrations see it without learning a new event type.
Confirmed on Windows Desktop with a local orchestration client. A separate official App Server process could read the exact thread, but thread/resume returned already has an active writer even after its current turn had finished. After the desktop client released ownership, the same client resumed the original thread ID, submitted one harmless test turn, and read the completed reply back from that same thread. This confirms the gap is delivering to the current desktop owner, not resuming saved history.
Feature request: expose a permission-scoped, documented local operation that submits to the exact existing desktop thread without switching windows or acquiring a second writer. Deliver as a separate turn when idle, or queue for the next turn when busy without steering the active one. Please preserve the target thread's workspace and approval policy, and return a queryable receipt with a caller-supplied idempotency key and the resulting turn ID. Show the caller's identity in the desktop transcript. That would let authorized local orchestrators delegate and retrieve results without UI automation or duplicate submissions.
appIssues related to the Codex desktop appapp-serverIssues involving app server protocol or interfacesenhancementNew feature or requestmcpIssues related to the use of model context protocol (MCP) servers
Activity
github-actions commentedon Oct 16, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
rore commentedon Oct 17, 2026
I’ve been working on the same problem in Pallium: delivering messages between existing coding-agent sessions. Our testing is on Windows Desktop, so this isn’t a reproduction of your macOS results, but there are a few useful distinctions.
We’ve had successful loaded-session wake through codex queue --thread. For unloaded Desktop tasks, we’ve also recorded payload delivery and acknowledgment through a genuine Desktop-launched MCP child using the inherited app-tools connection. However, that depends on a live authenticated child and a private interface. It doesn’t establish a supported external attachment contract or general restart reliability.
The important gap is safe admission. Reading the target’s state before sending cannot prevent it becoming busy before the request arrives. We need to preserve the existing Desktop owner, workspace and permissions, while ensuring a message waits for a separate turn rather than joining active work.
A supported API would ideally provide:
On request 2, our integration does receive per-request thread identity in some Desktop paths. Documenting and guaranteeing that metadata across supported clients would help.
Our integration notes describe the successful paths and remaining limits.
0xaef commentedon Oct 22, 2026
Same need from Dibs, a local coordination service for agent fleets. It reaches idle agents in Codex, Claude Code and other harnesses. Measured on macOS with ChatGPT 26.1013.40934 and the bundled CLI 0.163.0-alpha.10.2:
codex app-serverwith the default--listen stdio://.~/.codex/app-server-control/app-server-control.sockexists but nothing listens (codex app-server daemon version: connection refused). So no documented endpoint reaches a thread the app owns.codex queue --thread <id>is the only supported way in, and it works when the thread is loaded. It isthread/queue/add, which is experimental, and it reports no admission result. A sender can't tell "stored" from "taken" (CLI: read the reply to a message sent with codex queue #54252), and an active/goalstarves it (Codex App: an active /goal starves the external queue; codex queue items wait for a manual Steer #52705).rmcp-client/src/logging_client_handler.rs:on_resource_updatedwrites aninfo!line). An MCP server that already knows something changed for an idle thread has no in-protocol way to say so.Either of the requests above would remove our use of private interfaces:
subscriptions/listenor a channel-style notification like Claude Code'snotifications/claude/channel.Request 2 in the original post, the thread id in
initializeor_meta, would also let an MCP server tell two threads in one folder apart. We hit that too.feat(lanes): lane-bus send prints a paste-ready wake line for Codex (#…
ali8hsn commentedon Oct 30, 2026
An update from the matching Claude Code request (anthropics/claude-code#102868), where the discussion made the requirements sharper. The same four apply here:
NagisaShip commentedon Nov 26, 2026
Confirmed on Windows Desktop with a local orchestration client. A separate official App Server process could read the exact thread, but
thread/resumereturnedalready has an active writereven after its current turn had finished. After the desktop client released ownership, the same client resumed the original thread ID, submitted one harmless test turn, and read the completed reply back from that same thread. This confirms the gap is delivering to the current desktop owner, not resuming saved history.Feature request: expose a permission-scoped, documented local operation that submits to the exact existing desktop thread without switching windows or acquiring a second writer. Deliver as a separate turn when idle, or queue for the next turn when busy without steering the active one. Please preserve the target thread's workspace and approval policy, and return a queryable receipt with a caller-supplied idempotency key and the resulting turn ID. Show the caller's identity in the desktop transcript. That would let authorized local orchestrators delegate and retrieve results without UI automation or duplicate submissions.