From d059658ad1920bdb36e98798f44009a5f4c51735 Mon Sep 17 00:00:00 2001 From: Michael Bolin Date: Wed, 1 Jul 2026 10:59:02 -0700 Subject: [PATCH 1/2] docs: add tag to fenced code block (#30851) Now consistent with the other examples and the syntax highlighting is improved. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 77c8d2199c..bb2a9d18c3 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ curl -fsSL https://chatgpt.com/codex/install.sh | sh Run the following on Windows to install Codex CLI: -``` +```shell powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex" ``` From b1d06b8c05980da2e29a06ea35db814c5620e636 Mon Sep 17 00:00:00 2001 From: Michael Bolin Date: Wed, 1 Jul 2026 13:53:22 -0700 Subject: [PATCH 2/2] Consolidate multi-agent v2 communication sends --- codex-rs/core/src/agent/control.rs | 23 +++++++++++++++++++++-- codex-rs/core/src/agent/control/spawn.rs | 20 ++++++++++++++++++-- 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/codex-rs/core/src/agent/control.rs b/codex-rs/core/src/agent/control.rs index 49bbab0f87..d44154ecd1 100644 --- a/codex-rs/core/src/agent/control.rs +++ b/codex-rs/core/src/agent/control.rs @@ -183,12 +183,31 @@ impl AgentControl { agent_id: ThreadId, communication: InterAgentCommunication, ) -> CodexResult { - let last_task_message = last_task_message_from_communication(&communication); let state = self.upgrade()?; let op = Op::InterAgentCommunication { communication }; self.ensure_execution_capacity_for_op(agent_id, &op).await?; + let Op::InterAgentCommunication { communication } = op else { + unreachable!("constructed as an inter-agent communication operation"); + }; + self.send_inter_agent_communication_after_capacity_check(agent_id, &state, communication) + .await + } + + async fn send_inter_agent_communication_after_capacity_check( + &self, + agent_id: ThreadId, + state: &Arc, + communication: InterAgentCommunication, + ) -> CodexResult { + let last_task_message = last_task_message_from_communication(&communication); let result = self - .handle_thread_request_result(agent_id, &state, state.send_op(agent_id, op).await) + .handle_thread_request_result( + agent_id, + state, + state + .send_op(agent_id, Op::InterAgentCommunication { communication }) + .await, + ) .await; if result.is_ok() { match last_task_message { diff --git a/codex-rs/core/src/agent/control/spawn.rs b/codex-rs/core/src/agent/control/spawn.rs index c4c40577ca..3e5d3cfce1 100644 --- a/codex-rs/core/src/agent/control/spawn.rs +++ b/codex-rs/core/src/agent/control/spawn.rs @@ -356,8 +356,24 @@ impl AgentControl { ) .await; - self.send_input_after_capacity_check(new_thread.thread_id, &state, initial_operation) - .await?; + match (multi_agent_version, initial_operation) { + (MultiAgentVersion::V2, Op::InterAgentCommunication { communication }) => { + self.send_inter_agent_communication_after_capacity_check( + new_thread.thread_id, + &state, + communication, + ) + .await?; + } + (_, initial_operation) => { + self.send_input_after_capacity_check( + new_thread.thread_id, + &state, + initial_operation, + ) + .await?; + } + } if multi_agent_version != MultiAgentVersion::V2 { let child_reference = agent_metadata .agent_path