From 22f3701d92d7381e9c5193898048ca313ad40d14 Mon Sep 17 00:00:00 2001 From: Mathews-Tom Date: Sat, 18 Jul 2026 00:47:14 +0530 Subject: [PATCH 1/3] test(mcp): distinguish zombie grandchildren from live ones in kill checks kill(pid, 0) succeeds for a zombie too: a grandchild whose parent (the killed leader) is gone sits as until whatever reaps orphans gets around to it, which can lag on some hosts. processExists() now reads the process's ps state and treats a zombie as already reaped instead of still alive, so the group-kill regression tests assert what they actually claim to test. --- packages/coding-agent/src/mcp/transports/stdio.test.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/coding-agent/src/mcp/transports/stdio.test.ts b/packages/coding-agent/src/mcp/transports/stdio.test.ts index 7d91685f4..9c2d60f86 100644 --- a/packages/coding-agent/src/mcp/transports/stdio.test.ts +++ b/packages/coding-agent/src/mcp/transports/stdio.test.ts @@ -153,13 +153,21 @@ describe.skipIf(process.platform === "win32")("StdioTransport request write stal }, 8000); }); +// `kill(pid, 0)` succeeds for a zombie too: a grandchild whose parent (the +// killed leader) is gone sits as until whatever reaps orphans +// (init/subreaper) gets around to it — which can lag on some hosts. A +// zombie already received and honored the group SIGKILL; it is just not +// harvested yet, so treating it as "still alive" would make the group-kill +// assertions below flaky rather than testing what they claim to test. function processExists(pid: number): boolean { try { process.kill(pid, 0); - return true; } catch { return false; } + const result = Bun.spawnSync(["ps", "-o", "stat=", "-p", String(pid)]); + const state = result.stdout.toString().trim(); + return result.exitCode === 0 && state.length > 0 && !state.startsWith("Z"); } // Regression for #5578: `close()` used a bare `this.#process.kill()` (direct From 1373e2f8457088c60e27857144c5cf027d34bf08 Mon Sep 17 00:00:00 2001 From: Mathews-Tom Date: Sat, 18 Jul 2026 03:08:20 +0530 Subject: [PATCH 2/3] chore: trigger mergeability recompute From 421fdb182daca10e5de016c265b47dc4c0c67f42 Mon Sep 17 00:00:00 2001 From: Mathews-Tom Date: Sat, 18 Jul 2026 03:33:54 +0530 Subject: [PATCH 3/3] chore: retrigger CI after PR reopen