Skip to content

Bug: codex exec --json silently drops SendMessage, FollowupTask, InterruptAgent, and ListAgents collab_tool_call items #64533

Backlog

Description

@zsicheng0214

Version / Commit

  • Observed in: codex-cli 0.172.0 (codex exec --json)
  • Verified on main (065e18b)

Summary

In codex exec --json, multi-agent collaboration tool calls for SendMessage, FollowupTask, InterruptAgent, and ListAgents are silently dropped (return None) instead of being serialized as collab_tool_call JSONL events. Only SpawnAgent, SendInput, ResumeAgent, Wait, and CloseAgent are emitted.

Because codex exec --json is the machine-readable event stream for headless automation, CI, and trajectory auditing, dropping these four tool call types makes multi-agent handoffs and follow-up tasks invisible to downstream consumers.

Source Location (main @ 065e18b)

codex-rs/exec/src/event_processor_with_jsonl_output.rs:233-256:

            ThreadItemPayload::CollabAgentToolCall {
                tool,
                sender_thread_id,
                receiver_thread_ids,
                prompt,
                agents_states,
                status,
                ..
            } => Some(ExecThreadItem {
                id: make_id(),
                details: ThreadItemDetails::CollabToolCall(CollabToolCallItem {
                    tool: match tool {
                        CollabAgentTool::SendMessage
                        | CollabAgentTool::FollowupTask
                        | CollabAgentTool::InterruptAgent
                        | CollabAgentTool::ListAgents => return None,
                        CollabAgentTool::SpawnAgent => CollabTool::SpawnAgent,
                        CollabAgentTool::SendInput => CollabTool::SendInput,
                        ...

Reproduction

  1. Run codex exec --json on a multi-agent workflow that invokes send_message, followup_task, interrupt_agent, or list_agents (e.g., spawning subagents and sending a follow-up task or listing active agents).
  2. Inspect the emitted JSONL stream: spawn_agent / wait / close_agent appear as collab_tool_call items, whereas send_message, followup_task, interrupt_agent, and list_agents produce no item.started or item.completed events at all.

(Observed during TraceTrial-Bench Core-95 multi-agent evaluation on C6-infra-research-subagent-001 with [email protected].)

Expected Behavior

Add the corresponding CollabTool variants in codex-rs/exec/src/exec_events.rs (SendMessage, FollowupTask, InterruptAgent, ListAgents) and map them in event_processor_with_jsonl_output.rs so all multi-agent collaboration tool calls are faithfully represented in codex exec --json.

Related: #53017 (SDK TypeScript item types vs. exec JSONL wire format).

Activity

  1. added
    bug
    CLI
    exec
    subagent
    on Nov 29, 2026
  2. akhil9tiet commented on Nov 29, 2026

    @akhil9tiet

    I'm interested in working on this — please assign it to me.

  3. akhil9tiet commented on Nov 29, 2026

    @akhil9tiet

    I traced the mechanism against the code on main. In codex exec --json, the four multi-agent collaboration tool calls SendMessage, FollowupTask, InterruptAgent, and ListAgents are silently dropped instead of being serialized as collab_tool_call JSONL events — only SpawnAgent, SendInput, ResumeAgent, Wait, and CloseAgent are emitted.

    Root cause: in codex-rs/exec/src/event_processor_with_jsonl_output.rs (the ThreadItemPayload::CollabAgentToolCall arm, ~lines 233-256), the match on CollabAgentTool returns None for SendMessage | FollowupTask | InterruptAgent | ListAgents. And CollabTool in codex-rs/exec/src/exec_events.rs only defines SpawnAgent, SendInput, Wait, CloseAgent — there are no variants for the four dropped tools, so nothing can be emitted for them.

    Proposed fix: add SendMessage, FollowupTask, InterruptAgent, and ListAgents variants to CollabTool (serde snake_case, matching the existing naming) and map them in the event processor instead of returning None, so every multi-agent collaboration tool call is faithfully represented in the exec --json stream. Related: #53017 (SDK TypeScript item types vs. exec JSONL wire format).

    One distinction I checked: the TUI deliberately returns None for these four in codex-rs/tui/src/app/agent_status_feed.rs and codex-rs/tui/src/multi_agents.rs (noted there as analytics-only / V2 uses SubAgentActivity for display). That is a display-surface choice; this issue is about the machine-readable --json audit stream, where dropping them makes multi-agent handoffs and follow-up tasks invisible to downstream consumers.

    Codex's contributing docs do not accept external code PRs, so this claim is analysis-only: no PR will follow. I am only posting the interest + analysis comments above.

  4. four1er commented on Nov 29, 2026

    @four1er

    Hi — I'm reproducing this now and preparing a fix; I'll open a PR shortly.

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

    CLIbugexecsubagent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions