From c99b77060d10e25c49f6c195b3b2ba1ca9e43edf Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Fri, 23 Oct 2026 16:12:28 -0400 Subject: [PATCH] Test: the Place queue is checked against the read roots --- crates/mcp/tests/automation_roots.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/mcp/tests/automation_roots.rs b/crates/mcp/tests/automation_roots.rs index 2c76d658c..ba098bf2d 100644 --- a/crates/mcp/tests/automation_roots.rs +++ b/crates/mcp/tests/automation_roots.rs @@ -155,3 +155,13 @@ fn links_out_of_a_root_are_refused() { refused(&mut server, "export", json!({"path": s(&base.join("out/away/art.png"))}), "outside the write root"); assert!(!base.join("outside/art.png").exists()); } + +/// The Place tool keeps its queue until a click, which no scope confines: a queued file outside the +/// read root is refused when the queue is set. +#[test] +fn the_place_queue_names_only_files_inside_the_read_root() { + let (mut server, base) = confined("place-queue", true, true); + let queue = |file: &str| json!({"tool": "place", "key": "queue", "value": {"entries": [{"params": {"path": s(&base.join(file))}, "name": "x", "width": 10, "height": 10}]}}); + ok(&mut server, "run_command", json!({"command": "tool.setOption", "params": queue("in/a.svg")})); + refused(&mut server, "run_command", json!({"command": "tool.setOption", "params": queue("outside/b.svg")}), "outside the read root"); +}