Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

fix(shell): gate worker_descendants_in for the plain Windows build

purpledf7651aa9bb4
diff --git a/src-tauri/src/commands/shell.rs b/src-tauri/src/commands/shell.rs
index 653c6912..ca4dd089 100644
--- a/src-tauri/src/commands/shell.rs
+++ b/src-tauri/src/commands/shell.rs
@@ -183,6 +183,16 @@ pub(crate) fn descendants(root: u32, sys: &sysinfo::System) -> Vec<u32> {
/// says nothing about the `pnpm install` underneath, and counting it as a
/// survivor would make every cancel wait out its full settle window. The name
/// matches nothing on Unix, so the filter is inert there.
+///
+/// The production path only reaches this from the non-Windows `kill_tree`
+/// below (Windows' own `kill_tree_with` walks `late_descendants` instead); a
+/// plain Windows build with no `#[cfg(test)]` therefore has no caller left
+/// for it, which `cargo clippy --all-targets -- -D warnings` flags as dead
+/// code in that one compilation unit even though the test build (via
+/// `test_support::worker_descendants_of`, used on every platform) keeps
+/// calling it. The gate below covers exactly the compilations that actually
+/// use it: every non-Windows build, and every build with tests enabled.
+#[cfg(any(not(windows), test))]
pub(crate) fn worker_descendants_in(sys: &sysinfo::System, root: u32) -> Vec<u32> {
use sysinfo::Pid;
descendants(root, sys)