From 2a2560278325024de6f75f3451d111315eb23148 Mon Sep 17 00:00:00 2001 From: jif-oai Date: Thu, 21 May 2026 15:54:23 +0200 Subject: [PATCH] [codex] Stabilize subagent start hook test (#23882) ## What Remove the exact captured request-count assertion from the `SubagentStart` hook integration test while still waiting for the child request that matches the injected hook context. ## Why The test owns the start-hook behavior and already verifies that the child request reaches the context matcher plus that the start/session hook logs have the expected invocations. Counting every request captured by the response mock makes the test sensitive to lifecycle timing outside that contract and has been flaky in CI. ## Testing - `cargo test -p codex-core --test all suite::subagent_notifications::subagent_start_replaces_session_start_and_injects_context -- --exact` --- codex-rs/core/tests/suite/subagent_notifications.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/codex-rs/core/tests/suite/subagent_notifications.rs b/codex-rs/core/tests/suite/subagent_notifications.rs index 087e96658..d16c58a10 100644 --- a/codex-rs/core/tests/suite/subagent_notifications.rs +++ b/codex-rs/core/tests/suite/subagent_notifications.rs @@ -519,8 +519,7 @@ async fn subagent_start_replaces_session_start_and_injects_context() -> Result<( .await?; test.submit_turn(TURN_1_PROMPT).await?; - let child_requests = wait_for_requests(&child_request_log).await?; - assert_eq!(child_requests.len(), 1); + let _ = wait_for_requests(&child_request_log).await?; let start_inputs = wait_for_hook_log( test.codex_home_path(),