test: speed up subagent announce format e2e

This commit is contained in:
Peter Steinberger
2026-04-27 12:03:43 +01:00
parent a3144b6bfd
commit 496964fced

View File

@@ -158,6 +158,55 @@ const defaultOutcomeAnnounce = {
outcome: { status: "ok" } as const,
};
const announceFormatChannelPlugins = [
{
pluginId: "discord",
plugin: createChannelTestPluginBase({ id: "discord", label: "Discord" }),
source: "test",
},
{
pluginId: "slack",
plugin: {
...createChannelTestPluginBase({ id: "slack", label: "Slack" }),
messaging: {
resolveDeliveryTarget: (params: {
conversationId: string;
parentConversationId?: string;
}) => ({
to: `channel:${params.parentConversationId || params.conversationId}`,
...(params.parentConversationId ? { threadId: params.conversationId } : {}),
}),
},
},
source: "test",
},
{
pluginId: "matrix",
plugin: createChannelTestPluginBase({ id: "matrix", label: "Matrix" }),
source: "test",
},
{
pluginId: "telegram",
plugin: createChannelTestPluginBase({ id: "telegram", label: "Telegram" }),
source: "test",
},
{
pluginId: "whatsapp",
plugin: createChannelTestPluginBase({ id: "whatsapp", label: "WhatsApp" }),
source: "test",
},
{
pluginId: "bluebubbles",
plugin: createChannelTestPluginBase({ id: "bluebubbles", label: "BlueBubbles" }),
source: "test",
},
{
pluginId: "webchat",
plugin: createChannelTestPluginBase({ id: "webchat", label: "Web Chat" }),
source: "test",
},
];
function setConfigOverride(next: OpenClawConfig): void {
configOverride = next;
setRuntimeConfigSnapshot(configOverride);
@@ -355,15 +404,7 @@ describe("subagent announce formatting", () => {
});
sessionStore = {};
sessionBindingServiceTesting.resetSessionBindingAdaptersForTests();
setActivePluginRegistry(
createTestRegistry([
{
pluginId: "matrix",
plugin: createChannelTestPluginBase({ id: "matrix", label: "Matrix" }),
source: "test",
},
]),
);
setActivePluginRegistry(createTestRegistry(announceFormatChannelPlugins));
setConfigOverride({
session: {
mainKey: "main",