Lightweight coding agent that runs in your terminal
Rust
Stabilize encrypted MAv2 spawn request test (#31586)
jif8dfd3975f5a7
diff --git a/codex-rs/core/tests/suite/subagent_notifications.rs b/codex-rs/core/tests/suite/subagent_notifications.rsindex 7424d3f360..fdaed25623 100644--- a/codex-rs/core/tests/suite/subagent_notifications.rs+++ b/codex-rs/core/tests/suite/subagent_notifications.rs@@ -1120,10 +1120,22 @@ async fn encrypted_multi_agent_v2_spawn_sends_agent_message_to_child() -> Resulttest.submit_turn(TURN_1_PROMPT).await?;- let child_request = wait_for_requests(&child_request_log)- .await?- .pop()- .expect("child request");+ // The response mock records candidate requests before its request matcher runs, so wait for+ // the child request instead of assuming the latest recorded request is already it.+ let deadline = Instant::now() + Duration::from_secs(2);+ let child_request = loop {+ if let Some(request) = child_request_log+ .requests()+ .into_iter()+ .find(|request| !request.inputs_of_type("agent_message").is_empty())+ {+ break request;+ }+ if Instant::now() >= deadline {+ anyhow::bail!("timed out waiting for child agent message request");+ }+ sleep(Duration::from_millis(10)).await;+ };assert_eq!(strip_metadata_from_json(Value::Array(child_request.inputs_of_type("agent_message"))),Value::Array(vec![json!({