From e9a43d43c5942e351da454a760bf04adcb4dcd6b Mon Sep 17 00:00:00 2001 From: surajs-oai Date: Tue, 17 Nov 2026 16:58:29 +0000 Subject: [PATCH] Return empty success output from v2 `send_message` (#62093) ## What changed Remove the acknowledgment text and `followup_task` hint from successful v2 `send_message` responses, including messages sent to the root agent. The shared messaging handler now returns empty text with the success flag set. Update the idle eviction follow-up scenario snapshot to expect empty tool output. GitOrigin-RevId: 9eab3ae7264e6ddf3db6ae40a34cc895d0954621 --- .../core/src/tools/handlers/multi_agents_tests.rs | 6 +----- .../tools/handlers/multi_agents_v2/message_tool.rs | 12 +----------- ...rios__agent_eviction__idle_eviction_followup.snap | 2 +- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/codex-rs/core/src/tools/handlers/multi_agents_tests.rs b/codex-rs/core/src/tools/handlers/multi_agents_tests.rs index 03ff825bee..d1669b6587 100644 --- a/codex-rs/core/src/tools/handlers/multi_agents_tests.rs +++ b/codex-rs/core/src/tools/handlers/multi_agents_tests.rs @@ -1359,7 +1359,7 @@ async fn multi_agent_v2_send_message_accepts_root_target_from_child() { agent_role: None, }); - let output = SendMessageHandlerV2 + SendMessageHandlerV2 .handle(invocation( Arc::new(session), Arc::new(turn), @@ -1371,10 +1371,6 @@ async fn multi_agent_v2_send_message_accepts_root_target_from_child() { )) .await .expect("send_message should accept the root agent path"); - assert_eq!( - expect_text_output(output), - ("Message accepted.".to_string(), Some(true)) - ); assert!(manager.captured_ops().iter().any(|(id, op)| { *id == root.thread_id diff --git a/codex-rs/core/src/tools/handlers/multi_agents_v2/message_tool.rs b/codex-rs/core/src/tools/handlers/multi_agents_v2/message_tool.rs index 2f4636804c..8392960121 100644 --- a/codex-rs/core/src/tools/handlers/multi_agents_v2/message_tool.rs +++ b/codex-rs/core/src/tools/handlers/multi_agents_v2/message_tool.rs @@ -83,13 +83,6 @@ pub(super) async fn handle_message_string_tool( let receiver_agent_path = receipt.metadata.agent_path.ok_or_else(|| { FunctionCallError::RespondToModel("target agent is missing an agent_path".to_string()) })?; - let output = match mode { - MessageDeliveryMode::QueueOnly if receiver_agent_path.is_root() => "Message accepted.", - MessageDeliveryMode::QueueOnly => { - "Message accepted. If the recipient is idle and should act now, use followup_task to ask it to act on the message." - } - MessageDeliveryMode::TriggerTurn => "", - }; emit_sub_agent_activity( &session, &turn, @@ -104,8 +97,5 @@ pub(super) async fn handle_message_string_tool( ) .await; - Ok(FunctionToolOutput::from_text( - output.to_string(), - Some(true), - )) + Ok(FunctionToolOutput::from_text(String::new(), Some(true))) } diff --git a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_eviction__idle_eviction_followup.snap b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_eviction__idle_eviction_followup.snap index 4cac28c43c..45aff0252b 100644 --- a/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_eviction__idle_eviction_followup.snap +++ b/codex-rs/core/tests/suite/snapshots/all__suite__scenarios__agent_eviction__idle_eviction_followup.snap @@ -55,7 +55,7 @@ Scenario: A parent with no configured environment delegates an API migration, qu Run send_message for the API migration. -- request 4 (turn) -- 10:function_call/collaboration.send_message:{"message":"Use the new API for the migration.","target":"worker"} -11:function_call_output:Message accepted. If the recipient is idle and should act now, use followup_task to ask it to act on the message. +11:function_call_output: 12:agent_message -- request 5 (turn) -- 13:message/user: