mirror of
https://github.com/block/goose.git
synced 2026-07-17 12:56:20 +02:00
debug: Add detailed deduplication logging to identify blocking issue
- Add comprehensive logging to show exactly why messages are being blocked - Log both new and existing message details in deduplication checks - Show all comparison criteria (content, role, timestamp, ID) - This will help identify what existing message is causing the duplication block
This commit is contained in:
@@ -143,7 +143,33 @@ export default function Pair({
|
||||
const isVeryRecent = Math.abs(existing.created - msg.created) <= 2;
|
||||
const isDifferentId = existing.id !== msg.id;
|
||||
|
||||
return isSameContent && isSameRole && isVeryRecent && isDifferentId;
|
||||
const wouldBlock = isSameContent && isSameRole && isVeryRecent && isDifferentId;
|
||||
|
||||
if (wouldBlock) {
|
||||
console.log(`🔍 DEDUP: Found potential duplicate for ${source}:`, {
|
||||
newMessage: {
|
||||
id: msg.id,
|
||||
content: contentText.substring(0, 30) + '...',
|
||||
role: msg.role,
|
||||
timestamp: msg.created
|
||||
},
|
||||
existingMessage: {
|
||||
id: existing.id,
|
||||
content: existingText.substring(0, 30) + '...',
|
||||
role: existing.role,
|
||||
timestamp: existing.created
|
||||
},
|
||||
checks: {
|
||||
isSameContent,
|
||||
isSameRole,
|
||||
isVeryRecent,
|
||||
isDifferentId,
|
||||
timeDiff: Math.abs(existing.created - msg.created)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return wouldBlock;
|
||||
});
|
||||
|
||||
if (recentDuplicate) {
|
||||
|
||||
Reference in New Issue
Block a user