fix(reply): narrow cross-run suppression and harden dedupe-state persistence
This commit is contained in:
parent
15dd43f6bc
commit
a1e6f0f943
@ -440,16 +440,24 @@ export async function runReplyAgent(params: {
|
||||
activeSessionStore[sessionKey] = sessionDedupeEntry;
|
||||
}
|
||||
if (sessionKey && storePath) {
|
||||
await updateSessionStoreEntry({
|
||||
storePath,
|
||||
sessionKey,
|
||||
update: async () => ({
|
||||
lastMessagingToolSentAt: sessionDedupeEntry.lastMessagingToolSentAt,
|
||||
lastMessagingToolSentTexts: sessionDedupeEntry.lastMessagingToolSentTexts,
|
||||
lastMessagingToolSentMediaUrls: sessionDedupeEntry.lastMessagingToolSentMediaUrls,
|
||||
lastMessagingToolSentTargets: sessionDedupeEntry.lastMessagingToolSentTargets,
|
||||
}),
|
||||
});
|
||||
try {
|
||||
await updateSessionStoreEntry({
|
||||
storePath,
|
||||
sessionKey,
|
||||
update: async () => ({
|
||||
lastMessagingToolSentAt: sessionDedupeEntry.lastMessagingToolSentAt,
|
||||
lastMessagingToolSentTexts: sessionDedupeEntry.lastMessagingToolSentTexts,
|
||||
lastMessagingToolSentMediaUrls: sessionDedupeEntry.lastMessagingToolSentMediaUrls,
|
||||
lastMessagingToolSentTargets: sessionDedupeEntry.lastMessagingToolSentTargets,
|
||||
}),
|
||||
});
|
||||
} catch (error) {
|
||||
logger.warning(
|
||||
"Failed to persist messaging-tool dedupe state for session {}: {}",
|
||||
sessionKey,
|
||||
error,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -330,10 +330,9 @@ export function createFollowupRunner(params: {
|
||||
...(runResult.messagingToolSentMediaUrls ?? []),
|
||||
...(recentWindowActive ? (sessionEntry?.lastMessagingToolSentMediaUrls ?? []) : []),
|
||||
];
|
||||
const sentTargets = [
|
||||
...(runResult.messagingToolSentTargets ?? []),
|
||||
...(recentWindowActive ? (sessionEntry?.lastMessagingToolSentTargets ?? []) : []),
|
||||
];
|
||||
// Keep target-based suppression scoped to the current run only.
|
||||
// Session-level dedupe state is used for text/media duplicate filtering.
|
||||
const sentTargets = runResult.messagingToolSentTargets ?? [];
|
||||
|
||||
const dedupedPayloads = filterMessagingToolDuplicates({
|
||||
payloads: replyTaggedPayloads,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user