From 3a1b3500658ea86a88a70b79aac9bf15a85977a9 Mon Sep 17 00:00:00 2001 From: Kevin Rajan <7121943+kvnloo@users.noreply.github.com> Date: Mon, 12 Oct 2026 03:12:51 -0500 Subject: [PATCH] test(codex): accept Windows nonzero SIGKILL exit and use service subpath The SIGKILL path can succeed with a nonzero numeric exitCode on Windows; POSIX may fail the Effect. Keep the explicit exit-code-7 case strict and let the existing end-to-end recovery assertions prove session and run cleanup on either OS. Windows diagnosis and downstream run: AdEx-Partners-DE. Original recovery implementation: voltcrash. Import feedback: CodeRabbit. Independent fork-only adaptation: GPT-6 / ChatGPT under Kevin's direction. --- .../CodexSessionRecovery.integration.test.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/server/src/orchestration-v2/Adapters/CodexSessionRecovery.integration.test.ts b/apps/server/src/orchestration-v2/Adapters/CodexSessionRecovery.integration.test.ts index 865eb48f46726..a1c3108f87312 100644 --- a/apps/server/src/orchestration-v2/Adapters/CodexSessionRecovery.integration.test.ts +++ b/apps/server/src/orchestration-v2/Adapters/CodexSessionRecovery.integration.test.ts @@ -10,7 +10,8 @@ import * as Option from "effect/Option"; import * as Path from "effect/Path"; import * as Schema from "effect/Schema"; import * as Stream from "effect/Stream"; -import { ChildProcess, ChildProcessSpawner } from "effect/process"; +import { ChildProcess } from "effect/process"; +import * as ChildProcessSpawner from "effect/process/ChildProcessSpawner"; import * as ServerConfig from "../../config.ts"; import * as ProviderEventLoggers from "@t3tools/provider-core/server/ProviderEventLoggers"; @@ -150,8 +151,14 @@ describe("Codex shared session recovery", () => { ); } const exit = yield* Effect.exit(handle.exitCode); - assert.equal(Exit.isFailure(exit), termination === "SIGKILL"); - if (Exit.isSuccess(exit)) assert.equal(Number(exit.value), 7); + if (termination === "exit code") { + assert.isTrue(Exit.isSuccess(exit)); + if (Exit.isSuccess(exit)) assert.equal(Number(exit.value), 7); + } else if (Exit.isSuccess(exit)) { + // Windows may report a nonzero exit code after SIGKILL instead of + // failing the exitCode Effect, unlike POSIX. + assert.notEqual(Number(exit.value), 0); + } // Await committed failures, rather than guessing when the event pump ran. yield* eventSink