Repository navigation
Description
What variant of Codex are you using?
CLI (codex-cli 0.164.0-alpha.3, Linux, interactive TUI)
What feature would you like to see?
A supported way for a local script or another agent to send a message to a running, idle Codex session that:
- starts a turn (wakes the session), and
- is not presented as a user message, either in the TUI or to the model.
Today
codex queue --thread <id> --message <text>wakes an idle session. But the item is user input. The TUI draws it exactly like an operator prompt (› textwith the user-message background), and it reaches the model asrole: "user".thread/queue/addaccepts only user input too.- Hooks render distinctly and reach the model as developer context.
PostToolUseshows↳ Hook · <text>, andStopwithdecision: "block"shows• Blocked by hook └ <text>. But they only work during an active turn. A background hook that finishes while no turn is active waits for the next user turn and does not start one.
So when the recipient is idle, the only route is one that looks and acts like the human typed it. In a terminal with several agents messaging each other, the operator can no longer tell their own messages from agent traffic. The model also gets agent-written text at user authority.
Request (any one would solve it)
- A non-user delivery kind for the queue, for example
codex queue --as developer --from "<label>"(and the same field inthread/queue/add). The item starts a turn when the session is idle. It reaches the model as developer context, and the TUI draws it as an attributed notice (e.g.↳ Message from <label> · <text>), not as a user prompt. - Let a background command hook start a turn when the session is idle, for example on exit code 2 or a
wake: trueoutput field. ItsadditionalContextis delivered as developer context, andsystemMessageis shown as a notice.
Why it matters
Local multi-agent setups need agent-to-agent messages that wake the recipient but keep provenance. That covers a worker reporting back to a coordinator, or a script relaying a result. Today the choice is between "wakes but impersonates the user" (codex queue) and "keeps provenance but cannot wake" (hooks).
Additional information
Related, but not the same request:
- Subagent can inject agent-authored queued content as role:"user" in parent thread #45456: agent-authored queued content becomes
role: "user"(provenance loss, from the subagent side). - Allow async Stop to start a same-session continuation (KV cache) #38221: allow an async
Stophook to start a same-session continuation. - codex queue: support steering the active turn (queue item delivery mode) #48928: steer mode for
codex queue.
Activity
sly321-pixel commentedon Oct 23, 2026
Additional evidence from a Desktop workflow and a controlled four-host SDK validation.
Machine-generated completion events must retain tool-level authority. They must not impersonate the human through user messages,
UserInput, plain-text prompts, or user-inputturn/steer. The human must retain a direct way to add constraints or cancel the owned work from the originating chat, without first draining or deleting machine-generated follow-ups.Minimal reproduction of the problematic delivery pattern
The backlog was observed in a macOS Desktop workflow. The following is a reduced, synthetic reproduction recipe for the same delivery pattern; it is not a claim that we repeated the old Desktop failure on all four hosts.
Use a disposable Desktop chat with no business work. Have the human request a harmless blocking command that waits about 60 seconds.
While that turn is active, simulate ten distinct job-completion callbacks from another terminal:
Inspect the pending items and subsequently persisted history. This path creates user-input follow-ups; the receipt text is not merely an unread notification.
From the original Desktop chat, try adding a constraint or stopping the test while these items are pending. Check whether doing so requires queue management or manually steering around the machine follow-ups.
Our observed failure was a long list of machine-authored user follow-ups competing with human intervention. Per-job “send once” guards did not solve it: ten different jobs still produced ten user items. A successful queue command only established enqueueing, not consumption or acceptance of a result.
Existing official mechanism and what we validated
PR #44086 already provides Python SDK
ExternalMessage. We used that mechanism rather than inventing another user-message delivery route.On 2026-10-23 we ran the same controlled, read-only acceptance workflow on four independent hosts: two macOS arm64 and two Windows x64. All used
openai-codex==0.163.0and its paired CLI0.163.0, with explicitSandbox.read_onlyandApprovalMode.deny_all. The model wasgpt-6.1-sol.The same one-shot SDK process created and retained its test thread, held the native job handle and a control channel from the originating chat, and delivered terminal receipts through
ExternalMessage. We did not resume or take over a Desktop-owned thread. These are SDK-owned-workflow results, not evidence that Desktop's existing queue has been fixed.Per host, 13 terminal receipts were accepted in four
functionCallOutputitems, including a batched group of ten. The onlyuserMessagewas the actual human's constraint forwarded through the control channel; machine receipts produced zero user messages. The idle and busy sums matched the answer key (17 and 48). Replaying a processed receipt after reloading the local ledger caused zero model dispatches.The ledger, batching, control channel and precise process cancellation were application-side responsibilities in this test, not features claimed to be automatically supplied by
ExternalMessage. The injection result is limited to the tested fixture.One Windows host needed a same-account interactive-session one-shot bridge after an SSH Session 0 child-start failure (
0xC0000142). The bridge was removed afterwards; sandbox and approval policies were not relaxed. The other Windows host passed directly over SSH.A cancellation detail matters: an SDK turn reporting
interruptedis not sufficient proof that a separately running native job exited. We canceled the exact process handle owned by the test and verified its exit and absence of its completion marker.Requested boundary for a Desktop/CLI solution
Please preserve machine events as attributed, untrusted tool data, below human and developer instructions. A source label is not proof of identity, authorization, or approval. Arbitrary job output should not be promoted to developer authority either.
Idle wakeup and busy-turn delivery should preserve that boundary, while genuine human constraints and cancellation remain accessible independently of event backlog. Changing machine callbacks to user-input steering would not meet this requirement. Cancellation acceptance must include the owned work's actual exit.
Our immediate mitigation was to stop the local user-queue callbacks. Where an existing job lacked an SDK owner/control path, we retained its terminal receipt and explicitly reported that automatic continuation was not armed. We did not fall back to user impersonation or model polling.
All examples and host labels above are synthetic or anonymized. No private screenshots, raw histories, usernames, machine names, paths, thread/turn/job IDs, or business data are attached.
etraut-openai commentedon Oct 26, 2026
(response from codex)
Codex CLI 0.165.0 will address the wake-up part of this request.
Plain
codex queuecan already wake an idle thread while it’s loaded. After the last client disconnects, the app server can unload the thread. In 0.165.0, a script will be able to ask the app server to resume it after saving the message:jcdrive commentedon Oct 29, 2026
This did not seem to launch in 165? https://github.com/openai/codex/releases/tag/rust-v0.165.0
jwade83 commentedon Nov 20, 2026
Hi @etraut-openai and @aibrahim-oai — could you confirm the supported integration boundary here, or route this to its current owner? Your Goals runtime and ExternalMessage changes directly overlap with our working setup.
We have Codex workers across Mac, Linux and Android/Termux, authenticated NATS/JetStream transport, durable project records, activity discovery by name, verified worker results, and automatic delivery to an originating Codex desktop chat. Our current delivery uses
codex queueplus a wake link and transcript verification.We want the coordinator to evaluate completed work and advance an authorized project objective, while the user can still steer it from the original chat.
We understand that SDK
ExternalMessagepreserves tool-level authority. We have not established that a separate SDK client can safely deliver into an existing desktop-owned thread. The distinction between SDK-owned and desktop-owned threads in this issue is therefore central.Could you clarify:
Our acceptance test would deliver a remote result during an active Goal, restart the coordinator, replay the event, and verify useful continuation in the original conversation without duplicate worker dispatch or lost human control.
A supported example, minimum versions, or an explicit statement that this desktop integration is not currently exposed would help us choose correctly.
Broader project-ownership context: discussion #62436.
Thanks,
John
johnmwhitman commentedon Nov 29, 2026
Does Codex Desktop expose a supported read-only observation from the App Server that actually owns an existing thread? For one protected delivery, the caller needs the authenticated host and serving instance, exact thread and expected terminal turn, and an affirmative current idle and complete activity reading. We need to bind both readings around the empty-queue observation to that same serving instance. Is an equivalent atomic, server-checked attributed enqueue available with the expected terminal turn, idle and empty-queue preconditions? If neither exists today, which maintainer owns the Desktop integration surface?