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.
This commit is contained in:
Ziang Xie
2026-05-06 16:29:43 +08:00
committed by GitHub
parent 77b6d43088
commit 026e9558a9
+1 -1
View File
@@ -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);
}
}