From 06e9a33d090d7d1d66ff4df0a423424c95f78123 Mon Sep 17 00:00:00 2001 From: jif-oai Date: Tue, 2 Jun 2026 14:48:04 +0200 Subject: [PATCH] fix: main oops (#25840) Fix main, comment is self-explainatory --- codex-rs/core/src/tools/handlers/multi_agents_tests.rs | 3 +++ 1 file changed, 3 insertions(+) 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 7a27197ea..d4ce84ad5 100644 --- a/codex-rs/core/src/tools/handlers/multi_agents_tests.rs +++ b/codex-rs/core/src/tools/handlers/multi_agents_tests.rs @@ -1887,6 +1887,9 @@ async fn multi_agent_v2_followup_task_completion_notifies_parent_on_every_turn() .start_thread((*turn.config).clone()) .await .expect("root thread should start"); + // Production spawn_agent calls happen after the parent turn has resolved + // and stored its runtime; mirror that before using the synthetic handler. + root.thread.codex.session.new_default_turn().await; session.services.agent_control = manager.agent_control(); session.conversation_id = root.thread_id; let session = Arc::new(session);