Repository navigation
Description
What variant of Codex are you using?
CLI (codex-cli 0.162.1) together with the Codex desktop app on macOS.
What feature would you like to see?
A supported CLI way to read the reply to a message queued with codex queue.
codex queue --thread <id> --message <text> delivers a message into an existing thread through thread/queue/add and returns as soon as it is queued. An external agent that sent the message, for example another coding agent coordinating work with the thread, then has no CLI command to:
- tell when its message was consumed by the thread, and
- read the agent messages the thread produced in response.
Today the only option we found is to start a short-lived codex app-server over stdio, send initialize, then page thread/items/list (descending, following nextCursor) until the delivered userMessage that carries a marker the sender put in its text, and print the following agentMessage items. thread/turns/list with the summary view does not help, because a queued message is delivered into the running turn rather than starting a new one. This works, but it depends on the experimental app-server schema and every caller has to reimplement it.
Proposal, either of:
codex thread read <thread> [--after <item-id> | --since <timestamp>] [--json], printing user and agent messages (not tool output or reasoning) in order, orcodex queue ... --wait-reply [--timeout <seconds>] [--json], which returns the queued message's item id once it is consumed and prints the agent messages that follow it, exiting non-zero on timeout.
Either would make codex queue usable as a request/response channel between agents without scraping rollout files or depending on experimental protocol details.
Additional information
Related: #45976 (sender identity and an input-consumed event for codex queue), #40397 (matching a reply to send_message_to_thread), #47193 (injecting into an existing session), #44662 (receipts between Codex and other agents). This request is narrower: the read side for the sender of a queued message.
Activity
HengYangDS commentedon Nov 7, 2026
Still missing in CLI 0.167.0:
codex queue --helphas--resume, but no reply-wait option, and the top-level help exposes no thread reader.The app-server item reader already accepts a cursor anchored to a message ID, so a CLI reader could reuse that pagination. It requires a
turnId, though, whilecodex queuedoes not expose the delivered message's item/turn IDs to the caller.A useful minimal contract would return those IDs once the queued message is consumed, then let the sender read later agent messages. Please distinguish “queued”, “consumed” and “a later agent message is available”; the last state should not imply that every subsequent message is a reply to that sender. Unsupported stores and timeouts should return explicit results rather than require transcript scraping.