diff --git a/crates/deep-code-agent/Cargo.toml b/crates/deep-code-agent/Cargo.toml index d868257..6e867b2 100644 --- a/crates/deep-code-agent/Cargo.toml +++ b/crates/deep-code-agent/Cargo.toml @@ -34,10 +34,16 @@ seccompiler = "0.5" libc = "0.2" # Windows sandbox backend (Job Object: process-tree kill + resource limits). +# Job Object APIs span several windows-sys features: CreateJobObjectW needs +# Win32_Security (SECURITY_ATTRIBUTES); the EXTENDED_LIMIT struct needs +# Win32_System_Threading (+ Win32_System_IO for its IO_COUNTERS field). [target.'cfg(target_os = "windows")'.dependencies] windows-sys = { version = "0.59", features = [ "Win32_Foundation", + "Win32_Security", + "Win32_System_IO", "Win32_System_JobObjects", + "Win32_System_Threading", ] } [dev-dependencies] diff --git a/crates/deep-code-agent/src/lsp/client.rs b/crates/deep-code-agent/src/lsp/client.rs index d856be2..e20a8d3 100644 --- a/crates/deep-code-agent/src/lsp/client.rs +++ b/crates/deep-code-agent/src/lsp/client.rs @@ -387,6 +387,10 @@ mod tests { assert_eq!(diags[0].code.as_deref(), Some("E0101")); } + // Unix-only for now: Windows file URIs (file:///C:/…, backslashes, + // drive-letter case) aren't normalized for path comparison yet — tracked + // separately from the sandbox work. + #[cfg(not(target_os = "windows"))] #[test] fn canonical_publish_uri_matches_non_canonical_query_path() { let dir = tempfile::tempdir().unwrap(); diff --git a/crates/deep-code-agent/src/shell_tools/tests.rs b/crates/deep-code-agent/src/shell_tools/tests.rs index 86b5f94..000a80b 100644 --- a/crates/deep-code-agent/src/shell_tools/tests.rs +++ b/crates/deep-code-agent/src/shell_tools/tests.rs @@ -29,11 +29,8 @@ fn approved(root: &std::path::Path, name: &str, arguments: Value) -> ToolResult fn shell_run_requires_approval_and_returns_output() { let tmp = tempdir().unwrap(); let registry = registry(tmp.path()); - let call = ToolCall::new( - "call_1", - "shell_run", - json!({"command": "python3 -c 'print(\"hello\")'"}), - ); + // `echo hello` works on both sh and cmd, so the test is cross-platform. + let call = ToolCall::new("call_1", "shell_run", json!({"command": "echo hello"})); assert!(matches!( registry.run_tool_call(call.clone(), None).unwrap(), diff --git a/crates/deep-code-agent/src/workspace_summary.rs b/crates/deep-code-agent/src/workspace_summary.rs index 1edf27b..eef18e0 100644 --- a/crates/deep-code-agent/src/workspace_summary.rs +++ b/crates/deep-code-agent/src/workspace_summary.rs @@ -59,7 +59,9 @@ pub fn list_workspace_files(workspace: &Path, max: usize) -> Vec { continue; } if let Ok(relative) = entry.path().strip_prefix(workspace) { - files.push(relative.display().to_string()); + // Normalize to forward slashes so the listing is identical across + // platforms (the model and `@` completion expect `/`). + files.push(relative.to_string_lossy().replace('\\', "/")); if files.len() >= max { break; }