fix(ci): reset flow registry in acp manager tests

This commit is contained in:
Vincent Koc
2026-04-02 20:04:19 +09:00
parent d49460b417
commit 474409deb5

View File

@@ -39,6 +39,7 @@ let AcpRuntimeError: typeof import("../runtime/errors.js").AcpRuntimeError;
let resetAcpSessionManagerForTests: typeof import("./manager.js").__testing.resetAcpSessionManagerForTests;
let findTaskByRunId: typeof import("../../tasks/task-registry.js").findTaskByRunId;
let resetTaskRegistryForTests: typeof import("../../tasks/task-registry.js").resetTaskRegistryForTests;
let resetFlowRegistryForTests: typeof import("../../tasks/flow-registry.js").resetFlowRegistryForTests;
let installInMemoryTaskRegistryRuntime: typeof import("../../test-utils/task-registry-runtime.js").installInMemoryTaskRegistryRuntime;
const baseCfg = {
@@ -54,11 +55,13 @@ async function withAcpManagerTaskStateDir(run: (root: string) => Promise<void>):
await withTempDir({ prefix: "openclaw-acp-manager-task-" }, async (root) => {
process.env.OPENCLAW_STATE_DIR = root;
resetTaskRegistryForTests({ persist: false });
resetFlowRegistryForTests({ persist: false });
installInMemoryTaskRegistryRuntime();
try {
await run(root);
} finally {
resetTaskRegistryForTests({ persist: false });
resetFlowRegistryForTests({ persist: false });
}
});
}
@@ -181,6 +184,7 @@ describe("AcpSessionManager", () => {
} = await import("./manager.js"));
({ AcpRuntimeError } = await import("../runtime/errors.js"));
({ findTaskByRunId, resetTaskRegistryForTests } = await import("../../tasks/task-registry.js"));
({ resetFlowRegistryForTests } = await import("../../tasks/flow-registry.js"));
({ installInMemoryTaskRegistryRuntime } =
await import("../../test-utils/task-registry-runtime.js"));
});
@@ -201,6 +205,7 @@ describe("AcpSessionManager", () => {
process.env.OPENCLAW_STATE_DIR = ORIGINAL_STATE_DIR;
}
resetTaskRegistryForTests({ persist: false });
resetFlowRegistryForTests({ persist: false });
});
it("marks ACP-shaped sessions without metadata as stale", () => {