From 496964fced3b0630acf2512e7f4da4b34163b0dc Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 27 Apr 2026 12:03:43 +0100 Subject: [PATCH] test: speed up subagent announce format e2e --- .../subagent-announce.format.e2e.test.ts | 59 ++++++++++++++++--- 1 file changed, 50 insertions(+), 9 deletions(-) diff --git a/src/agents/subagent-announce.format.e2e.test.ts b/src/agents/subagent-announce.format.e2e.test.ts index bc9cf2746bc..616745fa0d3 100644 --- a/src/agents/subagent-announce.format.e2e.test.ts +++ b/src/agents/subagent-announce.format.e2e.test.ts @@ -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",