From b3ce952ec982fdcb65f764b7d4eaaf635c37fad7 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 12 May 2026 13:47:44 +0000 Subject: [PATCH] fix: use Effect.ignore instead of Effect.asVoid in killDirectChild to prevent SIGKILL phase short-circuit Effect.asVoid only discards the success value but does not suppress errors. When child.kill fails (e.g., child already exited), the error propagates through Effect.all, causing the SIGTERM phase to fail and short-circuiting the SIGKILL escalation phase. This leaves orphaned serve processes alive. Effect.ignore both discards the value and suppresses errors, making killDirectChild infallible and allowing the full kill chain to complete. Also fix the same issue in the Windows path of killOpenCodeProcessGroup. --- apps/server/src/provider/opencodeRuntime.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/server/src/provider/opencodeRuntime.ts b/apps/server/src/provider/opencodeRuntime.ts index af820a8df9..ebebee01a2 100644 --- a/apps/server/src/provider/opencodeRuntime.ts +++ b/apps/server/src/provider/opencodeRuntime.ts @@ -450,7 +450,7 @@ const makeOpenCodeRuntime = Effect.gen(function* () { const killOpenCodeProcessGroup = (signal: NodeJS.Signals) => process.platform === "win32" - ? child.kill({ killSignal: signal, forceKillAfter: "1 second" }).pipe(Effect.asVoid) + ? child.kill({ killSignal: signal, forceKillAfter: "1 second" }).pipe(Effect.ignore) : Effect.sync(() => { try { process.kill(-Number(child.pid), signal); @@ -461,7 +461,7 @@ const makeOpenCodeRuntime = Effect.gen(function* () { } }); const killDirectChild = (signal: NodeJS.Signals) => - child.kill({ killSignal: signal, forceKillAfter: "1 second" }).pipe(Effect.asVoid); + child.kill({ killSignal: signal, forceKillAfter: "1 second" }).pipe(Effect.ignore); const killMatchingServeProcesses = (signal: NodeJS.Signals) => terminateMatchingOpenCodeServeProcesses({ binaryPath: input.binaryPath,