From 8742e8fae3b7199dd69da9f0627752da4951e282 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 17 Apr 2026 21:52:59 +0100 Subject: [PATCH] test: stub channel migration setup surfaces --- src/commands/doctor-state-migrations.test.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/commands/doctor-state-migrations.test.ts b/src/commands/doctor-state-migrations.test.ts index cb03249f6d7..cd88c7a0429 100644 --- a/src/commands/doctor-state-migrations.test.ts +++ b/src/commands/doctor-state-migrations.test.ts @@ -88,6 +88,20 @@ vi.mock("../channels/plugins/bundled.js", () => { } return { + listBundledChannelLegacySessionSurfaces: vi.fn(() => [ + { + isLegacyGroupSessionKey: (key: string) => /^group:.+@g\.us$/i.test(key.trim()), + canonicalizeLegacySessionKey: ({ key, agentId }: { key: string; agentId: string }) => + /^group:.+@g\.us$/i.test(key.trim()) + ? `agent:${agentId}:whatsapp:${key.trim().toLowerCase()}` + : null, + }, + ]), + listBundledChannelLegacyStateMigrationDetectors: vi.fn(() => [ + ({ oauthDir }: { oauthDir: string }) => detectWhatsAppLegacyStateMigrations({ oauthDir }), + ({ cfg, env }: { cfg: OpenClawConfig; env: NodeJS.ProcessEnv }) => + detectTelegramAllowFromMigration({ cfg, env }), + ]), listBundledChannelSetupPluginsByFeature: vi.fn((feature: string) => { if (feature === "legacySessionSurfaces") { return [