




















@@ -96,7 +96,7 @@ describe("shared Codex app-server client", () => {
9696await expect(listPromise).rejects.toThrow(
9797`Codex app-server ${MIN_CODEX_APP_SERVER_VERSION} or newer is required`,
9898);
99-expect(harness.process.kill).toHaveBeenCalledTimes(1);
99+expect(harness.process.stdin.destroyed).toBe(true);
100100startSpy.mockRestore();
101101});
102102@@ -111,7 +111,7 @@ describe("shared Codex app-server client", () => {
111111await expect(listCodexAppServerModels({ timeoutMs: 5 })).rejects.toThrow(
112112"codex app-server initialize timed out",
113113);
114-expect(first.process.kill).toHaveBeenCalledTimes(1);
114+expect(first.process.stdin.destroyed).toBe(true);
115115116116const secondList = listCodexAppServerModels({ timeoutMs: 1000 });
117117await sendInitializeResult(second, "openclaw/0.125.0 (macOS; test)");
@@ -128,7 +128,7 @@ describe("shared Codex app-server client", () => {
128128await expect(createIsolatedCodexAppServerClient({ timeoutMs: 5 })).rejects.toThrow(
129129"codex app-server initialize timed out",
130130);
131-expect(harness.process.kill).toHaveBeenCalledTimes(1);
131+expect(harness.process.stdin.destroyed).toBe(true);
132132});
133133134134it("passes the selected auth profile through the bridge helper", async () => {
@@ -288,7 +288,7 @@ describe("shared Codex app-server client", () => {
288288await expect(secondList).resolves.toEqual({ models: [] });
289289290290expect(startSpy).toHaveBeenCalledTimes(2);
291-expect(first.process.kill).toHaveBeenCalledWith("SIGTERM");
291+expect(first.process.stdin.destroyed).toBe(true);
292292});
293293294294it("does not let a superseded shared-client failure tear down the newer client", async () => {
@@ -347,7 +347,7 @@ describe("shared Codex app-server client", () => {
347347await expect(firstList).resolves.toEqual({ models: [] });
348348349349expect(clearSharedCodexAppServerClientIfCurrent(first.client)).toBe(true);
350-expect(first.process.kill).toHaveBeenCalledWith("SIGTERM");
350+expect(first.process.stdin.destroyed).toBe(true);
351351352352const secondList = listCodexAppServerModels({ timeoutMs: 1000 });
353353await sendInitializeResult(second, "openclaw/0.125.0 (macOS; test)");
@@ -357,7 +357,7 @@ describe("shared Codex app-server client", () => {
357357expect(clearSharedCodexAppServerClientIfCurrent(first.client)).toBe(false);
358358expect(second.process.kill).not.toHaveBeenCalled();
359359expect(clearSharedCodexAppServerClientIfCurrent(second.client)).toBe(true);
360-expect(second.process.kill).toHaveBeenCalledWith("SIGTERM");
360+expect(second.process.stdin.destroyed).toBe(true);
361361});
362362363363it("uses a fresh websocket Authorization header after shared-client token rotation", async () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。