Files
openclaw/src/tasks/task-registry.process-state.test.ts
Bryan P f9d35dc681 fix(codex): deliver native subagent completions
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>
2026-05-22 15:28:46 +01:00

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();
});
});