Repository navigation
Description
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
- Run
codex exec --jsonon a multi-agent workflow that invokessend_message,followup_task,interrupt_agent, orlist_agents(e.g., spawning subagents and sending a follow-up task or listing active agents). - Inspect the emitted JSONL stream:
spawn_agent/wait/close_agentappear ascollab_tool_callitems, whereassend_message,followup_task,interrupt_agent, andlist_agentsproduce noitem.startedoritem.completedevents 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
akhil9tiet commentedon Nov 29, 2026
I'm interested in working on this — please assign it to me.
akhil9tiet commentedon Nov 29, 2026
I traced the mechanism against the code on main. In
codex exec --json, the four multi-agent collaboration tool callsSendMessage,FollowupTask,InterruptAgent, andListAgentsare silently dropped instead of being serialized ascollab_tool_callJSONL events — onlySpawnAgent,SendInput,ResumeAgent,Wait, andCloseAgentare emitted.Root cause: in
codex-rs/exec/src/event_processor_with_jsonl_output.rs(theThreadItemPayload::CollabAgentToolCallarm, ~lines 233-256), the match onCollabAgentToolreturnsNoneforSendMessage | FollowupTask | InterruptAgent | ListAgents. AndCollabToolincodex-rs/exec/src/exec_events.rsonly definesSpawnAgent,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, andListAgentsvariants toCollabTool(serde snake_case, matching the existing naming) and map them in the event processor instead of returningNone, so every multi-agent collaboration tool call is faithfully represented in theexec --jsonstream. Related: #53017 (SDK TypeScript item types vs. exec JSONL wire format).One distinction I checked: the TUI deliberately returns
Nonefor these four incodex-rs/tui/src/app/agent_status_feed.rsandcodex-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--jsonaudit 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.
four1er commentedon Nov 29, 2026
Hi — I'm reproducing this now and preparing a fix; I'll open a PR shortly.