From de430ae728a96ab49aee8bb0699e9f52cd0d0b07 Mon Sep 17 00:00:00 2001 From: jif-oai Date: Thu, 16 Oct 2025 11:22:21 +0100 Subject: [PATCH] R3 --- codex-rs/core/src/codex.rs | 2 +- codex-rs/core/src/mcp_tool_call.rs | 2 +- codex-rs/core/src/undo.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/codex-rs/core/src/codex.rs b/codex-rs/core/src/codex.rs index 8029437381..3a7016095e 100644 --- a/codex-rs/core/src/codex.rs +++ b/codex-rs/core/src/codex.rs @@ -860,7 +860,7 @@ impl Session { exec_command_context: ExecCommandContext, ) { // Ensure core pre-tool readiness (e.g., ghost snapshot) before the first tool call. - self.ensure_pretool_ready().await; + self.await_pretool_ready().await; let ExecCommandContext { sub_id, call_id, diff --git a/codex-rs/core/src/mcp_tool_call.rs b/codex-rs/core/src/mcp_tool_call.rs index e54b98ca10..da0dfc33bc 100644 --- a/codex-rs/core/src/mcp_tool_call.rs +++ b/codex-rs/core/src/mcp_tool_call.rs @@ -22,7 +22,7 @@ pub(crate) async fn handle_mcp_tool_call( arguments: String, ) -> ResponseInputItem { // Ensure core pre-tool readiness (e.g., ghost snapshot) before the first tool call. - sess.ensure_pretool_ready().await; + sess.await_pretool_ready().await; // Parse the `arguments` as JSON. An empty string is OK, but invalid JSON // is not. let arguments_value = if arguments.trim().is_empty() { diff --git a/codex-rs/core/src/undo.rs b/codex-rs/core/src/undo.rs index 39d8fe42ad..197efe9a2c 100644 --- a/codex-rs/core/src/undo.rs +++ b/codex-rs/core/src/undo.rs @@ -42,7 +42,7 @@ impl Session { let cwd = turn_context.cwd.clone(); let sess = Arc::clone(self); // Capture the readiness flag and token so we can always mark readiness, - // avoiding races with locks held by ensure_pretool_ready(). + // avoiding races with locks held by await_pretool_ready(). let ready_flag = Arc::clone(&flag); let ready_token = token; tokio::spawn(async move { @@ -87,7 +87,7 @@ impl Session { } /// Await pre-tool readiness (ghost snapshot) once. Subsequent calls resolve immediately. - pub async fn ensure_pretool_ready(&self) { + pub async fn await_pretool_ready(&self) { let flag_opt = { let active = self.active_turn.lock().await; match active.as_ref() {