mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 20:28:29 +00:00
fix: scope history injection to pending-only
This commit is contained in:
@@ -124,7 +124,6 @@ export const dispatchTelegramMessage = async ({
|
||||
identityName: resolveIdentityName(cfg, route.agentId),
|
||||
};
|
||||
|
||||
let didSendReply = false;
|
||||
const { queuedFinal } = await dispatchReplyWithBufferedBlockDispatcher({
|
||||
ctx: ctxPayload,
|
||||
cfg,
|
||||
@@ -147,7 +146,6 @@ export const dispatchTelegramMessage = async ({
|
||||
messageThreadId: resolvedThreadId,
|
||||
onVoiceRecording: sendRecordVoice,
|
||||
});
|
||||
didSendReply = true;
|
||||
},
|
||||
onError: (err, info) => {
|
||||
runtime.error?.(danger(`telegram ${info.kind} reply failed: ${String(err)}`));
|
||||
@@ -174,7 +172,7 @@ export const dispatchTelegramMessage = async ({
|
||||
});
|
||||
draftStream?.stop();
|
||||
if (!queuedFinal) {
|
||||
if (isGroup && historyKey && historyLimit > 0 && didSendReply) {
|
||||
if (isGroup && historyKey && historyLimit > 0) {
|
||||
clearHistoryEntries({ historyMap: groupHistories, historyKey });
|
||||
}
|
||||
return;
|
||||
@@ -189,7 +187,7 @@ export const dispatchTelegramMessage = async ({
|
||||
});
|
||||
});
|
||||
}
|
||||
if (isGroup && historyKey && historyLimit > 0 && didSendReply) {
|
||||
if (isGroup && historyKey && historyLimit > 0) {
|
||||
clearHistoryEntries({ historyMap: groupHistories, historyKey });
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user