Skip to content

CLI: read the reply to a message sent with codex queue #54252

Open

Description

@HengYangDS

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:

  1. tell when its message was consumed by the thread, and
  2. 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, or
  • codex 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

  1. added
    enhancement
    CLI
    app-server
    on Oct 15, 2026
  2. HengYangDS commented on Nov 7, 2026

    @HengYangDS
    Author

    Still missing in CLI 0.167.0: codex queue --help has --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, while codex queue does 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIapp-serverenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions