fix(ci): repair main test gates

This commit is contained in:
Peter Steinberger
2026-04-27 15:03:12 +01:00
parent a9648664c1
commit dacf43640a
3 changed files with 14 additions and 14 deletions

View File

@@ -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.

View File

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

View File

@@ -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;