Skip to content
TypeScript

test(server): the fake Claude CLI exits with its parent (#14926)

Yordis Prieto641426885921
diff --git a/apps/server/src/provider/Layers/ClaudeCapabilitiesProbe.test.ts b/apps/server/src/provider/Layers/ClaudeCapabilitiesProbe.test.ts
index 232b8cc02d0..bb6e5bd7c7d 100644
--- a/apps/server/src/provider/Layers/ClaudeCapabilitiesProbe.test.ts
+++ b/apps/server/src/provider/Layers/ClaudeCapabilitiesProbe.test.ts
@@ -129,7 +129,14 @@ it.layer(NodeServices.layer)("Claude capability probe SDK boundary", (it) => {
" });",
" }",
"});",
- "setInterval(() => {}, 1_000);",
+ "// Stay alive for follow-up control requests, but never outlive the",
+ "// parent: the probe aborts the SDK without awaiting the child, so an",
+ "// unconditional interval would strand this process until reboot.",
+ "const keepAlive = setInterval(() => {}, 1_000);",
+ 'lines.on("close", () => {',
+ " clearInterval(keepAlive);",
+ " process.exit(0);",
+ "});",
"",
].join("\n"),
);