























@@ -20,12 +20,7 @@ import {
2020import { hasControlCommand } from "openclaw/plugin-sdk/command-auth-native";
2121import type { DmPolicy, GroupPolicy, OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
2222import { resolveChannelContextVisibilityMode } from "openclaw/plugin-sdk/context-visibility-runtime";
23-import {
24-buildInboundHistoryFromMap,
25-buildPendingHistoryContextFromMap,
26-recordPendingHistoryEntryIfEnabled,
27-type HistoryEntry,
28-} from "openclaw/plugin-sdk/reply-history";
23+import { createChannelHistoryWindow, type HistoryEntry } from "openclaw/plugin-sdk/reply-history";
2924import { finalizeInboundContext } from "openclaw/plugin-sdk/reply-runtime";
3025import { resolveAgentRoute } from "openclaw/plugin-sdk/routing";
3126import { evaluateSupplementalContextVisibility } from "openclaw/plugin-sdk/security-runtime";
@@ -846,8 +841,7 @@ export async function resolveIMessageInboundDecision(params: {
846841const effectiveWasMentioned = mentionDecision.effectiveWasMentioned;
847842if (isGroup && requireMention && canDetectMention && mentionDecision.shouldSkip) {
848843params.logVerbose?.(`imessage: skipping group message (no mention)`);
849-recordPendingHistoryEntryIfEnabled({
850-historyMap: params.groupHistories,
844+createChannelHistoryWindow({ historyMap: params.groupHistories }).record({
851845historyKey: historyKey ?? "",
852846limit: params.historyLimit,
853847entry: historyKey
@@ -969,8 +963,8 @@ export function buildIMessageInboundContext(params: {
969963970964let combinedBody = body;
971965if (decision.isGroup && decision.historyKey) {
972-combinedBody = buildPendingHistoryContextFromMap({
973- historyMap: params.groupHistories,
966+const channelHistory = createChannelHistoryWindow({ historyMap: params.groupHistories });
967+combinedBody = channelHistory.buildPendingContext({
974968historyKey: decision.historyKey,
975969limit: params.historyLimit,
976970currentMessage: combinedBody,
@@ -990,8 +984,7 @@ export function buildIMessageInboundContext(params: {
990984const imessageTo = (decision.isGroup ? chatTarget : undefined) || `imessage:${decision.sender}`;
991985const inboundHistory =
992986decision.isGroup && decision.historyKey && params.historyLimit > 0
993- ? buildInboundHistoryFromMap({
994-historyMap: params.groupHistories,
987+ ? createChannelHistoryWindow({ historyMap: params.groupHistories }).buildInboundHistory({
995988historyKey: decision.historyKey,
996989limit: params.historyLimit,
997990})
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。