This commit is contained in:
jif-oai
2025-10-16 11:22:21 +01:00
parent 597ac3b875
commit de430ae728
3 changed files with 4 additions and 4 deletions

View File

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

View File

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

View File

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