From 45d258f48e8713a7c99a39616f345da1c56a7ca7 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Tue, 27 Jan 2026 00:58:48 -0800 Subject: [PATCH] Fix test --- codex-rs/core/src/codex.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/codex-rs/core/src/codex.rs b/codex-rs/core/src/codex.rs index e3413f4f5b..094ae34f64 100644 --- a/codex-rs/core/src/codex.rs +++ b/codex-rs/core/src/codex.rs @@ -898,8 +898,6 @@ impl Session { next_internal_sub_id: AtomicU64::new(0), }); - sess.start_file_watcher_listener(); - // Dispatch the SessionConfiguredEvent first and then report any errors. // If resuming, include converted initial messages in the payload so UIs can render them immediately. let initial_messages = initial_history.get_event_msgs(); @@ -925,6 +923,9 @@ impl Session { sess.send_event_raw(event).await; } + // Start the watcher after SessionConfigured so it cannot emit earlier events. + sess.start_file_watcher_listener(); + // Construct sandbox_state before initialize() so it can be sent to each // MCP server immediately after it becomes ready (avoiding blocking). let sandbox_state = SandboxState {