From db4d1e77e11cb215515c58fc05a68f21ad5cd641 Mon Sep 17 00:00:00 2001 From: huihui Date: Sat, 21 Nov 2026 00:12:46 +0800 Subject: [PATCH 1/2] test(app-server): gate the stdio toolchain test on Unix The test writes a `#!/bin/sh` fixture and marks it executable through `std::os::unix::fs::PermissionsExt`, so the `mcp_session_flow` target did not compile for Windows. Its assertion also relies on the Unix program lookup reading the child `PATH`. Gate it with `#[cfg(unix)]`, as the other Unix-only tests in this crate's test targets do. --- crates/dim-app-server/tests/mcp_session_flow.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/dim-app-server/tests/mcp_session_flow.rs b/crates/dim-app-server/tests/mcp_session_flow.rs index fa8f0ae8e4..ef878acef7 100644 --- a/crates/dim-app-server/tests/mcp_session_flow.rs +++ b/crates/dim-app-server/tests/mcp_session_flow.rs @@ -3904,6 +3904,7 @@ async fn a_tool_call_deadline_is_shared_by_its_404_retry() { /// directory starts there and lists its tools: the child `PATH` appends the /// toolchain directories after the daemon's own, and on Unix the program /// lookup reads the child `PATH`. +#[cfg(unix)] #[tokio::test] async fn a_stdio_entry_starts_a_command_the_toolchain_source_provides() { use std::os::unix::fs::PermissionsExt; From fb9ac57d9ba6d128203a0a28a85db26195f30644 Mon Sep 17 00:00:00 2001 From: huihui Date: Sat, 21 Nov 2026 00:54:53 +0800 Subject: [PATCH 2/2] test(app-server): gate the stdio toolchain helper on Unix The helper only serves the Unix-only stdio toolchain test, so on Windows it and the toolchain imports it uses became dead code once the test was gated. Gate the helper and its `ShellStatus` and toolchain imports with `#[cfg(unix)]`; the Windows test build no longer warns. --- crates/dim-app-server/tests/mcp_session_flow.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/dim-app-server/tests/mcp_session_flow.rs b/crates/dim-app-server/tests/mcp_session_flow.rs index ef878acef7..a8302ac1de 100644 --- a/crates/dim-app-server/tests/mcp_session_flow.rs +++ b/crates/dim-app-server/tests/mcp_session_flow.rs @@ -6,7 +6,10 @@ use axum::{ response::{IntoResponse, Response, Sse, sse::Event}, routing::post, }; -use dim_agent_capabilities::host_platform::{HostPlatform, ShellStatus}; +use dim_agent_capabilities::host_platform::HostPlatform; +#[cfg(unix)] +use dim_agent_capabilities::host_platform::ShellStatus; +#[cfg(unix)] use dim_agent_capabilities::toolchain::{InstalledToolchain, ToolchainSourceHost}; use dim_agent_capabilities::{ adapters::{DefaultPrepareModelPlugin, MockTools}, @@ -568,6 +571,7 @@ impl Env { /// A Session whose stdio entry names a program only the installed /// runtime provides: the child `PATH` gets `bin` appended, so the bare /// command resolves there. + #[cfg(unix)] async fn with_stdio_toolchain(bin: PathBuf, root: PathBuf) -> Self { let fixture = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/mcp-minimal.cjs");