test: align latest main runtime harnesses

This commit is contained in:
Peter Steinberger
2026-04-03 15:03:58 +01:00
parent 5bafa6edcf
commit 0324055d09
6 changed files with 75 additions and 26 deletions

View File

@@ -1,6 +1,11 @@
import { afterEach, describe, expect, it, vi } from "vitest";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { getTaskFlowById, resetTaskFlowRegistryForTests } from "../../tasks/task-flow-registry.js";
import { getTaskById, resetTaskRegistryForTests } from "../../tasks/task-registry.js";
import {
getTaskById,
resetTaskRegistryDeliveryRuntimeForTests,
resetTaskRegistryForTests,
setTaskRegistryDeliveryRuntimeForTests,
} from "../../tasks/task-registry.js";
import { createRuntimeTaskFlow } from "./runtime-taskflow.js";
const hoisted = vi.hoisted(() => {
@@ -14,10 +19,6 @@ const hoisted = vi.hoisted(() => {
};
});
vi.mock("../../tasks/task-registry-delivery-runtime.js", () => ({
sendMessage: hoisted.sendMessageMock,
}));
vi.mock("../../acp/control-plane/manager.js", () => ({
getAcpSessionManager: () => ({
cancelSession: hoisted.cancelSessionMock,
@@ -29,12 +30,19 @@ vi.mock("../../agents/subagent-control.js", () => ({
}));
afterEach(() => {
resetTaskRegistryDeliveryRuntimeForTests();
resetTaskRegistryForTests();
resetTaskFlowRegistryForTests({ persist: false });
vi.clearAllMocks();
});
describe("runtime TaskFlow", () => {
beforeEach(() => {
setTaskRegistryDeliveryRuntimeForTests({
sendMessage: hoisted.sendMessageMock,
});
});
it("binds managed TaskFlow operations to a session key", () => {
const runtime = createRuntimeTaskFlow();
const taskFlow = runtime.bindSession({