mirror of
https://github.com/openai/codex.git
synced 2026-11-17 22:10:37 +00:00
Acknowledge agent messages and clarify how to wake idle recipients (#61894)
## What changed Return `Message accepted.` from the v2 `send_message` tool. For non-root recipients, also advise using `followup_task` when an idle agent should act immediately. Messages to the root agent receive only the acknowledgment. ## Testing Assert the acknowledgment when a child messages the root agent, and update the idle-eviction follow-up snapshot to include the guidance for non-root recipients. GitOrigin-RevId: bb0cf6039d9b693052a1747daa2e75fa25c13522
This commit is contained in:
@@ -1361,7 +1361,7 @@ async fn multi_agent_v2_send_message_accepts_root_target_from_child() {
|
||||
agent_role: None,
|
||||
});
|
||||
|
||||
SendMessageHandlerV2
|
||||
let output = SendMessageHandlerV2
|
||||
.handle(invocation(
|
||||
Arc::new(session),
|
||||
Arc::new(turn),
|
||||
@@ -1373,6 +1373,10 @@ 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
|
||||
|
||||
@@ -83,6 +83,13 @@ 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,
|
||||
@@ -97,5 +104,8 @@ pub(super) async fn handle_message_string_tool(
|
||||
)
|
||||
.await;
|
||||
|
||||
Ok(FunctionToolOutput::from_text(String::new(), Some(true)))
|
||||
Ok(FunctionToolOutput::from_text(
|
||||
output.to_string(),
|
||||
Some(true),
|
||||
))
|
||||
}
|
||||
|
||||
+1
-1
@@ -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:
|
||||
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.
|
||||
12:agent_message
|
||||
-- request 5 (turn) --
|
||||
13:message/user:
|
||||
|
||||
Reference in New Issue
Block a user