This commit is contained in:
Eric Traut
2026-01-27 00:58:48 -08:00
parent cc5c6d1d9f
commit 45d258f48e

View File

@@ -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 {