mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 23:22:53 +00:00
Deliver Codex-native subagent completions through the generic plugin harness task runtime. Proof: - Autoreview clean on final branch. - Testbox changed gate: tbx_01ks80eqs7d2e3jq3p99zbm4wd, pnpm check:changed, exit 0. - Live Codex harness: tbx_01ks80p4ky32sqv2ksan2p0w0q, codex/gpt-5.5 API-key auth, native parent/child bridge tokens observed, exit 0. Co-authored-by: bryanpearson <bryanmpearson@gmail.com>
42 lines
1.4 KiB
TypeScript
42 lines
1.4 KiB
TypeScript
import { importFreshModule } from "openclaw/plugin-sdk/test-fixtures";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
describe("task registry process state", () => {
|
|
it("shares state across duplicate module instances", async () => {
|
|
const firstModule = await importFreshModule<typeof import("./task-registry.process-state.js")>(
|
|
import.meta.url,
|
|
"./task-registry.process-state.js?scope=task-registry-state-a",
|
|
);
|
|
const secondModule = await importFreshModule<typeof import("./task-registry.process-state.js")>(
|
|
import.meta.url,
|
|
"./task-registry.process-state.js?scope=task-registry-state-b",
|
|
);
|
|
const firstState = firstModule.getTaskRegistryProcessState();
|
|
const secondState = secondModule.getTaskRegistryProcessState();
|
|
|
|
firstState.tasks.set("task-duplicate", {
|
|
taskId: "task-duplicate",
|
|
runtime: "subagent",
|
|
taskKind: "agent-harness",
|
|
requesterSessionKey: "agent:main:parent",
|
|
ownerKey: "agent:main:parent",
|
|
scopeKind: "session",
|
|
runId: "agent-harness:child-duplicate",
|
|
task: "Duplicate module task",
|
|
status: "running",
|
|
deliveryStatus: "pending",
|
|
notifyPolicy: "silent",
|
|
createdAt: 1,
|
|
});
|
|
|
|
expect(secondState.tasks.get("task-duplicate")).toEqual(
|
|
expect.objectContaining({
|
|
runtime: "subagent",
|
|
taskKind: "agent-harness",
|
|
runId: "agent-harness:child-duplicate",
|
|
}),
|
|
);
|
|
firstState.tasks.clear();
|
|
});
|
|
});
|