From ee75272917d3f354cb48442c2f5448f692d113a4 Mon Sep 17 00:00:00 2001 From: Hare Date: Fri, 7 Aug 2026 02:05:43 +0900 Subject: [PATCH] worker: materialize legacy child cleanup only when needed --- crates/worker/src/spawn/registry.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/worker/src/spawn/registry.rs b/crates/worker/src/spawn/registry.rs index 77eb1147..372acb60 100644 --- a/crates/worker/src/spawn/registry.rs +++ b/crates/worker/src/spawn/registry.rs @@ -113,7 +113,10 @@ impl SpawnedWorkerRegistry { // Runtime projection is migration input only; the normal Internal registry is never // materialized into spawned_workers.json. - runtime_dir.write_spawned_workers(&[]).await?; + let legacy_projection_exists = runtime_dir.path().join("spawned_workers.json").exists(); + if !persisted_children.is_empty() || legacy_projection_exists { + runtime_dir.write_spawned_workers(&[]).await?; + } if !persisted_children.is_empty() { let reclaimed = persisted_children .iter()