From cc7266c801bc1179ac78065502a947b73841ad1d Mon Sep 17 00:00:00 2001 From: Hare Date: Fri, 7 Aug 2026 01:52:07 +0900 Subject: [PATCH] worker: cover parent teardown scope reclaim --- crates/worker/src/spawn/tool.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/crates/worker/src/spawn/tool.rs b/crates/worker/src/spawn/tool.rs index 5ce6fdad..38bd04e6 100644 --- a/crates/worker/src/spawn/tool.rs +++ b/crates/worker/src/spawn/tool.rs @@ -942,6 +942,23 @@ mod tests { .unwrap(); assert!(registry.get_internal("reviewer-child").is_none()); assert!(spawner_scope.snapshot().is_writable(&workspace_root)); + + let mut teardown_input = input; + teardown_input["name"] = serde_json::json!("reviewer-child-parent-drop"); + tool.execute( + &serde_json::to_string(&teardown_input).unwrap(), + llm_engine::tool::ToolExecutionContext::direct(), + ) + .await + .unwrap(); + assert!(!spawner_scope.snapshot().is_writable(&workspace_root)); + drop(list); + drop(read); + drop(send); + drop(stop); + drop(tool); + drop(registry); + assert!(spawner_scope.snapshot().is_writable(&workspace_root)); } #[test]