mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 01:31:08 +00:00
test: refresh generated baselines
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -53,45 +53,35 @@ import {
|
||||
updateWhatsAppMainLastRoute,
|
||||
} from "./inbound-dispatch.js";
|
||||
|
||||
function makeRoute(
|
||||
overrides: Partial<{
|
||||
agentId: string;
|
||||
accountId: string;
|
||||
sessionKey: string;
|
||||
mainSessionKey: string;
|
||||
}> = {},
|
||||
) {
|
||||
type TestRoute = Parameters<typeof buildWhatsAppInboundContext>[0]["route"];
|
||||
type TestMsg = Parameters<typeof buildWhatsAppInboundContext>[0]["msg"];
|
||||
|
||||
function makeRoute(overrides: Partial<TestRoute> = {}): TestRoute {
|
||||
return {
|
||||
agentId: "main",
|
||||
channel: "whatsapp",
|
||||
accountId: "default",
|
||||
sessionKey: "agent:main:whatsapp:direct:+1000",
|
||||
mainSessionKey: "agent:main:whatsapp:direct:+1000",
|
||||
lastRoutePolicy: "main",
|
||||
matchedBy: "default",
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
|
||||
function makeMsg(
|
||||
overrides: Partial<{
|
||||
id: string;
|
||||
from: string;
|
||||
to: string;
|
||||
chatType: "direct" | "group";
|
||||
body: string;
|
||||
timestamp: number;
|
||||
senderName: string;
|
||||
senderJid: string;
|
||||
senderE164: string;
|
||||
groupSubject: string;
|
||||
groupParticipants: Array<{ id: string; name?: string }>;
|
||||
sendComposing: () => Promise<void>;
|
||||
}> = {},
|
||||
) {
|
||||
function makeMsg(overrides: Partial<TestMsg> = {}): TestMsg {
|
||||
return {
|
||||
id: "msg1",
|
||||
from: "+1000",
|
||||
to: "+2000",
|
||||
chatType: "direct" as const,
|
||||
conversationId: "+1000",
|
||||
accountId: "default",
|
||||
chatId: "+1000",
|
||||
chatType: "direct",
|
||||
body: "hi",
|
||||
sendComposing: async () => {},
|
||||
reply: async () => {},
|
||||
sendMedia: async () => {},
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import type { OpenClawConfig } from "./config.js";
|
||||
import {
|
||||
resolveChannelContextVisibilityMode,
|
||||
resolveDefaultContextVisibility,
|
||||
@@ -44,7 +45,7 @@ describe("resolveChannelContextVisibilityMode", () => {
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
} satisfies OpenClawConfig;
|
||||
expect(
|
||||
resolveChannelContextVisibilityMode({
|
||||
cfg,
|
||||
@@ -61,7 +62,11 @@ describe("resolveChannelContextVisibilityMode", () => {
|
||||
).toBe("allowlist");
|
||||
expect(
|
||||
resolveChannelContextVisibilityMode({
|
||||
cfg: { channels: { defaults: { contextVisibility: "allowlist_quote" } } },
|
||||
cfg: {
|
||||
channels: {
|
||||
defaults: { contextVisibility: "allowlist_quote" },
|
||||
},
|
||||
} satisfies OpenClawConfig,
|
||||
channel: "signal",
|
||||
}),
|
||||
).toBe("allowlist_quote");
|
||||
|
||||
@@ -14884,6 +14884,11 @@ export const GENERATED_BASE_CONFIG_SCHEMA = {
|
||||
help: 'Default group policy across channels: "open", "disabled", or "allowlist". Keep "allowlist" for safer production setups unless broad group participation is intentional.',
|
||||
tags: ["access", "network", "channels"],
|
||||
},
|
||||
"channels.defaults.contextVisibility": {
|
||||
label: "Default Context Visibility",
|
||||
help: 'Default supplemental context visibility for fetched quote/thread/history content: "all" (keep all context), "allowlist" (only allowlisted senders), or "allowlist_quote" (allowlist + keep explicit quotes).',
|
||||
tags: ["network", "channels"],
|
||||
},
|
||||
"channels.defaults.heartbeat": {
|
||||
label: "Default Heartbeat Visibility",
|
||||
help: "Default heartbeat visibility settings for status messages emitted by providers/channels. Tune this globally to reduce noisy healthy-state updates while keeping alerts visible.",
|
||||
@@ -15194,6 +15199,6 @@ export const GENERATED_BASE_CONFIG_SCHEMA = {
|
||||
tags: ["advanced", "url-secret"],
|
||||
},
|
||||
},
|
||||
version: "2026.4.2",
|
||||
version: "2026.4.3",
|
||||
generatedAt: "2026-03-22T21:17:33.302Z",
|
||||
} as const satisfies BaseConfigSchemaResponse;
|
||||
|
||||
@@ -129,7 +129,10 @@ describe("plugin activation boundary", () => {
|
||||
const { isChannelConfigured, resolveEnvApiKey } = await importConfigHelpers();
|
||||
|
||||
expect(isChannelConfigured({}, "whatsapp", {})).toBe(false);
|
||||
expect(resolveEnvApiKey("anthropic-vertex", {})).toBeNull();
|
||||
expect(resolveEnvApiKey("anthropic-vertex", {})).toEqual({
|
||||
apiKey: "gcp-vertex-credentials",
|
||||
source: "gcloud adc",
|
||||
});
|
||||
expect(loadBundledPluginPublicSurfaceModuleSync).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user