From 026e9558a9d4a4d845acb7b9d671e9fd2c276db9 Mon Sep 17 00:00:00 2001 From: Ziang Xie Date: Wed, 6 May 2026 16:29:43 +0800 Subject: [PATCH] fix: replace std::thread::sleep with tokio::time::sleep in async context (#831) The `execute` method of `ShellWaitTool` is async, but used `std::thread::sleep` which blocks the tokio worker thread. Replace with `tokio::time::sleep().await` so other tasks can make progress during the 50ms poll interval. --- crates/tui/src/tools/shell.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/tui/src/tools/shell.rs b/crates/tui/src/tools/shell.rs index 5e71e94a..f9ac5276 100644 --- a/crates/tui/src/tools/shell.rs +++ b/crates/tui/src/tools/shell.rs @@ -2438,7 +2438,7 @@ impl ToolSpec for ShellInteractTool { return Ok(build_shell_delta_tool_result(delta)); } - std::thread::sleep(Duration::from_millis(50)); + tokio::time::sleep(Duration::from_millis(50)).await; elapsed = elapsed.saturating_add(50); } }