Skip to content

Attributed inter-agent messages: sender identity and role on codex queue and app-server inject, plus a consumption receipt event #45976

Open

Description

@sidkandan

What variant of Codex are you using?

CLI (codex-cli 0.153.4 on macOS 26.6, ChatGPT auth)

What feature would you like to see?

codex queue --thread <id> --message <text> and app-server thread/inject are the ways an external orchestrator can reach a running Codex session. Both deliver the text as if the user typed it: no sender identity, no role, no reply address. In a multi-agent setup (Codex and Claude Code sessions in tmux with a shared message bus) this costs two things:

  1. Provenance. The model cannot tell a peer agent's message from the human's instruction, so it treats agent text with the user's authority. We want agent-to-agent traffic attributed ("from agent X") and only the human's words treated as the human's.
  2. Correctness. [Bug] Inter-agent message can cause Codex to resurrect and answer an old user prompt #45894 reports that an inter-agent message arriving mid-conversation can make Codex resurrect and answer an old user prompt. An attributed, distinct input kind would let the runtime present the message as an event in the current thread state rather than as another user turn.

Proposal

  • codex queue: add --from <id> and --role <agent|system|user> (default user for compatibility). With --role agent, deliver the text as a distinct input item with the sender identity visible to the model (a developer-role message or an event block), never as a plain user prompt.
  • app-server: the same fields on thread/inject; emit a notification when a queued or injected item is consumed by a turn (for example thread/inputConsumed with the queue item id, thread id and turn id), so senders get a receipt instead of polling the queue store.
  • Document that queue acceptance is not a model-read receipt; the consumed event is the receipt.

Additional information

codex-cli 0.153.4 on macOS 26.6, ChatGPT auth. Related: #45894, #25446.

Activity

  1. added
    enhancement
    CLI
    app-server
    subagent
    on Sep 16, 2026
  2. github-actions commented on Sep 16, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  3. abcjhby2871 commented on Sep 24, 2026

    @abcjhby2871

    A useful prior art here is Claude Code's new cross-session messaging, which goes beyond agent-team/subagent messaging and allows independent user-started sessions to discover and message one another.

    Relevant docs:
    https://code.claude.com/docs/en/cross-session-messaging
    https://code.claude.com/docs/en/agent-teams

    Some semantics worth considering for Codex:

    • session discovery (Claude exposes ListAgents);
    • explicit SendMessage between independent sessions;
    • sender identity and a reply address, so peer-agent traffic is never confused with human input;
    • if the receiver is active, deliver between tool calls rather than interrupting a running tool;
    • if the receiver is idle, start a new turn from the message;
    • per-session inbound controls such as accept / hold / refuse;
    • local and cross-machine/cloud routing;
    • a one-shot notify_when_idle subscription: "tell me when session X next becomes idle/exits" without polling or spending model tokens in the watched session.

    That last primitive is especially interesting because it overlaps directly with long-running task / monitor workflows:

    thread A launches work in thread B
            ↓
    A subscribes to B idle/completion
            ↓
    A sleeps
            ↓
    B completes
            ↓
    one event wakes A
    

    Codex already appears to have much of the lower-level substrate:

    • codex queue --thread ... --message ...
    • app-server thread/inject
    • internal multi-agent protocol variants for sendMessage / listAgents

    So the gap may be less "invent messaging" and more productize cross-session messaging as a typed, attributed, routable event primitive.

    I would strongly prefer a message/event envelope along the lines of:

    id
    sender_thread
    sender_role = agent | system | external_event
    receiver_thread
    reply_to
    timestamp
    kind = message | completion | monitor_event | idle_notice
    payload
    delivery_state = queued | delivered | consumed | held | refused
    

    This could also become the shared substrate for the remote-monitor proposal in #44855:

    • monitor event → original thread;
    • monitor event → new thread;
    • worker thread → research/lead thread;
    • one experiment thread → another dependent experiment;
    • background session completion → parent/observer thread.

    In other words, cross-thread messaging and monitor wake should probably converge on the same session inbox / event bus, rather than becoming separate mechanisms.

    For safety/UX, sender provenance is essential. A peer agent's message should never inherit the authority of a human user message, and delivery/consumption receipts would avoid another polling loop.

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-serverenhancementsubagent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions