diff --git a/src/auto-reply/reply/commands-subagents-info.test.ts b/src/auto-reply/reply/commands-subagents-info.test.ts index e5df5df4f86..c3c08daa6a0 100644 --- a/src/auto-reply/reply/commands-subagents-info.test.ts +++ b/src/auto-reply/reply/commands-subagents-info.test.ts @@ -1,3 +1,5 @@ +import os from "node:os"; +import path from "node:path"; import { beforeEach, describe, expect, it } from "vitest"; import { addSubagentRunForTests, @@ -9,7 +11,25 @@ import { failTaskRunByRunId } from "../../tasks/task-executor.js"; import { createTaskRecord, resetTaskRegistryForTests } from "../../tasks/task-registry.js"; import type { ReplyPayload } from "../types.js"; import { handleSubagentsInfoAction } from "./commands-subagents/action-info.js"; -import { baseCommandTestConfig } from "./commands.test-harness.js"; +import { + baseCommandTestConfig, + configureInMemoryTaskRegistryStoreForTests, +} from "./commands.test-harness.js"; + +const TEST_SESSION_STORE_PATH = path.join( + os.tmpdir(), + `openclaw-commands-subagents-info-${process.pid}.json`, +); + +function buildCommandTestConfig(): OpenClawConfig { + return { + ...baseCommandTestConfig, + session: { + ...baseCommandTestConfig.session, + store: TEST_SESSION_STORE_PATH, + }, + }; +} function buildInfoContext(params: { cfg: OpenClawConfig; runs: object[]; restTokens: string[] }) { return { @@ -30,7 +50,8 @@ function requireReplyText(reply: ReplyPayload | undefined): string { } beforeEach(() => { - resetTaskRegistryForTests(); + resetTaskRegistryForTests({ persist: false }); + configureInMemoryTaskRegistryStoreForTests(); resetSubagentRegistryForTests(); }); @@ -72,7 +93,7 @@ describe("subagents info", () => { terminalSummary: "Completed the requested task", deliveryStatus: "delivered", }); - const cfg = baseCommandTestConfig; + const cfg = buildCommandTestConfig(); const result = handleSubagentsInfoAction( buildInfoContext({ cfg, runs: [run], restTokens: ["1"] }), ); @@ -132,7 +153,7 @@ describe("subagents info", () => { ].join("\n"), terminalSummary: "Needs manual follow-up.", }); - const cfg = baseCommandTestConfig; + const cfg = buildCommandTestConfig(); const result = handleSubagentsInfoAction( buildInfoContext({ cfg, runs: [run], restTokens: ["1"] }), ); @@ -176,7 +197,7 @@ describe("subagents info", () => { const cfg = { commands: { text: true }, channels: { quietchat: { allowFrom: ["*"] } }, - session: { mainKey: "main", scope: "per-sender" }, + session: { mainKey: "main", scope: "per-sender", store: TEST_SESSION_STORE_PATH }, } as OpenClawConfig; const result = handleSubagentsInfoAction({ params: { diff --git a/test/extension-import-boundaries.test.ts b/test/extension-import-boundaries.test.ts index 7566f33b353..0cd278d8f24 100644 --- a/test/extension-import-boundaries.test.ts +++ b/test/extension-import-boundaries.test.ts @@ -57,13 +57,6 @@ describe("src extension import boundary inventory", () => { expect(await srcInventoryPromise).toEqual([]); }); - it("produces stable sorted output", async () => { - const first = await srcInventoryPromise; - const second = await collectSrcExtensionImportBoundaryInventory(); - - expect(second).toEqual(first); - }); - it("script json output stays empty", async () => { const jsonOutput = await srcJsonOutputPromise; @@ -78,13 +71,6 @@ describe("sdk/package extension import boundary inventory", () => { expect(await sdkPackageInventoryPromise).toEqual([]); }); - it("produces stable sorted output", async () => { - const first = await sdkPackageInventoryPromise; - const second = await collectSdkPackageExtensionImportBoundaryInventory(); - - expect(second).toEqual(first); - }); - it("script json output stays empty", async () => { const jsonOutput = await sdkPackageJsonOutputPromise;