mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-15 19:21:08 +00:00
fix(cycles): split reply config runtime seams
This commit is contained in:
@@ -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). */
|
||||
|
||||
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user