fix(cycles): split reply config runtime seams

This commit is contained in:
Vincent Koc
2026-04-11 22:52:51 +01:00
parent 61da711b1a
commit 8470dc8e06
2 changed files with 7 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
import type { OpenClawConfig } from "../../config/types.openclaw.js";
import type { GetReplyOptions } from "../get-reply-options.types.js";
import type { FinalizedMsgContext } from "../templating.js";
import type { GetReplyFromConfig } from "./get-reply.types.js";
import type { ReplyDispatchKind, ReplyDispatcher } from "./reply-dispatcher.types.js";
export type DispatchFromConfigResult = {
@@ -13,7 +14,7 @@ export type DispatchFromConfigParams = {
cfg: OpenClawConfig;
dispatcher: ReplyDispatcher;
replyOptions?: Omit<GetReplyOptions, "onToolResult" | "onBlockReply">;
replyResolver?: typeof import("./get-reply-from-config.runtime.js").getReplyFromConfig;
replyResolver?: GetReplyFromConfig;
fastAbortResolver?: typeof import("./abort.runtime.js").tryFastAbortFromMessage;
formatAbortReplyTextResolver?: typeof import("./abort.runtime.js").formatAbortReplyText;
/** Optional config override passed to getReplyFromConfig (e.g. per-sender timezone). */

View File

@@ -1,5 +1,6 @@
import { getBundledChannelPlugin } from "../../channels/plugins/bundled.js";
import { getLoadedChannelPlugin, normalizeChannelId } from "../../channels/plugins/index.js";
import { getLoadedChannelPluginById } from "../../channels/plugins/registry-loaded.js";
import type { ChannelPlugin } from "../../channels/plugins/types.plugin.js";
import { normalizeAnyChannelId } from "../../channels/registry.js";
import {
normalizeOptionalLowercaseString,
normalizeOptionalString,
@@ -19,10 +20,9 @@ export function extractExplicitGroupId(raw: string | undefined | null): string |
}
const firstPart = trimmed.split(":").find(Boolean);
const channelId =
normalizeChannelId(firstPart ?? "") ?? normalizeOptionalLowercaseString(firstPart);
normalizeAnyChannelId(firstPart ?? "") ?? normalizeOptionalLowercaseString(firstPart);
const messaging = channelId
? (getLoadedChannelPlugin(channelId)?.messaging ??
getBundledChannelPlugin(channelId)?.messaging)
? (getLoadedChannelPluginById(channelId) as ChannelPlugin | undefined)?.messaging
: undefined;
const parsed = messaging?.parseExplicitTarget?.({ raw: trimmed }) ?? null;
if (parsed && parsed.chatType && parsed.chatType !== "direct") {