From e16f0cf908e22b0b8e3bcd528dc6bcdfaf8fcfc4 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Tue, 24 Mar 2026 11:01:37 -0700 Subject: [PATCH] refactor(channels): route registry lookups through runtime --- src/channels/registry.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/channels/registry.ts b/src/channels/registry.ts index 5a6a08dfd48..3c8050767a8 100644 --- a/src/channels/registry.ts +++ b/src/channels/registry.ts @@ -1,3 +1,4 @@ +import { getActivePluginRegistry } from "../plugins/runtime.js"; import { CHANNEL_IDS, CHAT_CHANNEL_ORDER, type ChatChannelId } from "./ids.js"; import type { ChannelMeta } from "./plugins/types.js"; import type { ChannelId } from "./plugins/types.js"; @@ -7,7 +8,6 @@ export type { ChatChannelId } from "./ids.js"; export type ChatChannelMeta = ChannelMeta; const WEBSITE_URL = "https://openclaw.ai"; -const REGISTRY_STATE = Symbol.for("openclaw.pluginRegistryState"); type RegisteredChannelPluginEntry = { plugin: { @@ -17,10 +17,7 @@ type RegisteredChannelPluginEntry = { }; function listRegisteredChannelPluginEntries(): RegisteredChannelPluginEntry[] { - const globalState = globalThis as typeof globalThis & { - [REGISTRY_STATE]?: { registry?: { channels?: RegisteredChannelPluginEntry[] | null } | null }; - }; - return globalState[REGISTRY_STATE]?.registry?.channels ?? []; + return getActivePluginRegistry()?.channels ?? []; } function findRegisteredChannelPluginEntry(