mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 00:41:36 +00:00
refactor: extract iMessage echo cache and unify suppression guards
This commit is contained in:
@@ -15,6 +15,7 @@ import { INTERNAL_MESSAGE_CHANNEL, normalizeMessageChannel } from "../../utils/m
|
||||
import type { OriginatingChannelType } from "../templating.js";
|
||||
import type { ReplyPayload } from "../types.js";
|
||||
import { normalizeReplyPayload } from "./normalize-reply.js";
|
||||
import { shouldSuppressReasoningPayload } from "./reply-payloads.js";
|
||||
|
||||
export type RouteReplyParams = {
|
||||
/** The reply payload to send. */
|
||||
@@ -56,7 +57,7 @@ export type RouteReplyResult = {
|
||||
*/
|
||||
export async function routeReply(params: RouteReplyParams): Promise<RouteReplyResult> {
|
||||
const { payload, channel, to, accountId, threadId, cfg, abortSignal } = params;
|
||||
if (payload.isReasoning) {
|
||||
if (shouldSuppressReasoningPayload(payload)) {
|
||||
return { ok: true };
|
||||
}
|
||||
const normalizedChannel = normalizeMessageChannel(channel);
|
||||
|
||||
Reference in New Issue
Block a user