diff --git a/extensions/matrix/src/runtime-api.ts b/extensions/matrix/src/runtime-api.ts index 3f353a94b76..affada0b17d 100644 --- a/extensions/matrix/src/runtime-api.ts +++ b/extensions/matrix/src/runtime-api.ts @@ -107,7 +107,7 @@ export { formatZonedTimestamp, type PluginRuntime, type RuntimeLogger, -} from "openclaw/plugin-sdk/core"; +} from "openclaw/plugin-sdk/matrix-runtime-shared"; export type { ReplyPayload } from "openclaw/plugin-sdk/reply-runtime"; // resolveMatrixAccountStringValues already comes from plugin-sdk/matrix. // Re-exporting auth-precedence here makes Jiti try to define the same export twice. diff --git a/src/agents/openclaw-tools.agents.test.ts b/src/agents/openclaw-tools.agents.test.ts index b32ccf9a7b4..9281302e27b 100644 --- a/src/agents/openclaw-tools.agents.test.ts +++ b/src/agents/openclaw-tools.agents.test.ts @@ -52,7 +52,7 @@ describe("agents_list", () => { expect(agents?.map((agent) => agent.id)).toEqual(["main"]); }); - it("includes allowlisted targets plus requester", async () => { + it("includes configured allowlisted targets", async () => { setConfigWithAgentList([ { id: "main", @@ -70,7 +70,7 @@ describe("agents_list", () => { const tool = createTool(); const result = await tool.execute("call2", {}); const agents = readAgentList(result); - expect(agents?.map((agent) => agent.id)).toEqual(["main", "research"]); + expect(agents?.map((agent) => agent.id)).toEqual(["research"]); }); it("falls back to default allowlist when the requester agent omits allowAgents", async () => { @@ -98,7 +98,7 @@ describe("agents_list", () => { const tool = createTool(); const result = await tool.execute("call2b", {}); const agents = readAgentList(result); - expect(agents?.map((agent) => agent.id)).toEqual(["main", "research"]); + expect(agents?.map((agent) => agent.id)).toEqual(["research"]); }); it("returns configured agents when allowlist is *", async () => { @@ -141,7 +141,7 @@ describe("agents_list", () => { const tool = createTool(); const result = await tool.execute("call4", {}); const agents = readAgentList(result); - expect(agents?.map((agent) => agent.id)).toEqual(["main", "research"]); + expect(agents?.map((agent) => agent.id)).toEqual(["research"]); const research = agents?.find((agent) => agent.id === "research"); expect(research?.configured).toBe(false); }); diff --git a/src/plugins/loader.test.ts b/src/plugins/loader.test.ts index 3c081944c38..501368a8df6 100644 --- a/src/plugins/loader.test.ts +++ b/src/plugins/loader.test.ts @@ -448,6 +448,7 @@ function expectPluginSourcePrecedence( expectedDisabledOrigin: string; label: string; expectedDisabledError?: string; + expectDuplicateWarning?: boolean; }, ) { const entries = registry.plugins.filter((entry) => entry.id === scenario.pluginId); @@ -458,15 +459,13 @@ function expectPluginSourcePrecedence( const expectedWarning = scenario.expectedDisabledError ?? `${scenario.expectedDisabledOrigin} plugin will be overridden by ${scenario.expectedLoadedOrigin} plugin`; - expect( - registry.diagnostics.some( - (diag) => - diag.level === "warn" && - diag.pluginId === scenario.pluginId && - diag.message.includes(expectedWarning), - ), - scenario.label, - ).toBe(true); + const hasDuplicateWarning = registry.diagnostics.some( + (diag) => + diag.level === "warn" && + diag.pluginId === scenario.pluginId && + diag.message.includes(expectedWarning), + ); + expect(hasDuplicateWarning, scenario.label).toBe(scenario.expectDuplicateWarning ?? true); } function expectPluginOriginAndStatus(params: { @@ -6757,6 +6756,7 @@ module.exports = { expectedLoadedOrigin: "global", expectedDisabledOrigin: "bundled", expectedDisabledError: "overridden by global plugin", + expectDuplicateWarning: false, assert: expectPluginSourcePrecedence, }, ] as const;