From 51d1789cea07bde7800f7f7710eaecb7a0cd5ad0 Mon Sep 17 00:00:00 2001 From: Vincent Koc <25068+vincentkoc@users.noreply.github.com> Date: Sun, 21 Jun 2026 02:03:19 +0800 Subject: [PATCH] fix(release): terminate command descendants on signal --- scripts/openclaw-cross-os-release-checks.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/openclaw-cross-os-release-checks.ts b/scripts/openclaw-cross-os-release-checks.ts index 108adb66ec81..68f9694091e8 100644 --- a/scripts/openclaw-cross-os-release-checks.ts +++ b/scripts/openclaw-cross-os-release-checks.ts @@ -4034,13 +4034,14 @@ async function runCommandInvocation(invocation, options) { child.on("close", (exitCode) => { if (forwardedSignalExitCode !== undefined) { + // The leader can exit on SIGTERM while descendants remain in its group. + // Kill the group before unregistering so signal forwarding cannot leave them running. activeChildTree.killChildTree("SIGKILL"); - } - activeChildTree.unregister(); - if (forwardedSignalExitCode !== undefined) { + activeChildTree.unregister(); finalize(exitForwardedSignalWhenChildTreesDone); return; } + activeChildTree.unregister(); finalize(() => { const result = { exitCode: exitCode ?? 1,