diff --git a/codex-rs/core/src/agent/control_tests.rs b/codex-rs/core/src/agent/control_tests.rs index 2cf7398f7d..fc71b13644 100644 --- a/codex-rs/core/src/agent/control_tests.rs +++ b/codex-rs/core/src/agent/control_tests.rs @@ -29,6 +29,8 @@ use tempfile::TempDir; use tokio::time::Duration; use tokio::time::sleep; use tokio::time::timeout; + +const MULTI_AGENT_EVENTUAL_TIMEOUT: Duration = Duration::from_secs(5); use toml::Value as TomlValue; async fn test_config_with_cli_overrides( @@ -1019,7 +1021,7 @@ async fn multi_agent_v2_completion_sends_inter_agent_message_to_direct_parent() ) .await; - timeout(Duration::from_secs(2), async { + timeout(MULTI_AGENT_EVENTUAL_TIMEOUT, async { loop { let delivered = harness .manager @@ -1056,7 +1058,7 @@ async fn multi_agent_v2_completion_sends_inter_agent_message_to_direct_parent() Vec::new(), "done".to_string(), ); - timeout(Duration::from_secs(2), async { + timeout(MULTI_AGENT_EVENTUAL_TIMEOUT, async { loop { let history_items = worker_thread .codex 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 873b55d660..8886f4e82b 100644 --- a/codex-rs/core/src/tools/handlers/multi_agents_tests.rs +++ b/codex-rs/core/src/tools/handlers/multi_agents_tests.rs @@ -48,6 +48,8 @@ use tokio::sync::Mutex; use tokio::time::timeout; use tokio_util::sync::CancellationToken; +const MULTI_AGENT_EVENTUAL_TIMEOUT: Duration = Duration::from_secs(5); + fn invocation( session: Arc, turn: Arc, @@ -426,7 +428,7 @@ async fn multi_agent_v2_spawn_returns_path_and_send_input_accepts_relative_path( Vec::new(), "continue".to_string(), ); - timeout(Duration::from_secs(2), async { + timeout(MULTI_AGENT_EVENTUAL_TIMEOUT, async { loop { let history_items = child_thread .codex @@ -537,7 +539,7 @@ async fn multi_agent_v2_send_input_accepts_structured_items() { "/root/worker", "[mention:$drive](app://google_drive)\nread the folder", ); - timeout(Duration::from_secs(2), async { + timeout(MULTI_AGENT_EVENTUAL_TIMEOUT, async { loop { let history_items = thread .codex