@@ -2,7 +2,7 @@
|
2 | 2 | import fs from "node:fs"; |
3 | 3 | import path from "node:path"; |
4 | 4 | import { afterAll, afterEach, describe, expect, it, vi } from "vitest"; |
5 | | -import { listAgentHarnessIds } from "../agents/harness/registry.js"; |
| 5 | +import { listRegisteredAgentHarnesses } from "../agents/harness/registry.js"; |
6 | 6 | import { resolveConfigEnvVars } from "../config/env-substitution.js"; |
7 | 7 | import { applyPluginAutoEnable } from "../config/plugin-auto-enable.js"; |
8 | 8 | import { |
@@ -116,6 +116,10 @@ type PluginStartupTraceDetail = {
|
116 | 116 | metrics: ReadonlyArray<readonly [string, number | string]>; |
117 | 117 | }; |
118 | 118 | |
| 119 | +function listRegisteredAgentHarnessIdsForTest(): string[] { |
| 120 | +return listRegisteredAgentHarnesses().map((entry) => entry.harness.id); |
| 121 | +} |
| 122 | + |
119 | 123 | function countMatching<T>(items: readonly T[], predicate: (item: T) => boolean): number { |
120 | 124 | let count = 0; |
121 | 125 | for (const item of items) { |
@@ -2775,7 +2779,7 @@ module.exports = { id: "throws-after-import", register() {} };`,
|
2775 | 2779 | }, |
2776 | 2780 | onlyPluginIds: ["codex-harness"], |
2777 | 2781 | }); |
2778 | | -expect(listAgentHarnessIds()).toEqual(["codex"]); |
| 2782 | +expect(listRegisteredAgentHarnessIdsForTest()).toEqual(["codex"]); |
2779 | 2783 | |
2780 | 2784 | loadOpenClawPlugins({ |
2781 | 2785 | cache: false, |
@@ -2786,7 +2790,7 @@ module.exports = { id: "throws-after-import", register() {} };`,
|
2786 | 2790 | }, |
2787 | 2791 | }, |
2788 | 2792 | }); |
2789 | | -expect(listAgentHarnessIds()).toStrictEqual([]); |
| 2793 | +expect(listRegisteredAgentHarnessIdsForTest()).toStrictEqual([]); |
2790 | 2794 | }); |
2791 | 2795 | |
2792 | 2796 | it("rejects malformed plugin agent harness registrations", () => { |
@@ -2817,7 +2821,7 @@ module.exports = { id: "throws-after-import", register() {} };`,
|
2817 | 2821 | onlyPluginIds: ["bad-harness"], |
2818 | 2822 | }); |
2819 | 2823 | |
2820 | | -expect(listAgentHarnessIds()).toStrictEqual([]); |
| 2824 | +expect(listRegisteredAgentHarnessIdsForTest()).toStrictEqual([]); |
2821 | 2825 | const diagnostic = registry.diagnostics.find( |
2822 | 2826 | (entry) => |
2823 | 2827 | entry.level === "error" && |
|