mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:50:43 +00:00
test: avoid bundled session normalizer fallback
Keep explicit session-key normalization on loaded channel plugins so unknown provider contexts pass through without cold-loading bundled channel runtimes. This preserves active plugin behavior and removes the slow unknown-provider test path.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import type { MsgContext } from "../../auto-reply/templating.js";
|
||||
import { getChannelPlugin, listChannelPlugins } from "../../channels/plugins/index.js";
|
||||
import { getLoadedChannelPlugin, listChannelPlugins } from "../../channels/plugins/index.js";
|
||||
import {
|
||||
normalizeLowercaseStringOrEmpty,
|
||||
normalizeOptionalLowercaseString,
|
||||
@@ -38,7 +38,7 @@ function resolveExplicitSessionKeyNormalizerCandidates(
|
||||
export function normalizeExplicitSessionKey(sessionKey: string, ctx: MsgContext): string {
|
||||
const normalized = normalizeLowercaseStringOrEmpty(sessionKey);
|
||||
for (const channelId of resolveExplicitSessionKeyNormalizerCandidates(normalized, ctx)) {
|
||||
const normalize = getChannelPlugin(channelId)?.messaging?.normalizeExplicitSessionKey;
|
||||
const normalize = getLoadedChannelPlugin(channelId)?.messaging?.normalizeExplicitSessionKey;
|
||||
const next = normalize?.({ sessionKey: normalized, ctx });
|
||||
if (typeof next === "string" && next.trim()) {
|
||||
return normalizeLowercaseStringOrEmpty(next);
|
||||
|
||||
Reference in New Issue
Block a user